-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Update package metadata #1348
Update package metadata #1348
Conversation
This can help avoid potential confusion, like what appears to have been the cause of jazzband#1326.
They're now aligned left-to-right instead of above each other on GitHub. (The rendered RST on PyPI and in the docs should be unaffected.) Also changed their order.
Most of the changes to `pyproject.toml` were made by running `hatch new --init` (see https://hatch.pypa.io/latest/intro/#existing-project). Most of the changes to the other files were based on the changes made in django-commons/django-debug-toolbar#1690. ### `release.yml`: * `hatch version` is run instead of `hatchling version` (as is done in the PR mentioned above), as the latter crashes with the error: ``` hatchling.plugin.exceptions.UnknownPluginError: Unknown version source: vcs ``` Installing `hatch` takes considerably longer than just `hatchling`, but I think it's still acceptable. * Updated the `pypa/gh-action-pypi-publish` action from the sunset `master` branch to `release/v1`; see warning at https://github.com/jazzband/django-simple-history/actions/runs/9246937361. Also replaced the deprecated `repository_url` with `repository-url`; see https://github.com/pypa/gh-action-pypi-publish/blob/v1.8.14/action.yml#L15 ### `.pre-commit-config.yaml`: * Added some pre-commit hooks for formatting and validating `pyproject.toml` ### `MANIFEST.in`: * Removed `MANIFEST.in`, as the default `[tool.hatch.build.targets.sdist]` configuration (in `pyproject.toml`) includes all files not ignored through our `.gitignore`; see https://hatch.pypa.io/latest/plugins/builder/sdist/#default-file-selection ### `pyproject.toml`: * Didn't include the `license` field, as the docs recommend using a `License ::` classifier instead - see https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license * The classifier "Programming Language :: Python :: 3" was changed to "Programming Language :: Python :: 3 :: Only" by the `pyproject-fmt` pre-commit hook * Set `core-metadata-version = "2.2"` (copied from django-commons/django-debug-toolbar#1916) due to jazzband/help#360 * Didn't include the last 3 packages from the `packages` kwarg in `setup.py` when configuring `[tool.hatch.build.targets.wheel]`, since they don't make any difference in the generated wheel, as having just `simple_history` will include all its subpackages * As part of porting long_description's file concatenation from `setup.py`, `hatch-fancy-pypi-readme` was added to `requires` and configured to concatenate the same files - except with the first title of `README.rst` and the "Unreleased" section of `CHANGES.rst` removed (facilitated by the added "Start of PyPI readme" comments in those two files)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1348 +/- ##
==========================================
- Coverage 96.83% 96.77% -0.06%
==========================================
Files 24 24
Lines 1452 1457 +5
Branches 237 240 +3
==========================================
+ Hits 1406 1410 +4
- Misses 24 25 +1
Partials 22 22 ☔ View full report in Codecov by Sentry. |
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, this is very much appreciated! 😄
I actually happened to be working on the same update simultaneously, so I merged your changes with mine; please let me know if you have any feedback on my changes 🙂
Wow, that's pretty crazy timing! If you are planning on doing the same to other repositories maybe you could let me know what you're doing next and I'll do the same for others. We could coordinate in the tracking issue I linked in the description if you want! |
Isolated build environments are enabled by default from tox v4; see jazzband#1348 (comment)
Yeah, I was pretty surprised to see your PR in my inbox 😅 I don't have any plans on doing the same in other repos, but I'll keep the tracking issue you mentioned in mind if I make any 😊 (Just to be clear, I'm assuming you were talking about jazzband/help#313, right?) |
Yes that is the issue I was referring to! Okay sounds good, I will do some more in my free time tonight. |
# Conflicts: # .github/workflows/release.yml # CHANGES.rst # pyproject.toml Changes in `pyproject.toml`: * Removed `license`, for the reason stated in fef00f6 * Removed duplicate "Framework :: Django" classifier (originating from `setup.py`) * Replaced `version_scheme` with "no-guess-dev", which is the docs' recommended replacement for "post-release" - which is deprecated (see https://setuptools-scm.readthedocs.io/en/stable/extending/#available-implementations) * Removed `include`, as the default configuration includes all files not ignored through our `.gitignore` (see https://hatch.pypa.io/latest/plugins/builder/sdist/#default-file-selection), which is what we want in the source distribution (sdist) * Added link to issue in the comments on the `core-metadata-version` fields - see jazzband#1348 (comment) Changes in `tox.ini`: * Removed `isolated_build`, as isolated build environments are enabled by default from tox v4 - see jazzband#1348 (comment)
027b551
to
19722e2
Compare
Nice, keep up the good work! 😄 |
Motivation and Context
Hello there! The Python packaging ecosystem has standardized on the interface for build backends (PEP 517/PEP 660) and the format for metadata declaration (PEP 621/PEP 631). As a result, the execution of
setup.py
files is now deprecated.So, I'm spending my free time updating important projects so that they are modernized and set an example for others 😄
Some other Django projects that have been updated:
Description
This implements PEP 621, obviating the need for
setup.py
andMANIFEST.in
. The build backendhatchling
(of which I am a maintainer in the PyPA) is now used as that is the default in the official Python packaging tutorial. Hatchling is available on all the major distribution channels such as Debian, Fedora, Arch Linux, conda-forge, Nixpkgs, Alpine Linux, FreeBSD/OpenBSD, Gentoo Linux, MacPorts, OpenEmbedded, Spack, MSYS2, etc.Related Issue
jazzband/help#313
How Has This Been Tested?
Checklist:
pre-commit run
command to format and lint.AUTHORS.rst
CHANGES.rst
Notes
*.egg-info
directory.