Skip to content

Commit cd3b206

Browse files
committed
Refactor: Consolidate all metadata into pyproject.toml
Migrate all package metadata from setup.cfg to pyproject.toml following modern Python packaging standards (PEP 517/518/621). Changes: pyproject.toml: - Add complete [project] section with all package metadata - Package name, description, readme, license - Authors and maintainers information - Python version requirement (>=3.9) - All dependencies (runtime requirements) - All optional-dependencies (extensions, extras, style, test, tools, all) - Entry points for CLI and pytest plugin - Project URLs (Homepage, Source Code, Documentation) - Add [tool.setuptools] configuration for package discovery - Consolidate tool configurations: - [tool.versioneer] for version management - [tool.flake8] for linting - [tool.codespell] for spell checking (fixed regex escaping, excluded pyproject.toml) - [tool.mypy] with grouped module overrides per mypy documentation - [tool.pydantic-mypy] for pydantic plugin - Preserve existing [tool.black] and [tool.isort] configurations setup.cfg: - Reduce to minimal configuration - Keep only [flake8] section (doesn't support pyproject.toml) - Keep [versioneer] section (versioneer checks both files) - Remove all [metadata], [options], and mypy sections .pre-commit-config.yaml: - Exclude pyproject.toml from codespell checks (it contains codespell config comments that would trigger false positives) setup.py: - No changes (still required for versioneer integration) Verification: - Build succeeds with python -m build - Package metadata correctly preserved in wheel - All dependencies and entry points maintained - Versioneer continues to work properly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Conflicts: setup.cfg -- master meanwhile boosted min version of dandischema to 0.11.1 - I did the same
1 parent 708f29d commit cd3b206

3 files changed

Lines changed: 205 additions & 222 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
rev: v2.0.0
2323
hooks:
2424
- id: codespell
25-
exclude: ^(dandi/_version\.py|dandi/due\.py|versioneer\.py)$
25+
exclude: ^(dandi/_version\.py|dandi/due\.py|versioneer\.py|pyproject\.toml)$
2626
- repo: https://github.com/PyCQA/flake8
2727
rev: 7.0.0
2828
hooks:

‎pyproject.toml‎

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,132 @@
33
requires = ["setuptools >= 38.3.0", "wheel"]
44
build-backend = 'setuptools.build_meta'
55

6+
[project]
7+
name = "dandi"
8+
description = "Command line client for interaction with DANDI instances"
9+
readme = "README.md"
10+
requires-python = ">=3.9"
11+
license = {text = "Apache 2.0"}
12+
authors = [
13+
{name = "DANDI developers", email = "team@dandiarchive.org"},
14+
]
15+
maintainers = [
16+
{name = "Yaroslav O. Halchenko", email = "debian@onerussian.com"},
17+
]
18+
keywords = []
19+
classifiers = [
20+
"Development Status :: 1 - Planning",
21+
"Environment :: Console",
22+
"Intended Audience :: Science/Research",
23+
"License :: OSI Approved :: Apache Software License",
24+
"Operating System :: OS Independent",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
31+
"Topic :: Scientific/Engineering",
32+
]
33+
dependencies = [
34+
"bidsschematools ~= 1.0",
35+
"bids-validator-deno >= 2.0.5",
36+
# >=8.2.0: https://github.com/pallets/click/issues/2911
37+
"click >= 7.1, <8.2.0",
38+
"click-didyoumean",
39+
"dandischema >= 0.11.1, < 0.12.0",
40+
"etelemetry >= 0.2.2",
41+
# For pydantic to be able to use type annotations like `X | None`
42+
"eval_type_backport; python_version < '3.10'",
43+
"fasteners",
44+
"fscacher >= 0.3.0",
45+
# 3.14.4: https://github.com/hdmf-dev/hdmf/issues/1186
46+
"hdmf != 3.5.0,!=3.14.4",
47+
"humanize",
48+
"interleave ~= 0.3",
49+
"joblib",
50+
"keyring != 23.9.0",
51+
"keyrings.alt",
52+
"packaging",
53+
"platformdirs",
54+
"pycryptodomex", # for EncryptedKeyring backend in keyrings.alt
55+
"pydantic ~= 2.0",
56+
"pynwb >= 1.0.3,!=1.1.0,!=2.3.0",
57+
"numcodecs < 0.16",
58+
"nwbinspector >= 0.4.28,!=0.4.32",
59+
"pyout >=0.5, !=0.6.0",
60+
"python-dateutil",
61+
"requests ~= 2.20",
62+
"ruamel.yaml >=0.15, <1",
63+
"semantic-version",
64+
"tenacity",
65+
"tensorstore",
66+
# possibly silently incomplete downloads: https://github.com/dandi/dandi-cli/issues/1500
67+
"urllib3 >= 2.0.0",
68+
"yarl ~= 1.9",
69+
"zarr >= 2.10, <= 3.0.8",
70+
"zarr_checksum ~= 0.4.0",
71+
]
72+
dynamic = ["version"]
73+
74+
[project.optional-dependencies]
75+
# PyNWB extensions we know and somewhat care about
76+
# e.g. import whenever pynwb fails without them
77+
extensions = [
78+
"allensdk",
79+
"ndx-hed",
80+
"ndx-events",
81+
]
82+
extras = [
83+
"duecredit >= 0.6.0",
84+
"fsspec[http]",
85+
]
86+
style = [
87+
"flake8",
88+
"pre-commit",
89+
]
90+
test = [
91+
"anys ~= 0.2",
92+
"coverage",
93+
"opencv-python",
94+
"pytest",
95+
"pytest-cov",
96+
"pytest-mock",
97+
"pytest-rerunfailures",
98+
"pytest-timeout",
99+
"responses != 0.24.0, != 0.25.5",
100+
"vcrpy",
101+
]
102+
tools = [
103+
"boto3",
104+
]
105+
all = [
106+
"dandi[extensions]",
107+
"dandi[extras]",
108+
"dandi[style]",
109+
"dandi[test]",
110+
"dandi[tools]",
111+
]
112+
113+
[project.urls]
114+
Homepage = "http://dandiarchive.org"
115+
"Source Code" = "https://github.com/dandi/dandi-cli"
116+
Documentation = "https://dandi.readthedocs.io"
117+
118+
[project.scripts]
119+
dandi = "dandi.cli.command:main"
120+
121+
[project.entry-points.pytest11]
122+
dandi = "dandi.pytest_plugin"
123+
124+
[tool.setuptools]
125+
zip-safe = false
126+
include-package-data = true
127+
128+
[tool.setuptools.packages.find]
129+
include = ["dandi*"]
130+
namespaces = true
131+
6132
[tool.black]
7133
exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|_version\.py|versioneer\.py'
8134

@@ -12,3 +138,79 @@ force_sort_within_sections = true
12138
reverse_relative = true
13139
sort_relative_in_force_sorted_sections = true
14140
known_first_party = ["dandi"]
141+
142+
[tool.versioneer]
143+
VCS = "git"
144+
style = "pep440"
145+
versionfile_source = "dandi/_version.py"
146+
versionfile_build = "dandi/_version.py"
147+
tag_prefix = ""
148+
parentdir_prefix = ""
149+
150+
[tool.flake8]
151+
max-line-length = 100
152+
ignore = ["E203", "W503"]
153+
extend-exclude = [
154+
"_version.py",
155+
"versioneer.py",
156+
]
157+
158+
[tool.codespell]
159+
skip = "_version.py,due.py,versioneer.py,*.vcr.yaml,venv,venvs,pyproject.toml"
160+
# Don't warn about "[l]ist" in the abbrev_prompt() docstring:
161+
# TE is present in the BIDS schema
162+
ignore-regex = "(\\[\\w\\]\\w+|TE|ignore \"bu\" strings)"
163+
ignore-words-list = "ba,bu,fo"
164+
165+
[tool.mypy]
166+
# TODO: Eventually uncomment these:
167+
#allow_untyped_defs = False
168+
implicit_reexport = false
169+
allow_incomplete_defs = false
170+
ignore_missing_imports = false
171+
no_implicit_optional = true
172+
local_partial_types = true
173+
pretty = true
174+
show_error_codes = true
175+
show_traceback = true
176+
strict_equality = true
177+
warn_redundant_casts = true
178+
warn_return_any = true
179+
warn_unreachable = true
180+
plugins = ["pydantic.mypy"]
181+
exclude = "_version\\.py|due\\.py"
182+
183+
[[tool.mypy.overrides]]
184+
module = "dandi.*"
185+
ignore_missing_imports = true
186+
187+
[[tool.mypy.overrides]]
188+
module = [
189+
"dandi._version",
190+
"dandi.due",
191+
]
192+
follow_imports = "skip"
193+
194+
[[tool.mypy.overrides]]
195+
module = [
196+
"bidsschematools.*",
197+
"click_didyoumean.*",
198+
"etelemetry.*",
199+
"fasteners.*",
200+
"fscacher.*",
201+
"fsspec.*",
202+
"h5py.*",
203+
"hdmf.*",
204+
"joblib.*",
205+
"keyrings.alt.*",
206+
"nwbinspector.*",
207+
"pynwb.*",
208+
"pyout.*",
209+
"semantic_version.*",
210+
"vcr.*",
211+
"zarr.*",
212+
]
213+
ignore_missing_imports = true
214+
215+
[tool.pydantic-mypy]
216+
init_forbid_extra = true

0 commit comments

Comments
 (0)