Skip to content

Commit

Permalink
python3Packages.setuptools: fix NixOS#353830
Browse files Browse the repository at this point in the history
  • Loading branch information
Antares0982 committed Nov 7, 2024
1 parent 41179d8 commit a304314
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkgs/development/python-modules/setuptools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
fetchFromGitHub,
python,
wheel,
pythonOlder,
}:

buildPythonPackage rec {
Expand All @@ -20,9 +21,13 @@ buildPythonPackage rec {
hash = "sha256-ZvhXfusayUHHFXl7ZBksFhxTi1p+Va6qAwq7Fo7Tg/s=";
};

patches = [
./tag-date.patch
];
patches =
[
./tag-date.patch
]
++ lib.optionals (pythonOlder "3.10") [
./str-fix.patch
];

nativeBuildInputs = [ wheel ];

Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/setuptools/str-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/setuptools/_vendor/importlib_metadata/__init__.py b/setuptools/_vendor/importlib_metadata/__init__.py
index ed4813551..790513de1 100644
--- a/setuptools/_vendor/importlib_metadata/__init__.py
+++ b/setuptools/_vendor/importlib_metadata/__init__.py
@@ -836,7 +836,7 @@ class Prepared:
"""
PEP 503 normalization plus dashes as underscores.
"""
- return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
+ return re.sub(r"[-_.]+", "-", str(name)).lower().replace('-', '_')

@staticmethod
def legacy_normalize(name):

0 comments on commit a304314

Please sign in to comment.