Skip to content

Commit 374f24d

Browse files
candleindarkclaude
andcommitted
Consolidate package metadata from setup.py/setup.cfg into pyproject.toml
Migrate all metadata, dependencies, and tool configuration into pyproject.toml using the modern PEP 517/518/621 [project] table, eliminating setup.py and setup.cfg. Flake8 config moves to a dedicated .flake8 file since flake8 does not natively support pyproject.toml. Also removes the stale setup.py references from tox.ini's lint env. Notable changes: - setuptools requirement bumped to >=61.0.0 for native [project] table support - wheel removed from build-system.requires (handled automatically by pip) - license field uses SPDX expression (Apache-2.0) per PEP 639; redundant License classifier removed - [all] extra uses self-referential syntax dandischema[style,test] - mypy exclude anchored to ^dandischema/_version\.py$ to match the actual path written by versioningit - pydantic-mypy warn_untypes_fields dropped (was a typo, silently ignored) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e3ea45b commit 374f24d

File tree

5 files changed

+95
-126
lines changed

5 files changed

+95
-126
lines changed

.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
max-line-length = 100
3+
ignore = E203,W503
4+
exclude =
5+
*/__init__.py
6+
.tox/

pyproject.toml

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,66 @@
11
[build-system]
2-
# Setuptools version should match setup.py; wheel because pip will insert it noisily
3-
requires = ["setuptools >= 42.0.0", "versioningit", "wheel"]
4-
build-backend = 'setuptools.build_meta'
2+
requires = ["setuptools >= 61.0.0", "versioningit"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "dandischema"
7+
description = "Schemata for DANDI archive project"
8+
readme = {file = "README.md", content-type = "text/markdown"}
9+
license = "Apache-2.0"
10+
authors = [
11+
{name = "DANDI developers", email = "team@dandiarchive.org"},
12+
]
13+
maintainers = [
14+
{name = "Yaroslav O. Halchenko", email = "debian@onerussian.com"},
15+
]
16+
classifiers = [
17+
"Development Status :: 1 - Planning",
18+
"Environment :: Console",
19+
"Intended Audience :: Science/Research",
20+
"Operating System :: OS Independent",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
27+
"Topic :: Scientific/Engineering",
28+
]
29+
requires-python = ">=3.10"
30+
dependencies = [
31+
"jsonschema[format]",
32+
"packaging>=14.0",
33+
"pydantic-settings",
34+
"pydantic[email]~=2.4",
35+
"requests",
36+
"zarr_checksum",
37+
]
38+
dynamic = ["version"]
39+
40+
[project.urls]
41+
Homepage = "http://dandiarchive.org"
42+
"Source Code" = "https://github.com/dandi/dandischema"
43+
44+
[project.optional-dependencies]
45+
style = [
46+
"flake8",
47+
"pre-commit",
48+
]
49+
test = [
50+
"anys",
51+
"mypy",
52+
"pytest",
53+
"pytest-cov",
54+
"pytest-rerunfailures",
55+
]
56+
all = [
57+
"dandischema[style]",
58+
"dandischema[test]",
59+
]
60+
61+
[tool.setuptools.packages.find]
62+
namespaces = true
63+
include = ["dandischema*"]
564

665
[tool.versioningit]
766
default-version = "0+unknown"
@@ -19,10 +78,34 @@ distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
1978
file = "dandischema/_version.py"
2079

2180
[tool.black]
22-
exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist'
81+
exclude = '\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist'
2382

2483
[tool.isort]
2584
profile = "black"
2685
force_sort_within_sections = true
2786
reverse_relative = true
2887
known_first_party = ["dandischema"]
88+
89+
[tool.mypy]
90+
allow_incomplete_defs = false
91+
allow_untyped_defs = false
92+
ignore_missing_imports = false
93+
no_implicit_optional = true
94+
implicit_reexport = false
95+
local_partial_types = true
96+
pretty = true
97+
show_error_codes = true
98+
show_traceback = true
99+
strict_equality = true
100+
warn_redundant_casts = true
101+
warn_return_any = true
102+
warn_unreachable = true
103+
plugins = ["pydantic.mypy"]
104+
exclude = ['^dandischema/_version\.py$']
105+
106+
[[tool.mypy.overrides]]
107+
module = "dandischema._version"
108+
follow_imports = "skip"
109+
110+
[tool.pydantic-mypy]
111+
init_forbid_extra = true

setup.cfg

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

setup.py

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

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ deps =
1818
codespell~=2.0
1919
flake8
2020
commands =
21-
codespell dandischema setup.py
22-
flake8 --config=setup.cfg {posargs} dandischema setup.py
21+
codespell dandischema
22+
flake8 {posargs} dandischema
2323

2424
[testenv:typing]
2525
deps =

0 commit comments

Comments
 (0)