-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Move dependency metadata to pyproject.toml #11643
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
base: master
Are you sure you want to change the base?
Conversation
a0fe9f7
to
f638514
Compare
CodSpeed Performance ReportMerging #11643 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11643 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 127 127
Lines 43448 43449 +1
Branches 2326 2326
=======================================
+ Hits 42903 42904 +1
Misses 389 389
Partials 156 156
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
requirements/lint.in
Outdated
pytest_codspeed | ||
python-on-whales | ||
slotscheck | ||
tomli; python_version < "3.11" |
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.
Add a comment at the end of the line, explaining where it's used.
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.
Not necessary anymore. Will remove tomli
here.
requirements/lint.txt
Outdated
@@ -1,5 +1,5 @@ | |||
# | |||
# This file is autogenerated by pip-compile with Python 3.12 | |||
# This file is autogenerated by pip-compile with Python 3.10 |
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.
We shouldn't use a different version to generate constant files.
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.
Same. Will remove the lint requirements changes.
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.
Let's use pypa/build to perform this extraction. There's respective API that uses PEP 517 properly: https://github.com/nedbat/scriv/pull/144/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R16
This would be more future-proof.
P.S. At some point, it'd be good to use pip-tools
directly but right now, it doesn't exclude the project self-reference.
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 looked into it, especially build.util..project_wheel_metadata
. However, using it here would be more involved as the project metadata isn't in the right format for the runtime-deps.in
file. Extras are added to each requirement which we would need to filter out first. Additionally, the script is run at a point in CI where no
dependencies are actually installed. It would be possible to resolve both, but I don't think the effort is really worth it. The only time this really needs to be adjusted is when a new extra
is added and that should be simple enough.
https://build.pypa.io/en/stable/api.html#build.util.project_wheel_metadata
>>> from build.util import project_wheel_metadata
>>> from pprint import pprint
>>> metadata = project_wheel_metadata(".")
>>> pprint(metadata.get_all("requires-dist"))
['aiohappyeyeballs>=2.5.0',
'aiosignal>=1.4.0',
'async-timeout<6.0,>=4.0; python_version < "3.11"',
'frozenlist>=1.1.1',
'multidict<7.0,>=4.5',
'propcache>=0.2.0',
'yarl<2.0,>=1.17.0',
'aiodns>=3.3.0; extra == "speedups"',
'Brotli; platform_python_implementation == "CPython" and extra == "speedups"',
'brotlicffi; platform_python_implementation != "CPython" and extra == '
'"speedups"',
'backports.zstd; (platform_python_implementation == "CPython" and '
'python_version < "3.14") and extra == "speedups"']
reqs = cfg["options"]["install_requires"] + cfg.items("options.extras_require")[0][1] | ||
reqs = sorted(reqs.split("\n"), key=str.casefold) | ||
reqs.remove("") | ||
if sys.version_info >= (3, 11): |
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'm sure we can just pin the Python version where this is invoked and forget about the fallbacks. WDYT?
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.
Sure that will work. AFAICT it's used once in ci-cd.yml
. Actually without even installing the requirements. The default Python version on ubuntu-latest
is Python 3.12.3
currently.
aiohttp/.github/workflows/ci-cd.yml
Lines 42 to 48 in b1bd65d
- name: >- | |
Verify that `requirements/runtime-deps.in` | |
is in sync with `setup.cfg` | |
run: | | |
set -eEuo pipefail | |
make sync-direct-runtime-deps | |
git diff --exit-code -- requirements/runtime-deps.in |
Will remove the fallback for tomli and raise an error instead.
4294978
to
88664dc
Compare
What do these changes do?
Followup to #9951. Move dependencies and optional dependencies from
setup.cfg
topyproject.toml
.Are there changes in behavior for the user?
Is it a substantial burden for the maintainers to support this?
Related issue number
Checklist
CONTRIBUTORS.txt
CHANGES/
foldername it
<issue_or_pr_num>.<type>.rst
(e.g.588.bugfix.rst
)if you don't have an issue number, change it to the pull request
number after creating the PR
.bugfix
: A bug fix for something the maintainers deemed animproper undesired behavior that got corrected to match
pre-agreed expectations.
.feature
: A new behavior, public APIs. That sort of stuff..deprecation
: A declaration of future API removals and breakingchanges in behavior.
.breaking
: When something public is removed in a breaking way.Could be deprecated in an earlier release.
.doc
: Notable updates to the documentation structure or buildprocess.
.packaging
: Notes for downstreams about unobvious side effectsand tooling. Changes in the test invocation considerations and
runtime assumptions.
.contrib
: Stuff that affects the contributor experience. e.g.Running tests, building the docs, setting up the development
environment.
.misc
: Changes that are hard to assign to any of the abovecategories.
Make sure to use full sentences with correct case and punctuation,
for example:
Use the past tense or the present tense a non-imperative mood,
referring to what's changed compared to the last released version
of this project.