Basic changes to support poetry 1.2.0b2, no longer support Poetry 1.1.x

This commit is contained in:
Justin Wood
2022-07-01 22:08:11 -04:00
committed by Justin Wood
parent 17885b50f7
commit b54bf44dc5
11 changed files with 552 additions and 348 deletions

View File

@@ -1,7 +1,7 @@
# pylint: disable=missing-docstring
__title__ = "tox-poetry-installer"
__summary__ = "A plugin for Tox that lets you install test environment dependencies from the Poetry lockfile"
__version__ = "0.8.5"
__version__ = "1.0a1"
__url__ = "https://github.com/enpaul/tox-poetry-installer/"
__license__ = "MIT"
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]

View File

@@ -28,9 +28,9 @@ from tox_poetry_installer import exceptions
try:
from cleo.io.null_io import NullIO
from poetry.factory import Factory
from poetry.installation.pip_installer import PipInstaller
from poetry.io.null_io import NullIO
from poetry.poetry import Poetry
from poetry.utils.env import VirtualEnv
except ImportError:

View File

@@ -20,7 +20,7 @@ PEP508_VERSION_DELIMITERS: Tuple[str, ...] = ("~=", "==", "!=", ">", "<")
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"}
UNSAFE_PACKAGES: Set[str] = set()
# Number of threads to use for installing dependencies by default
DEFAULT_INSTALL_THREADS: int = 10

View File

@@ -9,7 +9,7 @@ from datetime import datetime
from typing import Sequence
from typing import Set
from poetry.core.packages import Package as PoetryPackage
from poetry.core.packages.package import Package as PoetryPackage
from tox.venv import VirtualEnv as ToxVirtualEnv
from tox_poetry_installer import logger

View File

@@ -10,8 +10,8 @@ from typing import List
from typing import Sequence
from typing import Set
from poetry.core.packages import Dependency as PoetryDependency
from poetry.core.packages import Package as PoetryPackage
from poetry.core.packages.dependency import Dependency as PoetryDependency
from poetry.core.packages.package import Package as PoetryPackage
from tox.action import Action as ToxAction
from tox.venv import VirtualEnv as ToxVirtualEnv
@@ -92,7 +92,7 @@ def build_package_map(poetry: "_poetry.Poetry") -> PackageMap:
:returns: Mapping of package names to Poetry package objects
"""
packages = collections.defaultdict(list)
for package in poetry.locker.locked_repository(True).packages:
for package in poetry.locker.locked_repository().packages:
packages[package.name].append(package)
return packages