mirror of
https://github.com/enpaul/tox-poetry-installer.git
synced 2024-12-05 01:40:44 +00:00
Fix error when package under test depends directly on unsafe dependencies
Fixes #65
This commit is contained in:
parent
c322e68371
commit
1f6550e77c
@ -11,6 +11,7 @@ All exceptions should inherit from the common base exception :exc:`ToxPoetryInst
|
||||
+-- LockedDepNotFoundError
|
||||
+-- ExtraNotFoundError
|
||||
+-- LockedDepsRequiredError
|
||||
+-- RequiresUnsafeDepError
|
||||
|
||||
"""
|
||||
|
||||
@ -41,3 +42,7 @@ class ExtraNotFoundError(ToxPoetryInstallerException):
|
||||
|
||||
class LockedDepsRequiredError(ToxPoetryInstallerException):
|
||||
"""Environment cannot specify unlocked dependencies when locked dependencies are required"""
|
||||
|
||||
|
||||
class RequiresUnsafeDepError(ToxPoetryInstallerException):
|
||||
"""Package under test depends on an unsafe dependency and cannot be installed"""
|
||||
|
@ -166,6 +166,11 @@ def find_project_deps(
|
||||
:param extras: Sequence of extra names to include the dependencies of
|
||||
"""
|
||||
|
||||
if any(dep.name in constants.UNSAFE_PACKAGES for dep in poetry.package.requires):
|
||||
raise exceptions.RequiresUnsafeDepError(
|
||||
f"Project package requires one or more unsafe dependencies ({', '.join(constants.UNSAFE_PACKAGES)}) which cannot be installed with Poetry"
|
||||
)
|
||||
|
||||
base_deps: List[PoetryPackage] = [
|
||||
packages[item.name]
|
||||
for item in poetry.package.requires
|
||||
|
Loading…
Reference in New Issue
Block a user