diff --git a/pipenv/vendor/pipdeptree/LICENSE b/pipenv/vendor/pipdeptree/LICENSE new file mode 100644 index 0000000000..852f337a0f --- /dev/null +++ b/pipenv/vendor/pipdeptree/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2015 Vineet Naik (naikvin@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/vendoring/__init__.py b/tasks/vendoring/__init__.py index f95bb4a5cc..bbd1a8cc2a 100644 --- a/tasks/vendoring/__init__.py +++ b/tasks/vendoring/__init__.py @@ -486,6 +486,7 @@ def download_licenses( log(requirements) tmp_dir = vendor_dir / "__tmp__" # TODO: Fix this whenever it gets sorted out (see https://github.com/pypa/pip/issues/5739) + cmd = "pip download --no-binary :all: --only-binary requests_download --no-deps" ctx.run("pip install flit") # needed for the next step for req in requirements: @@ -493,20 +494,34 @@ def download_licenses( try: ctx.run(exe_cmd) except invoke.exceptions.UnexpectedExit as e: - if "Disabling PEP 517 processing is invalid" not in e.result.stderr: + if "ModuleNotFoundErr" in e.result.stderr.strip(): + + target = parse.parse( + "ModuleNotFoundError: No module named '{backend}'", + e.result.stderr.strip().split("\n")[-1], + ) + backend = target.named.get("backend") + if backend is not None: + if "." in backend: + backend, _, _ = backend.partition(".") + ctx.run(f"pip install {backend}") + ctx.run("pip install hatch-vcs") + elif "Disabling PEP 517 processing is invalid" not in e.result.stderr: log(f"WARNING: Failed to download license for {req}") continue - parse_target = ( - "Disabling PEP 517 processing is invalid: project specifies a build " - "backend of {backend} in pyproject.toml" - ) - target = parse.parse(parse_target, e.result.stderr.strip()) - backend = target.named.get("backend") - if backend is not None: - if "." in backend: - backend, _, _ = backend.partition(".") - ctx.run(f"pip install {backend}") + else: + parse_target = ( + "Disabling PEP 517 processing is invalid: project specifies a build " + "backend of {backend} in pyproject.toml" + ) + target = parse.parse(parse_target, e.result.stderr.strip()) + backend = target.named.get("backend") + if backend is not None: + if "." in backend: + backend, _, _ = backend.partition(".") + ctx.run(f"pip install {backend}") ctx.run(f"{cmd} --no-build-isolation -d {tmp_dir.as_posix()} {req}") + for sdist in tmp_dir.iterdir(): extract_license(vendor_dir, sdist) drop_dir(tmp_dir)