From 7e94a9dbd489ebc1852743928b2bd7d247b717b9 Mon Sep 17 00:00:00 2001 From: Matt Graham Date: Wed, 6 Dec 2023 17:30:49 +0000 Subject: [PATCH] Switching to pyproject.toml for specifying package metadata --- .gitignore | 1 + pyproject.toml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ pytest.ini | 6 ----- setup.py | 36 --------------------------- 4 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 pyproject.toml delete mode 100644 pytest.ini delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 7f1f2fc6..86ed7c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ resources/ .matrices/ s2fft.code-workspace .tox +s2fft/_version.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9ed9bd69 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools", + "setuptools-scm", +] + +[project] +authors = [ + {name = "Matthew A. Price"}, + {name = "Jason D. McEwen"}, + {name= "Contributors"} +] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", +] +description = "Differentiable and accelerated spherical transforms with JAX" +dynamic = [ + "version", + "dependencies", + "optional-dependencies", +] +keywords = [ +] +name = "s2fft" +readme = ".pip_readme.rst" +requires-python = ">=3.8" +license.file = "LICENSE.txt" +urls.homepage = "https://github.com/astro-informatics/s2fft" + + +[tool.pytest.ini_options] +addopts = "--color=yes -v" +testpaths = [ + "tests", +] +filterwarnings = [ + "error", + "ignore::UserWarning", + "ignore::DeprecationWarning", + "ignore:FutureWarning", +] + +[tool.setuptools] +packages = ["s2fft"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements/requirements-core.txt"]} +optional-dependencies.docs = { file = ["requirements/requirements-docs.txt"] } +optional-dependencies.plotting = { file = ["requirements/requirements-plotting.txt"] } +optional-dependencies.tests = { file = ["requirements/requirements-tests.txt"] } + +[tool.setuptools.package-data] +s2fft = ["default-logging-config.yaml"] + +[tool.setuptools_scm] +local_scheme = "no-local-version" +write_to = "s2fft/_version.py" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index c967d012..00000000 --- a/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -filterwarnings = - error - ignore::UserWarning - ignore::DeprecationWarning - ignore:FutureWarning diff --git a/setup.py b/setup.py deleted file mode 100644 index a425c085..00000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from pathlib import Path -from setuptools import find_packages, setup - -this_directory = Path(__file__).parent - - -long_description = (this_directory / ".pip_readme.rst").read_text() -requirements = ( - (this_directory / "requirements" / "requirements-core.txt").read_text().split("\n") -) - - -setup( - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Operating System :: OS Independent", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - ], - name="s2fft", - version="1.1.0", - url="https://github.com/astro-informatics/s2fft", - author="Matthew A. Price, Jason D. McEwen & Contributors", - license="MIT", - python_requires=">=3.8", - install_requires=requirements, - description=("Differentiable and accelerated spherical transforms with JAX"), - long_description_content_type="text/x-rst", - long_description=long_description, - packages=find_packages(), - include_package_data=True, - pacakge_data={"s2fft": ["default-logging-config.yaml"]}, -)