From 68bf914dc6765912708ecb874b138e21f5fcfea5 Mon Sep 17 00:00:00 2001 From: Yoan Tournade Date: Thu, 17 Oct 2019 21:12:46 +0200 Subject: [PATCH 1/5] Add Makefile targets to do a Pypi release of Nostril package --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..691b1a7 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +install-release-tools: + pip install --user twine + +release: + python setup.py sdist + python setup.py bdist_wheel --universal + twine check dist/* + twine upload dist/* \ No newline at end of file From 5241378436e036181e0b83925a17385e9d46ab2e Mon Sep 17 00:00:00 2001 From: Yoan Tournade Date: Thu, 17 Oct 2019 21:13:22 +0200 Subject: [PATCH 2/5] Use README.md as package long description (would be better on Pypi package page) --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ab19cad..b7ab40f 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ with open(path.join(here, 'requirements.txt')) as f: reqs = f.read().rstrip().splitlines() +with open("README.md") as f: + readme_markdown = f.read() + # The following reads the variables without doing an "import nostril", # because the latter will cause the python execution environment to fail if # any dependencies are not already installed -- negating most of the reason @@ -35,7 +38,8 @@ setup( name = version['__title__'].lower(), description = version['__description__'], - long_description = 'Nostril (Nonsense String Evaluator) implements a heuristic mechanism to infer whether a given word or text string is likely to be meaningful or nonsense.', + long_description = readme_markdown, + long_description_content_type="text/markdown", version = version['__version__'], url = version['__url__'], author = version['__author__'], From d0a5edc3718233d44b90f544b5ea2b4ae28ce9b8 Mon Sep 17 00:00:00 2001 From: Yoan Tournade Date: Thu, 17 Oct 2019 21:24:24 +0200 Subject: [PATCH 3/5] Add target to test upload on Test Pypi --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 691b1a7..07aecca 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ install-release-tools: pip install --user twine -release: +release-pypi-test: + python setup.py sdist + python setup.py bdist_wheel --universal + twine check dist/* + twine upload --repository-url https://test.pypi.org/legacy/ dist/* + +release-pypi: python setup.py sdist python setup.py bdist_wheel --universal twine check dist/* From 86c97f0e3463d1a029ef7a3a4d28fb2bc3e90b83 Mon Sep 17 00:00:00 2001 From: Yoan Tournade Date: Thu, 17 Oct 2019 21:35:20 +0200 Subject: [PATCH 4/5] Suggest an alternative name for Pypi, as nostril is already taken. It won't change the name of the package installed --- .gitignore | 1 + setup.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 37486c0..0e67c2c 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,4 @@ build dist README.html nostril.egg-info +casics_nostril.egg-info \ No newline at end of file diff --git a/setup.py b/setup.py index b7ab40f..ce57b70 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,12 @@ # Finally, define our namesake. setup( - name = version['__title__'].lower(), + # We use an alternative name (casics-nostril) on PyPi, + # as nostril is already used by https://pypi.org/project/nostril/ + # Users will have to use pip install casics-nostril, + # but it won't change the installed package name (nostril), + # which is defined in the packages property. + name = "casics-{}".format(version['__title__'].lower()), description = version['__description__'], long_description = readme_markdown, long_description_content_type="text/markdown", From 7c0503ffa9ac740235cda440bb434efde34ddaf5 Mon Sep 17 00:00:00 2001 From: Yoan Tournade Date: Thu, 17 Oct 2019 21:44:56 +0200 Subject: [PATCH 5/5] Update README with the pip install from Pypy instruction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f4f314..ca5e362 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Please also use the DOI to indicate the specific version you use, to improve oth The following is probably the simplest and most direct way to install Nostril on your computer: ``` -sudo pip3 install git+https://github.com/casics/nostril.git +sudo pip3 install casics-nostril ``` Alternatively, you can clone this repository and then run `setup.py`: