pip-tools: fix build (#184326)

This commit is contained in:
SCOTT-HAMILTON 2022-08-01 16:42:16 +02:00 committed by GitHub
parent dda7a78c73
commit fa886e4416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -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 = [

View File

@ -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)