-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Modernize the packaging setup via PEP 621 and Hatch. #957
Conversation
Codecov Report
@@ Coverage Diff @@
## main #957 +/- ##
=======================================
Coverage 96.88% 96.88%
=======================================
Files 20 20
Lines 3276 3276
Branches 449 449
=======================================
Hits 3174 3174
Misses 79 79
Partials 23 23 Continue to review full report at Codecov.
|
d87f32f
to
9602996
Compare
Doing so jettisons setuptools in favor of a more modern, well-designed, legacy-free, and now well-supported packaging tool, Hatch. No end-user facing behavior changes are expected for any users using a recent packaging setup (within the past 2-3 years), so please report any issues. Hatch: https://hatch.pypa.io/latest/ PEP 621: https://peps.python.org/pep-0621/
And only run the latter after the former.
Some additional detail would be helpful, such as that this project (now) uses hatch, which is why it's on this branch, but this is a start.
The `jsonschema` module switched the packaging system to Hatch since version 4.6.0 (python-jsonschema/jsonschema#957). The build process for `jsonschema` now requires the `hatchling` and `hatch-vcs` modules, but the used Nixpkgs snapshot does not include Nix packages for these modules; adding these modules to the `[tool.poetry.dev-dependencies]` section makes them available for the (upcoming) poetry2nix override without the need to bump the Nixpkgs snapshot. However, simply adding `hatchling` and `hatch-vcs` to dependencies produces some more dependency issues: 1) The `pytest` module in the used Nixpkgs snapshot is old and has a dependency for the `pluggy` module with an upper bound for the version, which creates a version conflict with the dependency of the `hatchling` module. Upgrading the `pytest` module to the current version fixes this compatibility issue. 2) The `tomli` module, which is in the dependency tree of `hatchling`, requires a newer `flit-core` module than found in the used Nixpkgs snapshot. Again, upgrading the `flit-core` module to the current version fixes the compatibility issue. When the Nixpkgs snapshot gets bumped in the future, this commit should probably be reverted (and `poetry.lock` should be regenerated to remove the unneeded dependencies).
The `jsonschema` module switched the packaging system to Hatch since version 4.6.0 (python-jsonschema/jsonschema#957). The build process for `jsonschema` now requires the `hatchling` and `hatch-vcs` modules, which were made available to poetry2nix by the previous commits; add these modules to `nativeBuildInput` to fix the build.
Doing so jettisons setuptools in favor of a more modern, well-designed,
legacy-free, and now well-supported packaging tool, Hatch.
No end-user facing behavior changes are expected for any users using a
recent packaging setup (within the past 2-3 years), so please report any
issues.
Hatch: https://hatch.pypa.io/latest/
PEP 621: https://peps.python.org/pep-0621/