From 5f3abe53c32f4bf6aa20e4bfa582566d21d5e085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 24 May 2026 08:46:17 -0700 Subject: [PATCH 1/2] python3Packages.urllib3: 2.6.3 -> 2.7.0 Diff: https://github.com/urllib3/urllib3/compare/2.6.3...2.7.0 Changelog: https://github.com/urllib3/urllib3/blob/2.7.0/CHANGES.rst --- .../python-modules/urllib3/default.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix index 047c47c2dcbe..e9e5ce9eab21 100644 --- a/pkgs/development/python-modules/urllib3/default.nix +++ b/pkgs/development/python-modules/urllib3/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, isPyPy, # build-system @@ -31,12 +31,14 @@ let self = buildPythonPackage rec { pname = "urllib3"; - version = "2.6.3"; + version = "2.7.0"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-G2K2iElEpX2+MhUJq5T9TTswcHXgwurpkaxx7hWtOO0="; + src = fetchFromGitHub { + owner = "urllib3"; + repo = "urllib3"; + tag = version; + hash = "sha256-iN59MS5gKgDxe2v4ILrZ/1y7wV4yB1tFs4ATKppYAAk="; }; build-system = [ @@ -44,11 +46,6 @@ let hatch-vcs ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail ', "setuptools-scm>=8,<10"' "" - ''; - optional-dependencies = { brotli = if isPyPy then [ brotlicffi ] else [ brotli ]; h2 = [ h2 ]; From b353c0a0f82604f8d0ae661c268594011039606c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 24 May 2026 08:52:37 -0700 Subject: [PATCH 2/2] python3Packages.urllib3: use finalAttrs --- .../python-modules/urllib3/default.nix | 145 +++++++++--------- 1 file changed, 71 insertions(+), 74 deletions(-) diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix index e9e5ce9eab21..3ff4ea706250 100644 --- a/pkgs/development/python-modules/urllib3/default.nix +++ b/pkgs/development/python-modules/urllib3/default.nix @@ -28,79 +28,76 @@ trustme, }: -let - self = buildPythonPackage rec { - pname = "urllib3"; - version = "2.7.0"; - pyproject = true; +buildPythonPackage (finalAttrs: { + pname = "urllib3"; + version = "2.7.0"; + pyproject = true; - src = fetchFromGitHub { - owner = "urllib3"; - repo = "urllib3"; - tag = version; - hash = "sha256-iN59MS5gKgDxe2v4ILrZ/1y7wV4yB1tFs4ATKppYAAk="; - }; - - build-system = [ - hatchling - hatch-vcs - ]; - - optional-dependencies = { - brotli = if isPyPy then [ brotlicffi ] else [ brotli ]; - h2 = [ h2 ]; - socks = [ pysocks ]; - zstd = [ backports-zstd ]; - }; - - 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 - # timeouts will occur. - # - # The urllib3 test suite has two different timeouts in their test suite - # (see `test/__init__.py`): - # - SHORT_TIMEOUT - # - LONG_TIMEOUT - # When CI is in the env, LONG_TIMEOUT will be significantly increased. - # Still, failures can occur and for that reason tests are disabled. - doCheck = false; - - passthru.tests.pytest = self.overridePythonAttrs (_: { - doCheck = true; - }); - - preCheck = '' - export CI # Increases LONG_TIMEOUT - ''; - - pythonImportsCheck = [ "urllib3" ]; - - meta = { - description = "Powerful, user-friendly HTTP client for Python"; - homepage = "https://github.com/urllib3/urllib3"; - changelog = "https://github.com/urllib3/urllib3/blob/${version}/CHANGES.rst"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ fab ]; - }; + src = fetchFromGitHub { + owner = "urllib3"; + repo = "urllib3"; + tag = finalAttrs.version; + hash = "sha256-iN59MS5gKgDxe2v4ILrZ/1y7wV4yB1tFs4ATKppYAAk="; }; -in -self + + build-system = [ + hatchling + hatch-vcs + ]; + + optional-dependencies = { + brotli = if isPyPy then [ brotlicffi ] else [ brotli ]; + h2 = [ h2 ]; + socks = [ pysocks ]; + zstd = [ backports-zstd ]; + }; + + nativeCheckInputs = [ + httpx + pyopenssl + pytest-socket + pytest-timeout + pytestCheckHook + quart + quart-trio + tornado + trio + trustme + ] + ++ lib.concatAttrValues finalAttrs.passthru.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 + # timeouts will occur. + # + # The urllib3 test suite has two different timeouts in their test suite + # (see `test/__init__.py`): + # - SHORT_TIMEOUT + # - LONG_TIMEOUT + # When CI is in the env, LONG_TIMEOUT will be significantly increased. + # Still, failures can occur and for that reason tests are disabled. + doCheck = false; + + passthru.tests.pytest = finalAttrs.finalPackage.overrideAttrs (_: { + doInstallCheck = true; + }); + + preCheck = '' + export CI # Increases LONG_TIMEOUT + ''; + + pythonImportsCheck = [ "urllib3" ]; + + meta = { + description = "Powerful, user-friendly HTTP client for Python"; + homepage = "https://github.com/urllib3/urllib3"; + changelog = "https://github.com/urllib3/urllib3/blob/${finalAttrs.src.tag}/CHANGES.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +})