Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyproject fmt #1267

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ jobs:
# These needs to rotate every new Python release.
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
CIBW_SKIP="pp* cp36-* cp37-* *-musllinux* cp39-* cp310-* cp311-*"
CIBW_SKIP="pp* cp36-* cp37-* *-musllinux* cp39-* cp310-* cp311-* cp312-*"
else
CIBW_SKIP="pp* cp36-* cp37-* *-musllinux*"
CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux*"
fi
echo "CIBW_SKIP=$CIBW_SKIP" >> $GITHUB_ENV
echo "Setting CIBW_SKIP=$CIBW_SKIP"
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.4.3
hooks:
- id: pyproject-fmt

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip: []
submodules: false
120 changes: 61 additions & 59 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,89 +1,91 @@
[build-system]
build-backend = "setuptools.build_meta"

requires = [
"Cython>=0.29",
"oldest-supported-numpy ; python_version < '3.9'",
"numpy>=2.0.0rc1 ; python_version >= '3.9'",
"setuptools>=61", "setuptools_scm[toml]>=3.4"
"cython>=0.29",
"numpy>=2.0.0rc1; python_version>='3.9'",
"oldest-supported-numpy; python_version<'3.9'",
"setuptools>=61",
"setuptools-scm[toml]>=3.4",
]
build-backend = "setuptools.build_meta"

[project]
name = "netCDF4"
name = "netcdf4"
description = "Provides an object-oriented python interface to the netCDF version 4 library"
readme.content-type = "text/x-rst"
readme.text = """\
netCDF version 4 has many features not found in earlier versions of the library,
such as hierarchical groups, zlib compression, multiple unlimited dimensions,
and new data types. It is implemented on top of HDF5. This module implements
most of the new features, and can read and write netCDF files compatible with
older versions of the library. The API is modelled after Scientific.IO.NetCDF,
and should be familiar to users of that module.
"""
keywords = [
"climate",
"data",
"meteorology",
"netcdf",
"network",
"numpy",
"oceanography",
"science",
]
license = { text = "MIT" }
authors = [
{name = "Jeff Whitaker", email = "[email protected]"},
{ name = "Jeff Whitaker", email = "[email protected]" },
]
requires-python = ">=3.8"
keywords = [
"numpy", "netcdf", "data", "science", "network", "oceanography",
"meteorology", "climate",
]
license = {text = "MIT"}
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Archiving :: Compression",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"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",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Archiving :: Compression",
]
dynamic = [ "version" ]

dependencies = [
"cftime",
"certifi",
"numpy",
"certifi",
"cftime",
"numpy",
]
dynamic = ["version"]

[project.optional-dependencies]
tests = [
"Cython",
optional-dependencies.tests = [
"cython",
"packaging",
"pytest",
]

[project.readme]
text = """\
netCDF version 4 has many features not found in earlier versions of the library,
such as hierarchical groups, zlib compression, multiple unlimited dimensions,
and new data types. It is implemented on top of HDF5. This module implements
most of the new features, and can read and write netCDF files compatible with
older versions of the library. The API is modelled after Scientific.IO.NetCDF,
and should be familiar to users of that module.
"""
content-type = "text/x-rst"

[project.scripts]
nc3tonc4 = "netCDF4.utils:nc3tonc4"
nc4tonc3 = "netCDF4.utils:nc4tonc3"
ncinfo = "netCDF4.utils:ncinfo"

[project.urls]
Documentation = "https://unidata.github.io/netcdf4-python/"
Repository = "https://github.com/Unidata/netcdf4-python"
urls.Documentation = "https://unidata.github.io/netcdf4-python/"
urls.Repository = "https://github.com/Unidata/netcdf4-python"
scripts.nc3tonc4 = "netCDF4.utils:nc3tonc4"
scripts.nc4tonc3 = "netCDF4.utils:nc4tonc3"
scripts.ncinfo = "netCDF4.utils:ncinfo"

[tool.setuptools.packages.find]
where = ["src"]
where = [ "src" ]

[tool.setuptools.package-data]
"netCDF4.plugins" = ["lib__nc*"]
"netCDF4.plugins" = [ "lib__nc*" ]

[tool.setuptools_scm]

[tool.pytest.ini_options]
pythonpath = ["test"]
pythonpath = [ "test" ]
filterwarnings = [
"error",
"ignore::UserWarning",
"error",
"ignore::UserWarning",
]

[tool.mypy]
files = ["src/netCDF4"]
files = [ "src/netCDF4" ]
exclude = "utils.py"
check_untyped_defs = true
allow_redefinition = true
Expand All @@ -97,5 +99,5 @@ module = [
"cftime.*",
"cython.*",
"filter_availability",
"matplotlib.*"
"matplotlib.*",
]
Loading