-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Migrate project metadata to pyproject.toml #201
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
feat: Migrate project metadata to pyproject.toml #201
Conversation
bec6337 to
59c5cb6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #201 +/- ##
=======================================
Coverage ? 72.51%
=======================================
Files ? 4
Lines ? 131
Branches ? 0
=======================================
Hits ? 95
Misses ? 36
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
59c5cb6 to
685099b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the project configuration from the deprecated setup.cfg format to the modern pyproject.toml standard (PEP 621), consolidating all project metadata into a single configuration file. The migration includes moving package metadata, dependencies, entry points, and tool configurations (pytest, mypy) to their respective sections in pyproject.toml.
Key changes:
- Consolidated project metadata (name, version, dependencies, scripts) in
[project]section ofpyproject.toml - Migrated pytest and mypy configurations from
setup.cfgtopyproject.tomlusing TOML format - Removed obsolete
setup-cfg-fmtpre-commit hook that formatted the now-deletedsetup.cfg
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pyproject.toml | Added [project] metadata section with package information, dependencies, scripts; added [tool.pytest.ini_options] and [tool.mypy] configurations migrated from setup.cfg |
| setup.cfg | Removed entire file as all configuration has been migrated to pyproject.toml |
| .pre-commit-config.yaml | Removed asottile/setup-cfg-fmt hook which is no longer needed without setup.cfg |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| [tool.setuptools_scm] | ||
| write_to = "src/skhep_testdata/version.py" | ||
|
|
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing setuptools package discovery configuration. The original setup.cfg specified packages = find: with where = src to find packages in the src-layout directory. Add the following configuration after this line:
[tool.setuptools.packages.find]
where = ["src"]Without this, setuptools may fail to find and include the package in the distribution.
| [tool.setuptools.packages.find] | |
| where = ["src"] |
eduardo-rodrigues
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @matthewfeickert. The upgrade was due :).
I approve but let me make 2 little suggestions:
- At this point it would make sense to add @henryiii as a co-author since he did work on a fair bit of modernisation, IIRC.
- I am now noticing that we only officially support 3.10+-. This is a rather easy and useful package leverage in many places. We should not IMO be too harsh with the lower bound on the Python versions supported. For sure there are Scikit-HEP packages supporting 3.9, if not 3.8 (OK, this latter may be a bit pushy at this stage, but let's not forget the timeline of PhD theses, etc., so it does make sense to be kind), and if they need this package for testing ... You get my point. Let's keep this in mind wen we require 3.11+.
685099b to
a9beaef
Compare
Done in rebase. 👍
@eduardo-rodrigues Yeah, I only noticed recently that this happened in PR #193 by a pre-commit hook autofix: 4d5b90d So maybe this wasn't intended? I am happy to support an EOL Python for a bit longer than normal $ pixi exec norwegianblue python
┌───────┬────────────┬─────────┬────────────────┬────────────┬────────────┬──────────┐
│ cycle │ release │ latest │ latest release │ support │ eol │ pep │
├───────┼────────────┼─────────┼────────────────┼────────────┼────────────┼──────────┤
│ 3.14 │ 2025-10-07 │ 3.14.2 │ 2025-12-05 │ 2027-10-01 │ 2030-10-31 │ PEP-0745 │
│ 3.13 │ 2024-10-07 │ 3.13.11 │ 2025-12-05 │ 2026-10-01 │ 2029-10-31 │ PEP-0719 │
│ 3.12 │ 2023-10-02 │ 3.12.12 │ 2025-10-09 │ 2025-04-02 │ 2028-10-31 │ PEP-0693 │
│ 3.11 │ 2022-10-24 │ 3.11.14 │ 2025-10-09 │ 2024-04-01 │ 2027-10-31 │ PEP-0664 │
│ 3.10 │ 2021-10-04 │ 3.10.19 │ 2025-10-09 │ 2023-04-05 │ 2026-10-31 │ PEP-0619 │
│ 3.9 │ 2020-10-05 │ 3.9.25 │ 2025-10-31 │ 2022-05-17 │ 2025-10-31 │ PEP-0596 │
│ 3.8 │ 2019-10-14 │ 3.8.20 │ 2024-09-06 │ 2021-05-03 │ 2024-10-07 │ PEP-0569 │
│ 3.7 │ 2018-06-27 │ 3.7.17 │ 2023-06-05 │ 2020-06-27 │ 2023-06-27 │ PEP-0537 │
│ 3.6 │ 2016-12-23 │ 3.6.15 │ 2021-09-03 │ 2018-12-24 │ 2021-12-23 │ PEP-0494 │
│ 3.5 │ 2015-09-13 │ 3.5.10 │ 2020-09-05 │ False │ 2020-09-30 │ PEP-0478 │
│ 3.4 │ 2014-03-16 │ 3.4.10 │ 2019-03-18 │ False │ 2019-03-18 │ PEP-0429 │
│ 3.3 │ 2012-09-29 │ 3.3.7 │ 2017-09-19 │ False │ 2017-09-29 │ PEP-0398 │
│ 3.2 │ 2011-02-20 │ 3.2.6 │ 2014-10-12 │ False │ 2016-02-20 │ PEP-0392 │
│ 2.7 │ 2010-07-03 │ 2.7.18 │ 2020-04-19 │ False │ 2020-01-01 │ PEP-0373 │
│ 3.1 │ 2009-06-27 │ 3.1.5 │ 2012-04-06 │ False │ 2012-04-09 │ PEP-0375 │
│ 3.0 │ 2008-12-03 │ 3.0.1 │ 2009-02-12 │ False │ 2009-06-27 │ PEP-0361 │
│ 2.6 │ 2008-10-01 │ 2.6.9 │ 2013-10-29 │ False │ 2013-10-29 │ PEP-0361 │
└───────┴────────────┴─────────┴────────────────┴────────────┴────────────┴──────────┘
But I would suggest that as Python 3.10 has already been updated in this library that we don't backtrack and that we release a new minor version ( |
|
Agreed, sounds good (I see I should have noticed the change in the pre-commit PR, but didn't - shame on me). Thanks. |
|
It is easy to miss, and not something I would have expected to come from an autofix. So no worries there. |
ariostas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @matthewfeickert, this looks great! Looking at the repo review here, it seems like the only issue is the Python version not being a string (which Copilot already pointed out). There are other suggestions for things in the pyproject.toml, but maybe it makes more sense to have a separate PR to address all the relevant suggestions.
|
@ariostas I'm currently on a flight, so I might be missing something, but I see the lack of strings only getting flagged by repo review for tools like mypy, not the project table. I'm happy to get any project table things fixed up in this PR, and then I agree that we should open up an Issue and a follow up PR to knock as more repo-review fixes. 👍 |
|
Yeah, it's only not a string in the mypy table. Since that was also moved over to |
* 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.
0a34af3 to
3726fcf
Compare
* 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're migrating the project files, I've made the sdist definition more explicit.
This now produces
$ rm -rf ./dist && uvx --from build pyproject-build --installer uv .
$ python -m tarfile --list ./dist/*.tar.gz
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/CITATION.cff
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/LICENSE
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/MANIFEST.in
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/PKG-INFO
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/README.md
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/pyproject.toml
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/setup.cfg
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/setup.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/PKG-INFO
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/SOURCES.txt
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/dependency_links.txt
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/entry_points.txt
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/requires.txt
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/scikit_hep_testdata.egg-info/top_level.txt
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/__init__.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/__main__.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/__init__.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/file_list.txt
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/pyhf-ins1748602-probability-models.doi
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/pylhe-testfile-madgraph-2.0.0-wbj.lhe.readme
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/pylhe-testfile-madgraph-2.2.1-Z-ckkwl.lhe.gz.readme
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/pylhe-testfile-madgraph-2.2.1-Z-fxfx.lhe.gz.readme
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/pylhe-testfile-madgraph-2.2.1-Z-mlm.lhe.gz.readme
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/data/pylhe-testfile-pythia-6.413-ttbar.lhe.readme
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/local_files.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/py.typed
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/remote_datasets.yml
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/remote_files.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/src/skhep_testdata/version.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/tests/
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/tests/__init__.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/tests/test_local_files.py
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/tests/test_remote_datasets.yml
scikit_hep_testdata-0.5.10.dev4+gcddd5bb0a/tests/test_remote_files.pycompared to
$ curl -sLO https://files.pythonhosted.org/packages/75/1f/7e0acd189f16cdee82ae3dc0bf6979b7506af7a84ee8907a978dc1a83b6f/scikit_hep_testdata-0.5.8.tar.gz
$ python -m tarfile --list ./scikit_hep_testdata-0.5.8.tar.gz
scikit_hep_testdata-0.5.8/
scikit_hep_testdata-0.5.8/.all-contributorsrc
scikit_hep_testdata-0.5.8/.github/
scikit_hep_testdata-0.5.8/.github/dependabot.yml
scikit_hep_testdata-0.5.8/.github/workflows/
scikit_hep_testdata-0.5.8/.github/workflows/ci.yml
scikit_hep_testdata-0.5.8/.gitignore
scikit_hep_testdata-0.5.8/.pre-commit-config.yaml
scikit_hep_testdata-0.5.8/CITATION.cff
scikit_hep_testdata-0.5.8/LICENSE
scikit_hep_testdata-0.5.8/MANIFEST.in
scikit_hep_testdata-0.5.8/PKG-INFO
scikit_hep_testdata-0.5.8/README.md
scikit_hep_testdata-0.5.8/dev/
scikit_hep_testdata-0.5.8/dev/make-root/
scikit_hep_testdata-0.5.8/dev/make-root/double32_float16.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_1jag_int_float.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_Run2012BC_DoubleMuParked_Muons_1000evts.md
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_atomic_bitset.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_bit.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_emptystruct_invalidvar.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_extension_columns.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_float_types.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_imported_NanoAOD.md
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_index_multicluster.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_int_5e4.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_int_float.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_int_multicluster.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_int_vfloat_tlv_vtlv.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_multiple_cluster_groups.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_multiple_representations.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_nested_structs.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_split_3e4.C
scikit_hep_testdata-0.5.8/dev/make-root/rntuple_stl_containers.C
scikit_hep_testdata-0.5.8/dev/make-root/sample4version.C
scikit_hep_testdata-0.5.8/dev/make-root/stl_containers.C
scikit_hep_testdata-0.5.8/dev/make-root/uproot-issue-1043.C
scikit_hep_testdata-0.5.8/dev/make-root/uproot-issue38c.py
scikit_hep_testdata-0.5.8/dev/make-root/uproot_issue_1229.C
scikit_hep_testdata-0.5.8/dev/make-root/uproot_issue_407.C
scikit_hep_testdata-0.5.8/pyproject.toml
scikit_hep_testdata-0.5.8/setup.cfg
scikit_hep_testdata-0.5.8/setup.py
scikit_hep_testdata-0.5.8/src/
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/PKG-INFO
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/SOURCES.txt
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/dependency_links.txt
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/entry_points.txt
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/requires.txt
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/top_level.txt
scikit_hep_testdata-0.5.8/src/scikit_hep_testdata.egg-info/zip-safe
scikit_hep_testdata-0.5.8/src/skhep_testdata/
scikit_hep_testdata-0.5.8/src/skhep_testdata/__init__.py
scikit_hep_testdata-0.5.8/src/skhep_testdata/__main__.py
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/__init__.py
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/file_list.txt
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/pyhf-ins1748602-probability-models.doi
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/pylhe-testfile-madgraph-2.0.0-wbj.lhe.readme
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/pylhe-testfile-madgraph-2.2.1-Z-ckkwl.lhe.gz.readme
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/pylhe-testfile-madgraph-2.2.1-Z-fxfx.lhe.gz.readme
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/pylhe-testfile-madgraph-2.2.1-Z-mlm.lhe.gz.readme
scikit_hep_testdata-0.5.8/src/skhep_testdata/data/pylhe-testfile-pythia-6.413-ttbar.lhe.readme
scikit_hep_testdata-0.5.8/src/skhep_testdata/local_files.py
scikit_hep_testdata-0.5.8/src/skhep_testdata/py.typed
scikit_hep_testdata-0.5.8/src/skhep_testdata/remote_datasets.yml
scikit_hep_testdata-0.5.8/src/skhep_testdata/remote_files.py
scikit_hep_testdata-0.5.8/src/skhep_testdata/version.py
scikit_hep_testdata-0.5.8/tests/
scikit_hep_testdata-0.5.8/tests/__init__.py
scikit_hep_testdata-0.5.8/tests/test_local_files.py
scikit_hep_testdata-0.5.8/tests/test_remote_datasets.yml
scikit_hep_testdata-0.5.8/tests/test_remote_files.pywhich distributes files it doesn't need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that's much better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be curious to see a hatchling conversion as a followup (or uv_backend or flit-core). It probably would be faster and simpler. check-sdist might be useful.
I also would like to switch to |
setup.cfgtopyproject.toml.setup.cfgfile.asottile/setup-cfg-fmtpre-commit hook.Note: This PR should become
v0.6.0, asv0.5.9got yanked and a new release can't be created from the same commit where there is already a tag given the current release CI system.