From 3f0ab4d6e9d3fa3891a9c06b8b1d5f6979675045 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Mon, 25 Sep 2023 21:55:06 +0200 Subject: [PATCH 1/9] moving part of metadata from setup.py to pyproject.toml --- pyproject.toml | 20 ++++++++++++++++++++ setup.py | 21 ++------------------- 2 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..ece778df --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[tool.setuptools] +py-modules = [] + +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "PyPartMC" +description = "Python interface to PartMC" +dynamic = ["version"] +dependencies = ["numpy"] +license = {text = "GPL-3.0"} +requires-python = ">=3.7" + +[project.optional-dependencies] +tests = [ + "pytest", + "pytest-order", +] diff --git a/setup.py b/setup.py index 50f6de0a..e611aa9f 100644 --- a/setup.py +++ b/setup.py @@ -120,39 +120,22 @@ def build_extension(self, ext): # pylint: disable=too-many-branches subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=build_temp) -# The information here can also be placed in setup.cfg - better separation of -# logic and declaration, and simpler if you include description/version in a file. setup( - name="PyPartMC", use_scm_version={ "local_scheme": lambda _: "", "version_scheme": "post-release", - # "fallback_version": "0.0.0" }, - author="Sylwester Arabas", - author_email="sarabas@illinois.edu", - description="Python interface to PartMC", + author="PyPartMC Team", + author_email="sylwester.arabas@agh.edu.pl", long_description=(Path(__file__).parent / "README.md").read_text(), long_description_content_type="text/markdown", packages=find_packages(include=["PyPartMC", "PyPartMC.*"]), ext_modules=[CMakeExtension("_PyPartMC")], cmdclass={"build_ext": CMakeBuild}, zip_safe=False, - python_requires=">=3.7", - setup_requires=["setuptools_scm"], - install_requires=["numpy"], - license="GPL-3.0", project_urls={ "Tracker": "https://github.com/open-atmos/PyPartMC/issues", "Documentation": "https://open-atmos.github.io/PyPartMC", "Source": "https://github.com/open-atmos/PyPartMC/", }, - extras_require={ - "tests": [ - "pytest", - "pytest-order", - "fastcore!=1.5.8", # https://github.com/fastai/fastcore/issues/439 - "ghapi", - ] - }, ) From a3539a603995183c9589a34c0bcc96762704c071 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Mon, 25 Sep 2023 22:07:09 +0200 Subject: [PATCH 2/9] add version req for setuptools in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ece778df..bed83326 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ py-modules = [] [build-system] -requires = ["setuptools", "setuptools-scm"] +requires = ["setuptools>=61", "setuptools-scm"] build-backend = "setuptools.build_meta" [project] From fefd871b192aeb5db0a186869f8b807cc40509a6 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Mon, 25 Sep 2023 22:17:12 +0200 Subject: [PATCH 3/9] temporarily avoid newer setuptools_scm versions --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bed83326..db194d10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ py-modules = [] [build-system] -requires = ["setuptools>=61", "setuptools-scm"] +requires = ["setuptools", "setuptools-scm<8.0.0"] build-backend = "setuptools.build_meta" [project] From cfbe2bcf7f17c88348abc114ba97932a4f8f0114 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Mon, 25 Sep 2023 22:41:07 +0200 Subject: [PATCH 4/9] more dynamic fields --- pyproject.toml | 2 +- setup.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index db194d10..eed2c14d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [project] name = "PyPartMC" description = "Python interface to PartMC" -dynamic = ["version"] +dynamic = ["version", "readme", "urls"] dependencies = ["numpy"] license = {text = "GPL-3.0"} requires-python = ">=3.7" diff --git a/setup.py b/setup.py index e611aa9f..c83b82b0 100644 --- a/setup.py +++ b/setup.py @@ -125,8 +125,6 @@ def build_extension(self, ext): # pylint: disable=too-many-branches "local_scheme": lambda _: "", "version_scheme": "post-release", }, - author="PyPartMC Team", - author_email="sylwester.arabas@agh.edu.pl", long_description=(Path(__file__).parent / "README.md").read_text(), long_description_content_type="text/markdown", packages=find_packages(include=["PyPartMC", "PyPartMC.*"]), From 41e9dc5d24ca6a60c55ce2d5ed62689ca800a050 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 6 Oct 2023 23:46:46 +0200 Subject: [PATCH 5/9] remove setuptools_scm version constraint; add empty toml section --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index eed2c14d..6caaf8ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ py-modules = [] [build-system] -requires = ["setuptools", "setuptools-scm<8.0.0"] +requires = ["setuptools", "setuptools-scm"] build-backend = "setuptools.build_meta" [project] @@ -18,3 +18,5 @@ tests = [ "pytest", "pytest-order", ] + +[tool.setuptools_scm] From 29a223f93145e4e492542b56d9d99cf076623dc0 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 6 Oct 2023 23:52:46 +0200 Subject: [PATCH 6/9] bring back some entries to setup.py --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index c83b82b0..797175ce 100644 --- a/setup.py +++ b/setup.py @@ -121,10 +121,12 @@ def build_extension(self, ext): # pylint: disable=too-many-branches setup( + name="PyPartMC", use_scm_version={ "local_scheme": lambda _: "", "version_scheme": "post-release", }, + setup_requires=["setuptools_scm"], long_description=(Path(__file__).parent / "README.md").read_text(), long_description_content_type="text/markdown", packages=find_packages(include=["PyPartMC", "PyPartMC.*"]), From 91d8c489e1cdb66b39933a8f43642f23d56a6fb2 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 6 Oct 2023 23:57:32 +0200 Subject: [PATCH 7/9] bring back python_requires=">=3.7" --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 797175ce..d1b0524c 100644 --- a/setup.py +++ b/setup.py @@ -127,6 +127,7 @@ def build_extension(self, ext): # pylint: disable=too-many-branches "version_scheme": "post-release", }, setup_requires=["setuptools_scm"], + python_requires=">=3.7", long_description=(Path(__file__).parent / "README.md").read_text(), long_description_content_type="text/markdown", packages=find_packages(include=["PyPartMC", "PyPartMC.*"]), From 71898b6f10d6ed3bea88003ec5409a18a8166674 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Sat, 7 Oct 2023 00:01:40 +0200 Subject: [PATCH 8/9] try installing setuptools separately --- .github/workflows/tests+pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests+pypi.yml b/.github/workflows/tests+pypi.yml index 337a4617..f2c219b1 100644 --- a/.github/workflows/tests+pypi.yml +++ b/.github/workflows/tests+pypi.yml @@ -22,6 +22,7 @@ jobs: with: submodules: recursive fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480 + - run: pip install setuptools>=68.2.2 - run: DEBUG=1 VERBOSE=1 pip install --verbose -e .[tests] - run: pytest -v -s -We -p no:unraisableexception tests From c09c85388e72331d8955d6f11919d25ceb411b54 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Sat, 7 Oct 2023 00:05:23 +0200 Subject: [PATCH 9/9] fix shell syntax --- .github/workflows/tests+pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests+pypi.yml b/.github/workflows/tests+pypi.yml index f2c219b1..42bf8e21 100644 --- a/.github/workflows/tests+pypi.yml +++ b/.github/workflows/tests+pypi.yml @@ -22,7 +22,7 @@ jobs: with: submodules: recursive fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480 - - run: pip install setuptools>=68.2.2 + - run: pip install "setuptools>=68.2.2" - run: DEBUG=1 VERBOSE=1 pip install --verbose -e .[tests] - run: pytest -v -s -We -p no:unraisableexception tests