Skip to content

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Oct 13, 2025

What do these changes do?

Followup to #9951. Move dependencies and optional dependencies from setup.cfg to pyproject.toml.

Are there changes in behavior for the user?

Is it a substantial burden for the maintainers to support this?

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name 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 an
        improper 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 breaking
        changes 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 build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and 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 above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      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.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 13, 2025
@cdce8p cdce8p added backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot labels Oct 13, 2025
@cdce8p cdce8p force-pushed the move-dependencies branch from a0fe9f7 to f638514 Compare October 13, 2025 15:23
Copy link

codspeed-hq bot commented Oct 13, 2025

CodSpeed Performance Report

Merging #11643 will not alter performance

Comparing cdce8p:move-dependencies (88664dc) with master (b1bd65d)

Summary

✅ 59 untouched

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.74%. Comparing base (6b5d8e7) to head (88664dc).
⚠️ Report is 5 commits behind head on master.

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           
Flag Coverage Δ
CI-GHA 98.63% <ø> (+<0.01%) ⬆️
OS-Linux 98.36% <ø> (+<0.01%) ⬆️
OS-Windows 96.69% <ø> (+<0.01%) ⬆️
OS-macOS 97.59% <ø> (+<0.01%) ⬆️
Py-3.10.11 97.15% <ø> (+<0.01%) ⬆️
Py-3.10.18 97.64% <ø> (-0.01%) ⬇️
Py-3.11.13 97.84% <ø> (+<0.01%) ⬆️
Py-3.11.9 97.35% <ø> (+<0.01%) ⬆️
Py-3.12.10 97.45% <ø> (+<0.01%) ⬆️
Py-3.12.11 97.95% <ø> (+<0.01%) ⬆️
Py-3.13.7 98.21% <ø> (+0.01%) ⬆️
Py-3.14.0 98.15% <ø> (-0.01%) ⬇️
Py-3.14.0t 97.21% <ø> (-0.02%) ⬇️
Py-pypy3.10.16-7.3.19 88.16% <ø> (-6.02%) ⬇️
VM-macos 97.59% <ø> (+<0.01%) ⬆️
VM-ubuntu 98.36% <ø> (+<0.01%) ⬆️
VM-windows 96.69% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pytest_codspeed
python-on-whales
slotscheck
tomli; python_version < "3.11"
Copy link
Member

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.

Copy link
Contributor Author

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.

@@ -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
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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):
Copy link
Member

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?

Copy link
Contributor Author

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.

- 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.

@cdce8p cdce8p force-pushed the move-dependencies branch from 4294978 to 88664dc Compare October 14, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants