Update unsafe packages set to use internal constant

One less thing that ties us to poetry proper
This commit is contained in:
Ethan Paul 2021-04-16 20:20:32 -04:00
parent 17a1ff1bc0
commit 4d2c2e6297
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF
3 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,6 @@ try:
from poetry.installation.pip_installer import PipInstaller
from poetry.io.null_io import NullIO
from poetry.poetry import Poetry
from poetry.puzzle.provider import Provider
from poetry.utils.env import VirtualEnv
except ImportError:
raise exceptions.PoetryNotInstalledError(

View File

@ -5,6 +5,7 @@ in this module.
All constants should be type hinted.
"""
from typing import Set
from typing import Tuple
from tox_poetry_installer import __about__
@ -17,3 +18,6 @@ PEP508_VERSION_DELIMITERS: Tuple[str, ...] = ("~=", "==", "!=", ">", "<")
# Prefix all reporter messages should include to indicate that they came from this module in the
# console output.
REPORTER_PREFIX: str = f"{__about__.__title__}:"
# Internal list of packages that poetry has deemed unsafe and are excluded from the lockfile
UNSAFE_PACKAGES: Set[str] = {"distribute", "pip", "setuptools", "wheel"}

View File

@ -89,8 +89,6 @@ def identify_transients(
.. note:: The package corresponding to the dependency specified by the ``dep`` parameter will
be included in the returned list of packages.
"""
from tox_poetry_installer import _poetry
transients: List[PoetryPackage] = []
searched: Set[str] = set()
@ -114,7 +112,7 @@ def identify_transients(
except KeyError as err:
dep_name = err.args[0]
if dep_name in _poetry.Provider.UNSAFE_PACKAGES:
if dep_name in constants.UNSAFE_PACKAGES:
logger.warning(
f"Installing package '{dep_name}' using Poetry is not supported and will be skipped"
)