Skip to content

Commit e03e7f6

Browse files
committed
Switch packaging to pyproject.toml
1 parent 4c5f285 commit e03e7f6

File tree

6 files changed

+92
-71
lines changed

6 files changed

+92
-71
lines changed

setup.cfg renamed to .flake8.cfg

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,3 @@ exclude =
2424
.pytest_cache,
2525
*__init__.py,
2626
venv,
27-
28-
[isort]
29-
multi_line_output=3
30-
include_trailing_comma=True
31-
force_grid_wrap=0
32-
use_parentheses=True
33-
line_length=88
34-
35-
[pycodestyle]
36-
max-line-length = 119
37-
exclude =
38-
.tox
39-
.git
40-
*/migrations/*
41-
*/static/CACHE/*
42-
docs
43-
node_modules
44-
.idea
45-
.mypy_cache
46-
.pytest_cache
47-
*__init__.py
48-
venv
49-
50-
[mypy]
51-
python_version = 3.13
52-
check_untyped_defs = True
53-
ignore_missing_imports = True
54-
warn_unused_ignores = True
55-
warn_redundant_casts = True
56-
warn_unused_configs = True

.pre-commit-config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
exclude: "docs|node_modules|migrations|.git|.tox"
2-
default_stages: [commit]
32
fail_fast: true
43

54
repos:
@@ -30,15 +29,15 @@ repos:
3029
rev: 7.3.0
3130
hooks:
3231
- id: flake8
33-
args: ["--config=setup.cfg"]
32+
args: ["--config=.flake8.cfg"]
3433
additional_dependencies: [flake8-isort==6.1.1]
3534

3635
# Can run individually with `pre-commit run mypy --all-files`
3736
- repo: https://github.com/pre-commit/mirrors-mypy
3837
rev: v1.18.2
3938
hooks:
4039
- id: mypy
41-
args: ["--config=setup.cfg"]
40+
args: ["--config=pyproject.toml"]
4241

4342
# https://pre-commit.ci/#configuration
4443
ci:

docs/source/dev_guide/release.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Bumping the Version
3131

3232
::
3333

34-
git fetch upstream main
34+
git fetch upstream main
3535
# Prepend "v" to <version>
3636
# For release candidates, append "rc" to <version>
3737
git checkout -b v<version> upstream/main
@@ -46,8 +46,8 @@ Bumping the Version
4646

4747
:: Bumping from 1.0.0 to 1.1.0
4848
=> Would patch these files
49-
- setup.py:26 version="1.0.0",
50-
+ setup.py:26 version="1.1.0",
49+
- pyproject.toml: version = "1.0.0"
50+
+ pyproject.toml: version = "1.1.0"
5151
- zppy/__init__.py:1 __version__ = "v1.0.0"
5252
+ zppy/__init__.py:1 __version__ = "v1.1.0"
5353
- conda/meta.yaml:2 {% set version = "1.0.0" %}

pyproject.toml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,61 @@
22
# Unforunately, black does not support setup.cfg (refer to link).
33
# https://github.com/psf/black/issues/683#issuecomment-490236406
44

5+
[build-system]
6+
requires = [
7+
"setuptools>=64",
8+
]
9+
build-backend = "setuptools.build_meta"
10+
11+
[project]
12+
name = "zppy"
13+
version = "3.0.0"
14+
description = "Post-processing software for E3SM"
15+
readme = "README.md"
16+
requires-python = ">=3.11,<3.14"
17+
license = { file = "LICENSE" }
18+
authors = [
19+
{ name = "Ryan Forsyth", email = "[email protected]" },
20+
{ name = "Chris Golaz", email = "[email protected]" },
21+
]
22+
keywords = ["E3SM", "post-processing", "climate", "analysis"]
23+
24+
classifiers = [
25+
"Development Status :: 5 - Production/Stable",
26+
"Intended Audience :: Science/Research",
27+
"License :: OSI Approved :: BSD License",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Topic :: Scientific/Engineering",
34+
]
35+
36+
[project.urls]
37+
Homepage = "https://github.com/E3SM-Project/zppy"
38+
Issues = "https://github.com/E3SM-Project/zppy/issues"
39+
Repository = "https://github.com/E3SM-Project/zppy.git"
40+
41+
[project.scripts]
42+
zppy = "zppy.__main__:main"
43+
44+
[tool.setuptools]
45+
include-package-data = true
46+
47+
[tool.setuptools.packages.find]
48+
include = ["zppy", "zppy.*"]
49+
50+
[tool.setuptools.package-data]
51+
zppy = [
52+
"**/*.bash",
53+
"**/*.csh",
54+
"**/*.cfg",
55+
"**/*.ini",
56+
"**/*.sh",
57+
"**/*.json",
58+
]
59+
560
[tool.black]
661
line-length = 88
762
target-version = ['py311']
@@ -16,3 +71,34 @@ exclude = '''
1671
| docs
1772
)/
1873
'''
74+
75+
[tool.isort]
76+
multi_line_output = 3
77+
include_trailing_comma = true
78+
force_grid_wrap = 0
79+
use_parentheses = true
80+
line_length = 88
81+
82+
[tool.pycodestyle]
83+
max-line-length = 119
84+
exclude = [
85+
".tox",
86+
".git",
87+
"*/migrations/*",
88+
"*/static/CACHE/*",
89+
"docs",
90+
"node_modules",
91+
".idea",
92+
".mypy_cache",
93+
".pytest_cache",
94+
"*__init__.py",
95+
"venv",
96+
]
97+
98+
[tool.mypy]
99+
python_version = "3.13"
100+
check_untyped_defs = true
101+
ignore_missing_imports = true
102+
warn_unused_ignores = true
103+
warn_redundant_casts = true
104+
warn_unused_configs = true

setup.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

tbump.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tag_template = "v{new_version}"
2323
# section containing the path of the file, relative to the
2424
# tbump.toml location.
2525
[[file]]
26-
src = "setup.py"
26+
src = "pyproject.toml"
2727

2828
[[file]]
2929
src = "zppy/__init__.py"

0 commit comments

Comments
 (0)