From a03725a6c6bdaa098a6e48a70c447a102385ff7a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 12 May 2026 03:27:01 +0200 Subject: [PATCH] python3Packages.setuptools_80: init at 80.10.2 81 is the last version with pkg_resources module. 80 is the last version with dry_run arg in copy_file function. --- .../python-modules/setuptools/80.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/setuptools/80.nix diff --git a/pkgs/development/python-modules/setuptools/80.nix b/pkgs/development/python-modules/setuptools/80.nix new file mode 100644 index 000000000000..a051cb776fa3 --- /dev/null +++ b/pkgs/development/python-modules/setuptools/80.nix @@ -0,0 +1,56 @@ +{ + stdenv, + lib, + buildPythonPackage, + distutils_80, + fetchFromGitHub, + python, +}: + +buildPythonPackage (finalAttrs: { + pname = "setuptools"; + version = "80.10.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pypa"; + repo = "setuptools"; + tag = "v${finalAttrs.version}"; + hash = "sha256-kf2c4auQrZDGW8bM0SxOPFsR8IE4b0coevTxKWGtHp8="; + }; + + patches = [ + ./reproducible-wheel.patch + ]; + + # Drop dependency on coherent.license, which in turn requires coherent.build + postPatch = '' + sed -i "/coherent.licensed/d" pyproject.toml + + # Substitute version for reproducible builds + substituteInPlace setuptools/version.py \ + --replace-fail '@version@' '${finalAttrs.version}' + ''; + + preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) '' + export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0 + ''; + + # Requires pytest, causing infinite recursion. + doCheck = false; + + passthru.tests = { + inherit distutils_80; + }; + + meta = { + description = "Utilities to facilitate the installation of Python packages"; + homepage = "https://github.com/pypa/setuptools"; + changelog = "https://setuptools.pypa.io/en/stable/history.html#v${ + lib.replaceString "." "-" finalAttrs.version + }"; + license = with lib.licenses; [ mit ]; + platforms = python.meta.platforms; + teams = [ lib.teams.python ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bf307ade35ac..126941497f48 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -27,6 +27,8 @@ self: super: with self; { setuptools = callPackage ../development/python-modules/setuptools { }; + setuptools_80 = callPackage ../development/python-modules/setuptools/80.nix { }; + # by_regex ensures inherit statements are sorted after the (first) attribute name that is inherited. # keep-sorted start block=yes newline_separated=yes by_regex=["(?:inherit\\s+\\([^)]+\\)\\n?\\s*)?(.+)"] a2a-sdk = callPackage ../development/python-modules/a2a-sdk { };