2020-11-12 02:26:59 +00:00
|
|
|
"""Custom plugin exceptions
|
|
|
|
|
|
|
|
All exceptions should inherit from the common base exception :exc:`ToxPoetryInstallerException`.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
ToxPoetryInstallerException
|
2020-11-13 03:14:49 +00:00
|
|
|
+-- SkipEnvironment
|
2020-12-05 00:25:40 +00:00
|
|
|
| +-- PoetryNotInstalledError
|
2020-11-12 02:26:59 +00:00
|
|
|
+-- LockedDepVersionConflictError
|
|
|
|
+-- LockedDepNotFoundError
|
|
|
|
+-- ExtraNotFoundError
|
2020-11-13 00:38:48 +00:00
|
|
|
+-- LockedDepsRequiredError
|
2021-10-29 00:09:56 +00:00
|
|
|
+-- RequiresUnsafeDepError
|
2020-11-12 02:26:59 +00:00
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
class ToxPoetryInstallerException(Exception):
|
|
|
|
"""Error while installing locked dependencies to the test environment"""
|
|
|
|
|
|
|
|
|
2020-11-13 03:14:49 +00:00
|
|
|
class SkipEnvironment(ToxPoetryInstallerException):
|
|
|
|
"""Current environment does not meet preconditions and should be skipped by the plugin"""
|
|
|
|
|
|
|
|
|
2020-12-05 00:25:40 +00:00
|
|
|
class PoetryNotInstalledError(SkipEnvironment):
|
|
|
|
"""No version of Poetry could be imported from the current Python environment"""
|
|
|
|
|
|
|
|
|
2020-11-12 02:26:59 +00:00
|
|
|
class LockedDepVersionConflictError(ToxPoetryInstallerException):
|
|
|
|
"""Locked dependencies cannot specify an alternate version for installation"""
|
|
|
|
|
|
|
|
|
|
|
|
class LockedDepNotFoundError(ToxPoetryInstallerException):
|
|
|
|
"""Locked dependency was not found in the lockfile"""
|
|
|
|
|
|
|
|
|
|
|
|
class ExtraNotFoundError(ToxPoetryInstallerException):
|
|
|
|
"""Project package extra not defined in project's pyproject.toml"""
|
2020-11-12 05:24:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
class LockedDepsRequiredError(ToxPoetryInstallerException):
|
|
|
|
"""Environment cannot specify unlocked dependencies when locked dependencies are required"""
|
2021-10-29 00:09:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RequiresUnsafeDepError(ToxPoetryInstallerException):
|
|
|
|
"""Package under test depends on an unsafe dependency and cannot be installed"""
|