Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
submodules: true
- name: >-
Verify that `requirements/runtime-deps.in`
is in sync with `setup.cfg`
is in sync with `pyproject.toml`
run: |
set -eEuo pipefail
make sync-direct-runtime-deps
Expand Down
2 changes: 2 additions & 0 deletions CHANGES/11643.packaging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Moved dependency metadata from :file:`setup.cfg` to :file:`pyproject.toml` per :pep:`621`
-- by :user:`cdce8p`.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,5 @@ install-dev: .develop

.PHONY: sync-direct-runtime-deps
sync-direct-runtime-deps:
@echo Updating 'requirements/runtime-deps.in' from 'setup.cfg'... >&2
@echo Updating 'requirements/runtime-deps.in' from 'pyproject.toml'... >&2
@python requirements/sync-direct-runtime-deps.py
20 changes: 18 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,28 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
requires-python = ">= 3.10"
dependencies = [
"aiohappyeyeballs >= 2.5.0",
"aiosignal >= 1.4.0",
"async-timeout >= 4.0, < 6.0 ; python_version < '3.11'",
"attrs >= 17.3.0",
"frozenlist >= 1.1.1",
"multidict >=4.5, < 7.0",
"propcache >= 0.2.0",
"yarl >= 1.17.0, < 2.0",
]
dynamic = [
"dependencies",
"optional-dependencies",
"version",
]

[project.optional-dependencies]
speedups = [
"aiodns >= 3.3.0",
"Brotli; platform_python_implementation == 'CPython'",
"brotlicffi; platform_python_implementation != 'CPython'",
"backports.zstd; platform_python_implementation == 'CPython' and python_version < '3.14'",
]

[[project.maintainers]]
name = "aiohttp team"
email = "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions requirements/runtime-deps.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Extracted from `setup.cfg` via `make sync-direct-runtime-deps`
# Extracted from `pyproject.toml` via `make sync-direct-runtime-deps`

aiodns >= 3.3.0
aiohappyeyeballs >= 2.5.0
aiosignal >= 1.4.0
async-timeout >= 4.0, < 6.0 ; python_version < "3.11"
async-timeout >= 4.0, < 6.0 ; python_version < '3.11'
attrs >= 17.3.0
backports.zstd; platform_python_implementation == 'CPython' and python_version < "3.14"
backports.zstd; platform_python_implementation == 'CPython' and python_version < '3.14'
Brotli; platform_python_implementation == 'CPython'
brotlicffi; platform_python_implementation != 'CPython'
frozenlist >= 1.1.1
Expand Down
22 changes: 14 additions & 8 deletions requirements/sync-direct-runtime-deps.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/usr/bin/env python
"""Sync direct runtime dependencies from setup.cfg to runtime-deps.in."""
"""Sync direct runtime dependencies from pyproject.toml to runtime-deps.in."""

from configparser import ConfigParser
import sys
from pathlib import Path

cfg = ConfigParser()
cfg.read(Path("setup.cfg"))
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):
import tomllib
else:
raise RuntimeError("Use Python 3.11+ to run 'make sync-direct-runtime-deps'")

data = tomllib.loads(Path("pyproject.toml").read_text())
reqs = (
data["project"]["dependencies"]
+ data["project"]["optional-dependencies"]["speedups"]
)
reqs = sorted(reqs, key=str.casefold)

with open(Path("requirements", "runtime-deps.in"), "w") as outfile:
header = "# Extracted from `setup.cfg` via `make sync-direct-runtime-deps`\n\n"
header = "# Extracted from `pyproject.toml` via `make sync-direct-runtime-deps`\n\n"
outfile.write(header)
outfile.write("\n".join(reqs) + "\n")
18 changes: 0 additions & 18 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
[options]
install_requires =
aiohappyeyeballs >= 2.5.0
aiosignal >= 1.4.0
async-timeout >= 4.0, < 6.0 ; python_version < "3.11"
attrs >= 17.3.0
frozenlist >= 1.1.1
multidict >=4.5, < 7.0
propcache >= 0.2.0
yarl >= 1.17.0, < 2.0

[options.extras_require]
speedups =
aiodns >= 3.3.0
Brotli; platform_python_implementation == 'CPython'
brotlicffi; platform_python_implementation != 'CPython'
backports.zstd; platform_python_implementation == 'CPython' and python_version < "3.14"

[pep8]
max-line-length=79

Expand Down
Loading