mirror of
https://github.com/enpaul/tox-poetry-installer.git
synced 2024-10-29 19:47:00 +00:00
Update transient processing to more narrowly scope error catching
This commit is contained in:
parent
ff344c2b4b
commit
c5c5261a80
@ -62,12 +62,10 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac
|
||||
"""
|
||||
from tox_poetry_installer import _poetry
|
||||
|
||||
try:
|
||||
|
||||
def find_deps_of_deps(name: str, searched: Set[str]) -> PackageMap:
|
||||
package = packages[name]
|
||||
transients: PackageMap = {}
|
||||
searched.update([name])
|
||||
searched.add(name)
|
||||
|
||||
if name in _poetry.Provider.UNSAFE_PACKAGES:
|
||||
reporter.warning(
|
||||
@ -94,11 +92,11 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac
|
||||
return transients
|
||||
|
||||
searched: Set[str] = set()
|
||||
|
||||
try:
|
||||
transients: PackageMap = find_deps_of_deps(
|
||||
packages[dependency_name].name, searched
|
||||
)
|
||||
|
||||
return set(transients.values())
|
||||
except KeyError:
|
||||
if any(
|
||||
delimiter in dependency_name
|
||||
@ -111,6 +109,8 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac
|
||||
f"No version of locked dependency '{dependency_name}' found in the project lockfile"
|
||||
) from None
|
||||
|
||||
return set(transients.values())
|
||||
|
||||
|
||||
def check_preconditions(venv: ToxVirtualEnv, action: ToxAction) -> "_poetry.Poetry":
|
||||
"""Check that the local project environment meets expectations"""
|
||||
|
Loading…
Reference in New Issue
Block a user