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
No known key found for this signature in database
GPG Key ID: E319AAE24BE41C3B
11 changed files with 552 additions and 348 deletions

View File

@ -2,6 +2,16 @@
See also: [Github Release Page](https://github.com/enpaul/tox-poetry-installer/releases).
## Version 1.0a1
View this release on:
[Github](https://github.com/enpaul/tox-poetry-installer/releases/tag/1.0a1),
[PyPI](https://pypi.org/project/tox-poetry-installer/1.0a1/)
- Drop python3.6 support, since Poetry 1.2 dropped py3.6 support
- Support Poetry==1.2.0b2 (prerelease)
- Added direct dep on cleo (prerelease) to support passing in NullIO to poetry functions
## Version 0.8.5
View this release on:

848
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "tox-poetry-installer"
version = "0.8.5"
version = "1.0a1"
license = "MIT"
authors = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
description = "A plugin for Tox that lets you install test environment dependencies from the Poetry lockfile"
@ -23,7 +23,6 @@ classifiers = [
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
@ -35,17 +34,18 @@ classifiers = [
poetry_installer = "tox_poetry_installer"
[tool.poetry.extras]
poetry = ["poetry"]
poetry = ["poetry", "cleo"]
[tool.poetry.dependencies]
python = "^3.6.1"
poetry = {version = ">=1.0.0,<1.2", optional = true}
poetry-core = "^1.0.0"
python = "^3.7"
cleo = {version = "^1.0.0a5", optional = true, allow-prereleases = true}
poetry = {version = "1.2.0b2", optional = true, allow-prereleases = true}
poetry-core = {version = "1.1.0b2", allow-prereleases = true}
tox = "^3.8.0"
[tool.poetry.dev-dependencies]
bandit = "^1.6.2"
black = { version = "^21.12b0", allow-prereleases = true, python = "^3.7" }
black = "^22.3.0"
blacken-docs = { version = "^1.8.0", python = "^3.7" }
ipython = { version = "^7.18.1", python = "^3.7" }
mdformat = "^0.6"
@ -63,5 +63,5 @@ tox = "^3.20.0"
types-toml = "^0.10.1"
[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=1.1.0b2"]
build-backend = "poetry.core.masonry.api"

View File

@ -7,7 +7,7 @@ import poetry.installation.pip_installer
import poetry.utils.env
import pytest
import tox
from poetry.core.packages import Package as PoetryPackage
from poetry.core.packages.package import Package as PoetryPackage
from tox_poetry_installer import utilities

View File

@ -14,7 +14,7 @@ def test_deduplication(mock_venv, mock_poetry_factory):
"""Test that the installer does not install duplicate dependencies"""
poetry = Factory().create_poetry(None)
packages: utilities.PackageMap = {
item.name: item for item in poetry.locker.locked_repository(False).packages
item.name: item for item in poetry.locker.locked_repository().packages
}
venv = tox.venv.VirtualEnv()
@ -29,7 +29,7 @@ def test_parallelization(mock_venv, mock_poetry_factory):
"""Test that behavior is consistent between parallel and non-parallel usage"""
poetry = Factory().create_poetry(None)
packages: utilities.PackageMap = {
item.name: item for item in poetry.locker.locked_repository(False).packages
item.name: item for item in poetry.locker.locked_repository().packages
}
to_install = [

View File

@ -1,5 +1,5 @@
[tox]
envlist = py36, py37, py38, py39, py310, static, static-tests, security
envlist = py37, py38, py39, py310, static, static-tests, security
isolated_build = true
skip_missing_interpreters = true
@ -21,7 +21,7 @@ commands =
[testenv:static]
description = Static formatting and quality enforcement
basepython = python3.8
basepython = python3.10
platform = linux
ignore_errors = true
locked_deps =
@ -46,7 +46,7 @@ commands =
[testenv:static-tests]
description = Static formatting and quality enforcement for the tests
basepython = python3.8
basepython = python3.10
platform = linux
ignore_errors = true
locked_deps =

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