From f116ffefa2dab5919f960c271284c4c98474bc40 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Wed, 16 Dec 2020 20:31:41 -0500 Subject: [PATCH] Fix special handling of unsafe dependencies as primary dependencies --- tox_poetry_installer/utilities.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tox_poetry_installer/utilities.py b/tox_poetry_installer/utilities.py index 88bcae9..d2d84c9 100644 --- a/tox_poetry_installer/utilities.py +++ b/tox_poetry_installer/utilities.py @@ -67,7 +67,7 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac if name in _poetry.Provider.UNSAFE_PACKAGES: reporter.warning( - f"{constants.REPORTER_PREFIX} Installing package '{name}' using Poetry is not supported; skipping installation of package '{name}'" + f"{constants.REPORTER_PREFIX} Installing package '{name}' using Poetry is not supported and will be skipped" ) reporter.verbosity2( f"{constants.REPORTER_PREFIX} Skip {name}: designated unsafe by Poetry" @@ -110,6 +110,12 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac packages[dependency_name].name, searched ) except KeyError: + if dependency_name in _poetry.Provider.UNSAFE_PACKAGES: + reporter.warning( + f"{constants.REPORTER_PREFIX} Installing package '{dependency_name}' using Poetry is not supported and will be skipped" + ) + return set() + if any( delimiter in dependency_name for delimiter in constants.PEP508_VERSION_DELIMITERS @@ -117,6 +123,7 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac raise exceptions.LockedDepVersionConflictError( f"Locked dependency '{dependency_name}' cannot include version specifier" ) from None + raise exceptions.LockedDepNotFoundError( f"No version of locked dependency '{dependency_name}' found in the project lockfile" ) from None