mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-24 01:21:11 +00:00
python3Packages.protobuf4: fix for setuptools >= 81
`pkg_resources` was finally removed, use `packaging` for parsing version strings instead this is the recommended approach from setuptools' docs: https://setuptools.pypa.io/en/latest/deprecated/pkg_resources.html
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
numpy,
|
||||
packaging,
|
||||
protobuf,
|
||||
pytestCheckHook,
|
||||
pythonAtLeast,
|
||||
@@ -68,9 +69,18 @@ buildPythonPackage {
|
||||
+ ''
|
||||
substituteInPlace google/protobuf/internal/json_format_test.py \
|
||||
--replace-warn assertRaisesRegexp assertRaisesRegex
|
||||
''
|
||||
# setuptools 81 dropped pkg_resources, parse versions via packaging module
|
||||
+ ''
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail "import pkg_resources" "import packaging.version" \
|
||||
--replace-fail "pkg_resources.parse_version" "packaging.version.parse"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = lib.optional isPyPy tzdata;
|
||||
nativeBuildInputs = [
|
||||
packaging
|
||||
]
|
||||
++ lib.optional isPyPy tzdata;
|
||||
|
||||
buildInputs = [ protobuf ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user