Skip to content

Commit

Permalink
Switch from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Nov 22, 2023
1 parent 73fa52e commit fb52e49
Show file tree
Hide file tree
Showing 35 changed files with 88 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
shell: bash -l {0}
run: |
python -m pip install -U build pip
python -m build --sdist
python -m build
- name: Publish package to PyPI
# upload to PyPI on every release for a tag starting with 'v'
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ recursive-include doc/source *
recursive-include polar2grid/tests/etc *
include polar2grid/grids/grids.yaml
recursive-include polar2grid/fonts *
recursive-include etc *
recursive-include polar2grid/etc *
include LICENSE.txt
include README.rst
recursive-exclude doc/source/_static/example_images *.png *.jpeg *.jpg
recursive-exclude doc/source/_static/example_images *.png *.jpg
recursive-exclude doc/source/_static *.psd *.xcf
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
87 changes: 85 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,91 @@
[build-system]
requires = ["setuptools>=45", "wheel"]
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"

[project]
name = "polar2grid"
version = "3.1.0"
authors = [
{name = "David Hoese", email = "[email protected]"},
]
description = "Library and scripts to remap satellite data to a gridded image"
readme = "README.rst"
license = {text = "GPLv3"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: GIS",
]
requires-python = ">=3.10"
dependencies = [
"satpy",
"rasterio",
"netCDF4",
"h5py",
]

[project.optional-dependencies]
utils = ["matplotlib"]
docs = ["sphinx", "rst2pdf", "sphinx-argparse", "sphinxcontrib-apidoc", "pytest"]
tests = ["pytest"]
coastlines = ["pycoast", "pydecorate"]
all = ["matplotlib", "sphinx", "rst2pdf", "sphinx-argparse", "sphinxcontrib-apidoc", "pytest", "pycoast", "pydecorate"]

[project.urls]
Documentation = "https://www.ssec.wisc.edu/software/polar2grid/"
Home-page = "https://cimss.ssec.wisc.edu/cspp/"
Download-URL = "https://pypi.org/project/polar2grid/"
Project-URL = "https://github.com/ssec/polar2grid/"

[project.scripts]
polar2grid = "polar2grid.__main__:p2g_main"
geo2grid = "polar2grid.__main__:g2g_main"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages]
find = {}

[tool.isort]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
profile = "black"
skip_gitignore = true
force_to_top = true
default_section = "THIRDPARTY"
known_first_party = "polar2grid"
line_length = 120

[tool.black]
line-length = 120
target-version = ['py38']
target-version = ['py310']
include = '\.pyi?$'

[tool.coverage.run]
relative_files = true

[tool.ruff]
# See https://docs.astral.sh/ruff/rules/
select = ["E", "W", "B", "D", "T10", "C90"]
# Remove D416 when all docstrings have been converted to google-style
ignore = ["D107", "D416"]
line-length = 120
exclude = ["versioneer.py", "pyresample/version.py"]

[tool.ruff.per-file-ignores]
"pyresample/test/*.py" = ["D102", "S101"] # assert allowed in tests

[tool.ruff.pydocstyle]
convention = "google"

[tool.ruff.mccabe]
max-complexity = 10
15 changes: 0 additions & 15 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
[bdist_wheel]
# this is only true when ewa resampling uses pyresample directly
universal=1

[flake8]
max-line-length = 120
ignore = D101,D102,D103,D105,D106,D107,E203
per-file-ignores =
doc/source/conf.py:E501
polar2grid/readers/*.py:D205,D400

[isort]
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
profile = black
skip_gitignore = true
force_to_top = true
default_section = THIRDPARTY
known_first_party = polar2grid

[coverage:run]
relative_files = True
121 changes: 0 additions & 121 deletions setup.py

This file was deleted.

0 comments on commit fb52e49

Please sign in to comment.