diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index c3ce0cd..2ddee4a 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -16,4 +16,4 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 3.9 - - uses: psf/black@stable + - uses: psf/black@20.8b1 diff --git a/.gitignore b/.gitignore index 8617e91..719eff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ __pycache__ .coverage Pipfile.lock +/build +/dist +/kosmorrolib.egg-info diff --git a/Makefile b/Makefile index dfc4112..8e34741 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ black: - pipenv run black kosmorrolib tests + pipenv run black kosmorrolib tests setup.py -.PHONY: test +.PHONY: tests tests: legacy-tests doctests doctests: @@ -24,25 +24,12 @@ env: exit 1; \ fi -release: env - @echo -e "\e[1mCreating release with version number \e[36m$$RELEASE_NUMBER\e[0m" - @echo - - sed "s/^VERSION =.*/VERSION = '$$RELEASE_NUMBER'/g" kosmorrolib/version.py > version.py - mv version.py kosmorrolib/version.py - - pipenv run python setup.py extract_messages --output-file=kosmorrolib/locales/messages.pot > /dev/null - +changelog: conventional-changelog -p angular -i CHANGELOG.md -s - sed "0,/\\[\\]/s/\\[\\]/[v$$RELEASE_NUMBER]/g" CHANGELOG.md > /tmp/CHANGELOG.md - sed -e "s/...v)/...v$$RELEASE_NUMBER)/" /tmp/CHANGELOG.md > CHANGELOG.md - rm /tmp/CHANGELOG.md - - @echo - @echo -e "\e[1mRelease \e[36m$$RELEASE_NUMBER\e[39m is ready to commit." - @echo -e "Please review the changes, then invoke \e[33mmake finish-release\e[39m." + @echo -e "\e[32m✔\e[33m Changelog generated. Don't forget to update the version number before committing.\e[0m" + @echo -e " When everything is good, finish the release with 'make tag'." -finish-release: env +tag: env git add CHANGELOG.md kosmorrolib/version.py kosmorrolib/locales/messages.pot git commit -m "build: bump version $$RELEASE_NUMBER" git tag "v$$RELEASE_NUMBER" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d152cc7 --- /dev/null +++ b/setup.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +import pathlib +from setuptools import setup, find_packages + +from kosmorrolib.__version__ import __version__ + +HERE = pathlib.Path(__file__).parent +README = (HERE / "README.md").read_text() + +setup( + name="kosmorrolib", + version=__version__, + author="Jérôme Deuchnord", + author_email="jerome@deuchnord.fr", + url="http://kosmorro.space", + license="CECILL-C", + description="A library to computes the ephemerides.", + long_description=README, + long_description_content_type="text/markdown", + keywords=["kosmorro", "astronomy", "ephemerides", "ephemeris"], + packages=["kosmorrolib"], + install_requires=[ + "skyfield>=1.21.0,<2.0.0", + "numpy>=1.17.0,<2.0.0", + "python-dateutil", + ], + classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "License :: CeCILL-C Free Software License Agreement (CECILL-C)", + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Scientific/Engineering :: Astronomy", + ], + python_requires=">=3.7", +) diff --git a/tests.py b/tests.py index e496484..6a4f5b4 100644 --- a/tests.py +++ b/tests.py @@ -16,3 +16,5 @@ if __name__ == "__main__": if failures == 0: print("✔ All %d tests successfully passed." % tests) + else: + exit(1)