mirror of
https://github.com/enpaul/tox-poetry-installer.git
synced 2024-10-29 19:47:00 +00:00
Basic changes to support poetry 1.2.0b2, no longer support Poetry 1.1.x
This commit is contained in:
parent
17885b50f7
commit
b54bf44dc5
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
See also: [Github Release Page](https://github.com/enpaul/tox-poetry-installer/releases).
|
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
|
## Version 0.8.5
|
||||||
|
|
||||||
View this release on:
|
View this release on:
|
||||||
|
848
poetry.lock
generated
848
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "tox-poetry-installer"
|
name = "tox-poetry-installer"
|
||||||
version = "0.8.5"
|
version = "1.0a1"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
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"
|
description = "A plugin for Tox that lets you install test environment dependencies from the Poetry lockfile"
|
||||||
@ -23,7 +23,6 @@ classifiers = [
|
|||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
@ -35,17 +34,18 @@ classifiers = [
|
|||||||
poetry_installer = "tox_poetry_installer"
|
poetry_installer = "tox_poetry_installer"
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
poetry = ["poetry"]
|
poetry = ["poetry", "cleo"]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.6.1"
|
python = "^3.7"
|
||||||
poetry = {version = ">=1.0.0,<1.2", optional = true}
|
cleo = {version = "^1.0.0a5", optional = true, allow-prereleases = true}
|
||||||
poetry-core = "^1.0.0"
|
poetry = {version = "1.2.0b2", optional = true, allow-prereleases = true}
|
||||||
|
poetry-core = {version = "1.1.0b2", allow-prereleases = true}
|
||||||
tox = "^3.8.0"
|
tox = "^3.8.0"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
bandit = "^1.6.2"
|
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" }
|
blacken-docs = { version = "^1.8.0", python = "^3.7" }
|
||||||
ipython = { version = "^7.18.1", python = "^3.7" }
|
ipython = { version = "^7.18.1", python = "^3.7" }
|
||||||
mdformat = "^0.6"
|
mdformat = "^0.6"
|
||||||
@ -63,5 +63,5 @@ tox = "^3.20.0"
|
|||||||
types-toml = "^0.10.1"
|
types-toml = "^0.10.1"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.1.0b2"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
@ -7,7 +7,7 @@ import poetry.installation.pip_installer
|
|||||||
import poetry.utils.env
|
import poetry.utils.env
|
||||||
import pytest
|
import pytest
|
||||||
import tox
|
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
|
from tox_poetry_installer import utilities
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ def test_deduplication(mock_venv, mock_poetry_factory):
|
|||||||
"""Test that the installer does not install duplicate dependencies"""
|
"""Test that the installer does not install duplicate dependencies"""
|
||||||
poetry = Factory().create_poetry(None)
|
poetry = Factory().create_poetry(None)
|
||||||
packages: utilities.PackageMap = {
|
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()
|
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"""
|
"""Test that behavior is consistent between parallel and non-parallel usage"""
|
||||||
poetry = Factory().create_poetry(None)
|
poetry = Factory().create_poetry(None)
|
||||||
packages: utilities.PackageMap = {
|
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 = [
|
to_install = [
|
||||||
|
6
tox.ini
6
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py36, py37, py38, py39, py310, static, static-tests, security
|
envlist = py37, py38, py39, py310, static, static-tests, security
|
||||||
isolated_build = true
|
isolated_build = true
|
||||||
skip_missing_interpreters = true
|
skip_missing_interpreters = true
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ commands =
|
|||||||
|
|
||||||
[testenv:static]
|
[testenv:static]
|
||||||
description = Static formatting and quality enforcement
|
description = Static formatting and quality enforcement
|
||||||
basepython = python3.8
|
basepython = python3.10
|
||||||
platform = linux
|
platform = linux
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
locked_deps =
|
locked_deps =
|
||||||
@ -46,7 +46,7 @@ commands =
|
|||||||
|
|
||||||
[testenv:static-tests]
|
[testenv:static-tests]
|
||||||
description = Static formatting and quality enforcement for the tests
|
description = Static formatting and quality enforcement for the tests
|
||||||
basepython = python3.8
|
basepython = python3.10
|
||||||
platform = linux
|
platform = linux
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
locked_deps =
|
locked_deps =
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# pylint: disable=missing-docstring
|
# pylint: disable=missing-docstring
|
||||||
__title__ = "tox-poetry-installer"
|
__title__ = "tox-poetry-installer"
|
||||||
__summary__ = "A plugin for Tox that lets you install test environment dependencies from the Poetry lockfile"
|
__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/"
|
__url__ = "https://github.com/enpaul/tox-poetry-installer/"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
||||||
|
@ -28,9 +28,9 @@ from tox_poetry_installer import exceptions
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
from cleo.io.null_io import NullIO
|
||||||
from poetry.factory import Factory
|
from poetry.factory import Factory
|
||||||
from poetry.installation.pip_installer import PipInstaller
|
from poetry.installation.pip_installer import PipInstaller
|
||||||
from poetry.io.null_io import NullIO
|
|
||||||
from poetry.poetry import Poetry
|
from poetry.poetry import Poetry
|
||||||
from poetry.utils.env import VirtualEnv
|
from poetry.utils.env import VirtualEnv
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -20,7 +20,7 @@ PEP508_VERSION_DELIMITERS: Tuple[str, ...] = ("~=", "==", "!=", ">", "<")
|
|||||||
REPORTER_PREFIX: str = f"{__about__.__title__}:"
|
REPORTER_PREFIX: str = f"{__about__.__title__}:"
|
||||||
|
|
||||||
# Internal list of packages that poetry has deemed unsafe and are excluded from the lockfile
|
# 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
|
# Number of threads to use for installing dependencies by default
|
||||||
DEFAULT_INSTALL_THREADS: int = 10
|
DEFAULT_INSTALL_THREADS: int = 10
|
||||||
|
@ -9,7 +9,7 @@ from datetime import datetime
|
|||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
from typing import Set
|
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.venv import VirtualEnv as ToxVirtualEnv
|
||||||
|
|
||||||
from tox_poetry_installer import logger
|
from tox_poetry_installer import logger
|
||||||
|
@ -10,8 +10,8 @@ from typing import List
|
|||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
from typing import Set
|
from typing import Set
|
||||||
|
|
||||||
from poetry.core.packages import Dependency as PoetryDependency
|
from poetry.core.packages.dependency import Dependency as PoetryDependency
|
||||||
from poetry.core.packages import Package as PoetryPackage
|
from poetry.core.packages.package import Package as PoetryPackage
|
||||||
from tox.action import Action as ToxAction
|
from tox.action import Action as ToxAction
|
||||||
from tox.venv import VirtualEnv as ToxVirtualEnv
|
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
|
:returns: Mapping of package names to Poetry package objects
|
||||||
"""
|
"""
|
||||||
packages = collections.defaultdict(list)
|
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)
|
packages[package.name].append(package)
|
||||||
|
|
||||||
return packages
|
return packages
|
||||||
|
Loading…
Reference in New Issue
Block a user