From ccbbac8fae1f4a65efcb75b79c105b6634008568 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Fri, 8 May 2026 22:24:02 +0200 Subject: [PATCH 1/2] Switch from httpx to httpxyz --- poetry.lock | 55 ++++++++++++++++++-- pyproject.toml | 2 +- scopesim/commands/user_commands.py | 2 +- scopesim/server/database.py | 2 +- scopesim/server/download_utils.py | 2 +- scopesim/tests/tests_server/test_database.py | 2 +- 6 files changed, 56 insertions(+), 9 deletions(-) diff --git a/poetry.lock b/poetry.lock index fde8470a..1b01021c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -365,14 +365,14 @@ css = ["tinycss2 (>=1.1.0,<1.3)"] [[package]] name = "certifi" -version = "2025.6.15" +version = "2026.4.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" groups = ["main", "dev", "docs"] files = [ - {file = "certifi-2025.6.15-py3-none-any.whl", hash = "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057"}, - {file = "certifi-2025.6.15.tar.gz", hash = "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"}, + {file = "certifi-2026.4.22-py3-none-any.whl", hash = "sha256:3cb2210c8f88ba2318d29b0388d1023c8492ff72ecdde4ebdaddbb13a31b1c4a"}, + {file = "certifi-2026.4.22.tar.gz", hash = "sha256:8d455352a37b71bf76a79caa83a3d6c25afee4a385d632127b6afb3963f1c580"}, ] [[package]] @@ -1142,6 +1142,28 @@ http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] trio = ["trio (>=0.22.0,<1.0)"] +[[package]] +name = "httpcorexyz" +version = "1.1.1" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "httpcorexyz-1.1.1-py3-none-any.whl", hash = "sha256:58becd21f127c0a846813d0705f9e0c27c16c867bb436813667f569d4f0ba94e"}, + {file = "httpcorexyz-1.1.1.tar.gz", hash = "sha256:0b8dbbe8ffaccd20b7c755d92129f9fb04a23f2ef22b32ff82e2d1c7fcfee803"}, +] + +[package.dependencies] +certifi = ">=2026.2.25" +h11 = ">=0.16" + +[package.extras] +asyncio = ["anyio (>=4.5.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + [[package]] name = "httpx" version = "0.28.1" @@ -1167,6 +1189,31 @@ http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "httpxyz" +version = "0.31.2" +description = "Friendly fork of the next generation HTTP client." +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "httpxyz-0.31.2-py3-none-any.whl", hash = "sha256:1e8058b7324aaf875efb6b4cf5a5a423f4ac101fd4af515349fb4e1d3e4d4441"}, + {file = "httpxyz-0.31.2.tar.gz", hash = "sha256:da96c2f35c724023b9395b1df718f7d52d049b8424a0c919ca0fe2b64dce73a0"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcorexyz = ">=1.1.1" +idna = "*" + +[package.extras] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<15)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + [[package]] name = "idna" version = "3.10" @@ -4581,4 +4628,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<3.15" -content-hash = "b65171d430f786296ef022cf73d16468aff1d0327793b28cdb6f6a7304e82e45" +content-hash = "0b1cf5c44318e7bfff2fc2516a5143babda1c3f4e3110675ae373ceaecbcf778" diff --git a/pyproject.toml b/pyproject.toml index 0dd417f1..cfeb9083 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "pooch (>=1.8.2,<2.0.0)", "docutils (>=0.19,<1.0)", - "httpx (>=0.28.1,<1.0)", + "httpxyz (>=0.31.2,<1.0)", "beautifulsoup4 (>=4.13.3,<5.0.0)", "lxml (>=6.0.2,<7.0.0)", "pyyaml (>=6.0.3,<7.0.0)", diff --git a/scopesim/commands/user_commands.py b/scopesim/commands/user_commands.py index 50455b83..a004c73f 100644 --- a/scopesim/commands/user_commands.py +++ b/scopesim/commands/user_commands.py @@ -8,7 +8,7 @@ from typing import Any import yaml -import httpx +import httpxyz as httpx from packaging.version import parse from astar_utils import NestedMapping, RecursiveNestedMapping, NestedChainMap diff --git a/scopesim/server/database.py b/scopesim/server/database.py index e1d73cc0..f7d92560 100644 --- a/scopesim/server/database.py +++ b/scopesim/server/database.py @@ -7,7 +7,7 @@ from collections.abc import Iterator, Iterable, Mapping import yaml -import httpx +import httpxyz as httpx from more_itertools import first, last, groupby_transform from .github_utils import download_github_folder diff --git a/scopesim/server/download_utils.py b/scopesim/server/download_utils.py index fbce1817..2ea7e127 100644 --- a/scopesim/server/download_utils.py +++ b/scopesim/server/download_utils.py @@ -6,7 +6,7 @@ from zipfile import ZipFile from pathlib import Path -import httpx +import httpxyz as httpx import bs4 import pooch diff --git a/scopesim/tests/tests_server/test_database.py b/scopesim/tests/tests_server/test_database.py index 3c25174f..efb6858f 100644 --- a/scopesim/tests/tests_server/test_database.py +++ b/scopesim/tests/tests_server/test_database.py @@ -13,7 +13,7 @@ @pytest.fixture(scope="class") def mock_client(): - # TODO: investigate proper mocking via httpx + # TODO: investigate proper mocking via httpxyz with db.create_client(db.get_base_url()) as client: yield client From 9f42f201866ee819dda1d03a01ea207b45e0d7c3 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Wed, 3 Jun 2026 13:58:46 +0200 Subject: [PATCH 2/2] Fix lock file --- poetry.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 709cc42b..0dc7377c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4641,4 +4641,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<3.15" -content-hash = "b0f0e32e8915a61b3ba986247ee05e36989c31bde957818c586b6ec58d47b27e" +content-hash = "39e1610b27f18e40d719581ec646f120489114c15d92415e758e94b0f132786e"