From 582a9425deebb8170e373fb62944952557a523e2 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 6 Dec 2025 23:50:11 +0100 Subject: [PATCH 1/3] python3Packages.urllib3: 2.5.0 -> 2.6.0 https://github.com/urllib3/urllib3/blob/2.6.0/CHANGES.rst --- pkgs/development/python-modules/urllib3/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix index cdb50f45df0d..1ffb969719ba 100644 --- a/pkgs/development/python-modules/urllib3/default.nix +++ b/pkgs/development/python-modules/urllib3/default.nix @@ -9,10 +9,11 @@ hatch-vcs, # optional-dependencies + backports-zstd, brotli, brotlicffi, + h2, pysocks, - zstandard, # tests pytestCheckHook, @@ -24,12 +25,12 @@ let self = buildPythonPackage rec { pname = "urllib3"; - version = "2.5.0"; + version = "2.6.0"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-P8R3M8fkGdS8P2s9wrT4kLt0OQajDVa6Slv6S7/5J2A="; + hash = "sha256-y5vO9aSzRdXaXRRdw+MINPWOgBiCjLxyTTC0y31NSfE="; }; build-system = [ @@ -39,13 +40,14 @@ let postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail ', "setuptools-scm>=8,<9"' "" + --replace-fail ', "setuptools-scm>=8,<10"' "" ''; optional-dependencies = { brotli = if isPyPy then [ brotlicffi ] else [ brotli ]; + h2 = [ h2 ]; socks = [ pysocks ]; - zstd = [ zstandard ]; + zstd = [ backports-zstd ]; }; nativeCheckInputs = [ From 6056f229d5d6765b4aec7d6cf840123038002cc0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 Dec 2025 01:49:07 +0100 Subject: [PATCH 2/3] python3Packages.quart-trio: init at 0.12.0 --- .../python-modules/quart-trio/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/quart-trio/default.nix diff --git a/pkgs/development/python-modules/quart-trio/default.nix b/pkgs/development/python-modules/quart-trio/default.nix new file mode 100644 index 000000000000..67170265ca70 --- /dev/null +++ b/pkgs/development/python-modules/quart-trio/default.nix @@ -0,0 +1,65 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + + # build-system + pdm-backend, + + # dependencies + exceptiongroup, + hypercorn, + quart, + trio, + + # tests + pytest-cov-stub, + pytest-trio, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "quart-trio"; + version = "0.12.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pgjones"; + repo = "quart-trio"; + tag = version; + hash = "sha256-n41XATex20iw3ZYxud/5cTdx+F6tTQQJmP91TIw2xJo="; + }; + + build-system = [ + pdm-backend + ]; + + dependencies = [ + hypercorn + quart + trio + ] + ++ hypercorn.optional-dependencies.trio + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + ]; + + pythonImportsCheck = [ + "quart_trio" + ]; + + nativeCheckInputs = [ + pytest-cov-stub + pytest-trio + pytestCheckHook + ]; + + meta = { + description = "Quart-Trio is an extension for Quart to support the Trio event loop"; + homepage = "https://github.com/pgjones/quart-trio"; + changelog = "https://github.com/pgjones/quart-trio/blob/${src.tag}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index baef9dcd224c..c96cc3dbdcdd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15929,6 +15929,8 @@ self: super: with self; { quart-schema = callPackage ../development/python-modules/quart-schema { }; + quart-trio = callPackage ../development/python-modules/quart-trio { }; + quaternion = callPackage ../development/python-modules/quaternion { }; qudida = callPackage ../development/python-modules/qudida { }; From de0008bac2c9a48071bcb33765ccaf5f2024d6f5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 Dec 2025 18:02:58 +0100 Subject: [PATCH 3/3] python3Packages.urllib3: run more tests This gets the tests running again and enables more of them. I still did not manage to fix all of them. --- .../python-modules/urllib3/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix index 1ffb969719ba..474fcee846ce 100644 --- a/pkgs/development/python-modules/urllib3/default.nix +++ b/pkgs/development/python-modules/urllib3/default.nix @@ -16,9 +16,15 @@ pysocks, # tests + httpx, + pyopenssl, pytestCheckHook, + pytest-socket, pytest-timeout, + quart, + quart-trio, tornado, + trio, trustme, }: @@ -51,13 +57,23 @@ let }; nativeCheckInputs = [ + httpx + pyopenssl + pytest-socket pytest-timeout pytestCheckHook + quart + quart-trio tornado + trio trustme ] ++ lib.concatAttrValues optional-dependencies; + disabledTestMarks = [ + "requires_network" + ]; + # Tests in urllib3 are mostly timeout-based instead of event-based and # are therefore inherently flaky. On your own machine, the tests will # typically build fine, but on a loaded cluster such as Hydra random