Skip to content

Commit 5af5e3b

Browse files
replace httpx with httpx2
1 parent f159a2b commit 5af5e3b

7 files changed

Lines changed: 281 additions & 224 deletions

File tree

pixi.lock

Lines changed: 208 additions & 160 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ authors = ["softwareentrepreneer <softwareentrepreneer+afterpython@gmail.com>"]
33
channels = ["conda-forge"]
44
name = "afterpython"
55
platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"]
6-
# NOTE: this depends on the lock version used in setup-pixi in ci.yml
7-
requires-pixi = "<=0.72.2" # command: pixi workspace requires-pixi set "<=0.72.2"
6+
# NOTE: the minimum supports relative exclude-newer; the maximum matches setup-pixi in ci.yml
7+
requires-pixi = ">=0.67.0,<=0.72.2"
8+
exclude-newer = "14d"
89

910
[tasks]
1011

@@ -23,7 +24,7 @@ gh = ">=2.92.0"
2324
[pypi-dependencies]
2425
click = ">=8.1.8"
2526
trogon = ">=0.6.0"
26-
httpx = ">=0.28.1"
27+
httpx2 = ">=2.5.0"
2728
tomlkit = ">=0.15.0"
2829
ruamel-yaml = ">=0.19.1"
2930
gitpython = ">=3.1.50"
@@ -34,9 +35,9 @@ jupytext = ">=1.19.4"
3435
# jinja2 = ">=3.1.6"
3536
mystmd = ">=1.10.1"
3637
pdoc = ">=16.0.0"
37-
ruff = ">=0.15.22"
38+
ruff = ">=0.15.21"
3839
pre-commit = ">=4.6.0"
39-
commitizen = ">=4.16.5"
40+
commitizen = ">=4.16.4"
4041
# python-semantic-release = ">=10.5.2"
4142

4243
# [pypi-options.dependency-overrides]

pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ requires-python = ">=3.11"
3434
dependencies = [
3535
"click>=8.1.8",
3636
"trogon>=0.6.0",
37-
"httpx>=0.28.1",
37+
"httpx2>=2.5.0",
3838
"tomlkit>=0.15.0",
3939
"ruamel-yaml>=0.19.1",
4040
"gitpython>=3.1.50",
@@ -45,9 +45,9 @@ dependencies = [
4545
# "jinja2>=3.1.6",
4646
"mystmd>=1.10.1",
4747
"pdoc>=16.0.0",
48-
"ruff>=0.15.22",
48+
"ruff>=0.15.21",
4949
"pre-commit>=4.6.0",
50-
"commitizen>=4.16.5",
50+
"commitizen>=4.16.4",
5151
# "python-semantic-release>=10.5.2",
5252
]
5353

@@ -64,9 +64,12 @@ pcu = "afterpython.main:run_pcu"
6464
# override-dependencies = ["platformdirs>=4.5.0", "nodeenv>=1.9.1"]
6565

6666
[build-system]
67-
requires = ["uv_build>=0.11.30,<0.12.0"]
67+
requires = ["uv_build>=0.11.28,<0.12.0"]
6868
build-backend = "uv_build"
6969

70+
[tool.uv]
71+
exclude-newer = "14 days"
72+
7073
[tool.uv.build-backend]
7174
module-name = "afterpython"
7275
module-root = "src"

src/afterpython/pcu.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ async def get_latest_versions(
6060
requirements: list[Requirement],
6161
) -> dict[str, Version | None]:
6262
"""Get latest versions for a list of dependencies from PyPI."""
63-
import httpx
63+
import httpx2
6464

6565
from afterpython.utils import fetch_pypi_json
6666

6767
async def fetch_version(
68-
client: httpx.AsyncClient, package_name: str
68+
client: httpx2.AsyncClient, package_name: str
6969
) -> Version | None:
7070
"""Fetch the latest version of a package from PyPI."""
7171
data = await fetch_pypi_json(client, package_name)
7272
return Version(data["info"]["version"]) if data else None
7373

74-
async with httpx.AsyncClient(timeout=10.0) as client:
74+
async with httpx2.AsyncClient(timeout=10.0) as client:
7575
tasks = [fetch_version(client, req.name) for req in requirements]
7676
results = await asyncio.gather(*tasks, return_exceptions=True)
7777
return dict(zip([req.name for req in requirements], results, strict=False))

src/afterpython/tools/pyproject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def init_pyproject():
7474
- add [build-system] section with uv build backend (same as `uv init --package`)
7575
- add [project.urls] section with homepage, repository, and documentation URLs
7676
"""
77-
import httpx
77+
import httpx2
7878

7979
from afterpython.tools._git import get_git_user_config, get_github_url
8080
from afterpython.utils import fetch_pypi_json
@@ -83,7 +83,7 @@ def init_pyproject():
8383

8484
async def fetch_build_backend_version() -> str | None:
8585
"""Fetch the latest version of build backend package from PyPI."""
86-
async with httpx.AsyncClient() as client:
86+
async with httpx2.AsyncClient() as client:
8787
data = await fetch_pypi_json(client, build_backend)
8888
return data["info"]["version"] if data else None
8989

src/afterpython/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if TYPE_CHECKING:
66
from pathlib import Path
77

8-
from httpx import AsyncClient
8+
from httpx2 import AsyncClient
99

1010
from afterpython._typing import NodeEnv
1111

0 commit comments

Comments
 (0)