From fa886e44164b02576ba5f69bd734402a0a8a6e9a Mon Sep 17 00:00:00 2001 From: SCOTT-HAMILTON Date: Mon, 1 Aug 2022 16:42:16 +0200 Subject: [PATCH] pip-tools: fix build (#184326) --- .../python-modules/pip-tools/default.nix | 5 +++++ .../fix-setup-py-bad-syntax-detection.patch | 21 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/python-modules/pip-tools/fix-setup-py-bad-syntax-detection.patch diff --git a/pkgs/development/python-modules/pip-tools/default.nix b/pkgs/development/python-modules/pip-tools/default.nix index 93eb848a6452..84521397a707 100644 --- a/pkgs/development/python-modules/pip-tools/default.nix +++ b/pkgs/development/python-modules/pip-tools/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , buildPythonPackage +, build , click , fetchPypi , pep517 @@ -25,11 +26,14 @@ buildPythonPackage rec { hash = "sha256-Oeiu5GVEbgInjYDb69QyXR3YYzJI9DITxzol9Y59ilU="; }; + patches = [ ./fix-setup-py-bad-syntax-detection.patch ]; + nativeBuildInputs = [ setuptools-scm ]; propagatedBuildInputs = [ + build click pep517 pip @@ -51,6 +55,7 @@ buildPythonPackage rec { # Tests require network access "network" "test_direct_reference_with_extras" + "test_local_duplicate_subdependency_combined" ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/pip-tools/fix-setup-py-bad-syntax-detection.patch b/pkgs/development/python-modules/pip-tools/fix-setup-py-bad-syntax-detection.patch new file mode 100644 index 000000000000..6a88222139e1 --- /dev/null +++ b/pkgs/development/python-modules/pip-tools/fix-setup-py-bad-syntax-detection.patch @@ -0,0 +1,21 @@ +diff --color -ru a/piptools/scripts/compile.py b/piptools/scripts/compile.py +--- a/piptools/scripts/compile.py 2022-06-30 11:24:26.000000000 +0200 ++++ b/piptools/scripts/compile.py 2022-08-01 13:40:58.392515765 +0200 +@@ -6,7 +6,7 @@ + from typing import IO, Any, BinaryIO, List, Optional, Tuple, Union, cast + + import click +-from build import BuildBackendException ++from build import BuildException + from build.util import project_wheel_metadata + from click.utils import LazyFile, safecall + from pip._internal.commands import create_command +@@ -421,7 +421,7 @@ + metadata = project_wheel_metadata( + os.path.dirname(os.path.abspath(src_file)) + ) +- except BuildBackendException as e: ++ except (BuildException,StopIteration) as e: + log.error(str(e)) + log.error(f"Failed to parse {os.path.abspath(src_file)}") + sys.exit(2)