diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d3c12825..4edb69e2 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -16,11 +16,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index ab9fb730..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,18 +0,0 @@ -include DESCRIPTION.rst -include LICENSE -include KNOWN_ISSUES.md -include typhon/VERSION -recursive-include typhon *.act -recursive-include typhon *.arts -recursive-include typhon *.cpt -recursive-include typhon *.csv -recursive-include typhon *.dat -recursive-include typhon *.gz -recursive-include typhon *.mplstyle -recursive-include typhon *.nc -recursive-include typhon *.npy -recursive-include typhon *.jpg -recursive-include typhon *.tex -recursive-include typhon *.txt -recursive-include typhon *.xml -recursive-include typhon *.xml.bin diff --git a/conda/conda.recipe/meta.yaml b/conda/conda.recipe/meta.yaml index 73417eff..42bad63e 100644 --- a/conda/conda.recipe/meta.yaml +++ b/conda/conda.recipe/meta.yaml @@ -1,6 +1,4 @@ -{% set data = load_setup_py_data(setup_file='../../setup.py', from_recipe_dir=True) %} {% set name = "typhon" %} -#{% set version = data['version'] %} {% set version = "0.11.0dev" %} {% set dev_url = "https://github.com/atmtools/typhon" %} @@ -27,19 +25,30 @@ requirements: - setuptools >=3.4 run: - python - {% for dep in data['install_requires'] %} - - {{ dep.lower() }} - {% endfor %} + - docutils + - fsspec!=2023.12.0,!=2023.12.1,!=2024.3.1 + - h5netcdf + - imageio + - matplotlib>=1.4 + - netcdf4>=1.1.1 + - numexpr + - numpy>=2 + - pandas + - scikit-image + - scikit-learn + - scipy>=1.6 + - setuptools>=0.7.2 + - xarray>=0.10.2 test: imports: - typhon about: - home: {{ data['url'] }} - license: {{ data['license'] }} + home: {{ dev_url }} + license: MIT license_file: LICENSE - summary: {{ data['description'] }} + summary: "Typhon is a collection of tools for atmospheric research." extra: recipe-maintainers: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..42ba8de2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,73 @@ +[build-system] +requires = ["setuptools>=64", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "typhon" +description = "Typhon is a collection of tools for atmospheric research." +readme = "README.md" +license = {text = "MIT"} +requires-python = ">=3.12" +authors = [ + {name = "The Typhon developers", email = "typhon.mi@lists.uni-hamburg.de"}, +] +dynamic = ["version"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +dependencies = [ + "docutils", + "fsspec!=2023.12.0,!=2023.12.1,!=2024.3.1", + "h5netcdf", + "imageio", + "matplotlib>=1.4", + "netCDF4>=1.1.1", + "numexpr", + "numpy>=2", + "pandas", + "scikit-image", + "scikit-learn", + "scipy>=1.6", + "setuptools>=0.7.2", + "xarray>=0.10.2", +] + +[project.optional-dependencies] +docs = ["cartopy", "pint", "sphinx_rtd_theme"] +tests = ["pytest", "pint"] + +[project.urls] +Homepage = "https://github.com/atmtools/typhon" +Source = "https://github.com/atmtools/typhon" +Download = "https://github.com/atmtools/typhon/releases" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.packages.find] +include = ["typhon*"] + +[tool.setuptools.package-data] +"*" = [ + "VERSION", + "*.act", + "*.arts", + "*.cpt", + "*.csv", + "*.dat", + "*.gz", + "*.mplstyle", + "*.nc", + "*.npy", + "*.jpg", + "*.tex", + "*.txt", + "*.xml", + "*.xml.bin", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b7e47898..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[aliases] -test=pytest diff --git a/setup.py b/setup.py index dd1b9166..0abb2494 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,18 @@ -"""Typhon is a collection of tools for atmospheric research. +"""Minimal setup.py shim supplying the dynamic version to setuptools. -Typhon provides: - -- reading and writing routines for ARTS XML files -- an API to run and access ARTS through Python -- conversion routines for various physical quantities -- a tool kit to collocate different data sets (e.g. satellite, ship, ...) -- different retrievals (e.g. QRNN, SPARE-ICE, ...) -- a subset of the cmocean color maps -- functions to calculate and analyse cloud masks -- various plotting utility functions -- functions for geodetic and geographical calculations -- interface to the SRTM30 global elevation model -- functions for cloudmask statistics -- and much more... - -Further information on ARTS can be found on http://www.radiativetransfer.org/. +All package metadata lives in pyproject.toml. This file only computes the +version (mirroring typhon.__init__.py's VERSION-file read, with a +git-describe fallback for dev builds) and passes it to setup(), which +setuptools accepts because ``version`` is declared as dynamic. """ - -import builtins import logging import subprocess from codecs import open from os.path import dirname, join -from setuptools import setup, find_packages +from setuptools import setup -builtins.__TYPHON_SETUP__ = True -DOCLINES = (__doc__ or "").split("\n") - version = open(join(dirname(__file__), "typhon", "VERSION")).read().strip() if "dev" in version: @@ -43,58 +26,12 @@ "using version from source" ) else: - so = cp.stdout version = ( - so.strip() + cp.stdout.strip() .decode("ascii") .lstrip("v") .replace("-", "+dev", 1) .replace("-", ".") ) -__version__ = version - -setup( - name="typhon", - author="The Typhon developers", - author_email="typhon.mi@lists.uni-hamburg.de", - version=__version__, - url="https://github.com/atmtools/typhon", - download_url="https://github.com/atmtools/typhon/tarball/v" + __version__, - packages=find_packages(), - license="MIT", - description=DOCLINES[0], - long_description="\n".join(DOCLINES[2:]), - classifiers=[ - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - ], - python_requires="~=3.12", - include_package_data=True, - install_requires=[ - "docutils", - "fsspec!=2023.12.0,!=2023.12.1,!=2024.3.1", - "h5netcdf", - "imageio", - "matplotlib>=1.4", - "netCDF4>=1.1.1", - "numexpr", - "numpy>=2", - "pandas", - "scikit-image", - "scikit-learn", - "scipy>=1.6", - "setuptools>=0.7.2", - "xarray>=0.10.2", - ], - extras_require={ - "docs": ["cartopy", "pint", "sphinx_rtd_theme"], - "tests": ["pytest", "pint"], - }, -) +setup(version=version)