From 3726fcf39c0e124c60f72f344eca875d9863c5c1 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Sun, 7 Dec 2025 00:32:41 -0700 Subject: [PATCH 1/3] feat: Migrate project metadata to pyproject.toml * Migrate pyproject information from setup.cfg to pyproject.toml. * Add maintainers group. * Remove setup.cfg file. * Remove asottile/setup-cfg-fmt pre-commit hook. * Add Henry Schreiner as author. --- .pre-commit-config.yaml | 6 --- pyproject.toml | 83 +++++++++++++++++++++++++++++++++++++++++ setup.cfg | 82 ---------------------------------------- 3 files changed, 83 insertions(+), 88 deletions(-) delete mode 100644 setup.cfg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 744e057..847d909 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,12 +25,6 @@ repos: hooks: - id: black -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v3.1.0 - hooks: - - id: setup-cfg-fmt - args: [--include-version-classifiers, --max-py-version=3.13] - - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.19.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 58f1ae9..412bd57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,55 @@ requires = [ ] build-backend = "setuptools.build_meta" +[project] +name = "scikit-hep-testdata" +dynamic = ["version"] +description = "Example HEP files for testing and demonstrating" +readme = "README.md" +license = "BSD-3-Clause" +requires-python = ">=3.10" +authors = [ + { name = "Ben Krikler", email = "b.krikler@cern.ch" }, + { name = "Henry Schreiner", email = "hschrein@cern.ch" } +] +maintainers = [ {name = "The Scikit-HEP admins", email = "scikit-hep-admins@googlegroups.com"} ] +keywords = [ + "HEP", + "ROOT", + "testing", +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Typing :: Typed", +] +dependencies = [ + "pyyaml", + "requests", +] + +[project.optional-dependencies] +test = [ + "pytest-cov", + "pytest>=6.0.0", +] + +[project.scripts] +scikit-hep-testdata = "skhep_testdata.__main__:main" +skhep-testdata = "skhep_testdata.__main__:main" + +[project.urls] +Homepage = "https://github.com/scikit-hep/scikit-hep-testdata" + [tool.setuptools_scm] write_to = "src/skhep_testdata/version.py" @@ -52,3 +101,37 @@ lint.isort.required-imports = ["from __future__ import annotations"] [tool.ruff.lint.per-file-ignores] "tests/**" = ["T20", "ARG001"] "__main__.py" = ["T20"] + +[tool.pytest.ini_options] +addopts = "-v -ra" +norecursedirs = ["src"] + +[tool.mypy] +files = "src" +python_version = "3.13" +warn_unused_configs = true +disallow_any_generics = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_defs = true +disallow_incomplete_defs = true +check_untyped_defs = true +disallow_untyped_decorators = true +no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_return_any = true +no_implicit_reexport = true +strict_equality = true + +[[tool.mypy.overrides]] +module = "skhep_testdata.version.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "importlib_resources.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "contextlib2.*" +ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e0acd47..0000000 --- a/setup.cfg +++ /dev/null @@ -1,82 +0,0 @@ -[metadata] -name = scikit_hep_testdata -description = Example HEP files for testing and demonstrating -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/scikit-hep/scikit-hep-testdata -author = Ben Krikler -author_email = b.krikler@cern.ch -maintainer = The Scikit-HEP admins -maintainer_email = scikit-hep-admins@googlegroups.com -license = BSD-3-Clause -license_files = LICENSE -classifiers = - Development Status :: 3 - Alpha - Intended Audience :: Developers - Natural Language :: English - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 - Programming Language :: Python :: Implementation :: CPython - Typing :: Typed -keywords = - ROOT - HEP - testing - -[options] -packages = find: -install_requires = - pyyaml - requests -python_requires = >=3.10 -package_dir = - =src -zip_safe = True - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - scikit-hep-testdata=skhep_testdata.__main__:main - skhep-testdata=skhep_testdata.__main__:main - -[options.extras_require] -test = - pytest>=6.0.0 - pytest-cov - -[tool:pytest] -addopts = -v -ra -norecursedirs = src - -[mypy] -files = src -python_version = 3.13 -warn_unused_configs = True -disallow_any_generics = True -disallow_subclassing_any = True -disallow_untyped_calls = True -disallow_untyped_defs = True -disallow_incomplete_defs = True -check_untyped_defs = True -disallow_untyped_decorators = True -no_implicit_optional = True -warn_redundant_casts = True -warn_unused_ignores = True -warn_return_any = True -no_implicit_reexport = True -strict_equality = True - -[mypy-skhep_testdata.version.*] -ignore_missing_imports = True - -[mypy-importlib_resources.*] -ignore_missing_imports = True - -[mypy-contextlib2.*] -ignore_missing_imports = True From 62440a7f8902492df1a45d2b9a66acb415312e76 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Mon, 8 Dec 2025 21:04:29 -0600 Subject: [PATCH 2/3] Restrict packe file search to src --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 412bd57..9e9a5a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,9 @@ Homepage = "https://github.com/scikit-hep/scikit-hep-testdata" [tool.setuptools_scm] write_to = "src/skhep_testdata/version.py" +[tool.setuptools.packages.find] +where = ["src"] + [tool.ruff] lint.select = [ From cddd5bb0a74027e86d7d905eeb10ebfb137a3a85 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Tue, 9 Dec 2025 12:44:51 -0600 Subject: [PATCH 3/3] build: Explicitly add src and tests to sdist * Use prune in MANIFEST.in to remove everything from the sdist and then add all the contents of src/ and tests/ with graft. This approach is more explicit about the intent of the sdist. --- MANIFEST.in | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index fd093dd..aa25c22 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,12 @@ +prune ** +graft src +graft tests + +include setup.py +include pyproject.toml include LICENSE include README.md -include src/skhep_testdata/remote_datasets.yml -include src/skhep_testdata/py.typed -include pyproject.toml - -recursive-include src/skhep_testdata/data * +include MANIFEST.in +include CITATION.cff -exclude codecov.yml +global-exclude __pycache__ *.py[cod]