From a7cde7a9aba9f2d96a9cc63b1dd29c29bc6c2937 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Thu, 12 Nov 2020 19:38:48 -0500 Subject: [PATCH 1/3] Fix missing exception docs --- tox_poetry_installer/exceptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tox_poetry_installer/exceptions.py b/tox_poetry_installer/exceptions.py index 4ecd9b8..86102fd 100644 --- a/tox_poetry_installer/exceptions.py +++ b/tox_poetry_installer/exceptions.py @@ -8,6 +8,7 @@ All exceptions should inherit from the common base exception :exc:`ToxPoetryInst +-- LockedDepVersionConflictError +-- LockedDepNotFoundError +-- ExtraNotFoundError + +-- LockedDepsRequiredError """ From 1f102b16cb852bfeb654da32f502724fdfd2ed2f Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Thu, 12 Nov 2020 19:39:22 -0500 Subject: [PATCH 2/3] Add blocking functionality when using require_locked_deps When require_locked_deps is true further processing will be blocked because a non-null value is returned by this function --- tox_poetry_installer/hooks.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tox_poetry_installer/hooks.py b/tox_poetry_installer/hooks.py index 1cf495f..1ffb266 100644 --- a/tox_poetry_installer/hooks.py +++ b/tox_poetry_installer/hooks.py @@ -5,6 +5,7 @@ specifically related to implementing the hooks (to keep the size/readability of themselves manageable). """ from typing import List +from typing import Optional from poetry.core.packages import Package as PoetryPackage from poetry.factory import Factory as PoetryFactory @@ -51,7 +52,7 @@ def tox_addoption(parser: ToxParser): @hookimpl -def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction): +def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction) -> Optional[bool]: """Install the dependencies for the current environment Loads the local Poetry environment and the corresponding lockfile then pulls the dependencies @@ -69,7 +70,7 @@ def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction): reporter.verbosity1( f"{constants.REPORTER_PREFIX} skipping isolated build env '{action.name}'" ) - return + return None try: poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir) @@ -82,7 +83,7 @@ def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction): reporter.verbosity1( f"{constants.REPORTER_PREFIX} project does not use Poetry for env management, skipping installation of locked dependencies" ) - return + return None reporter.verbosity1( f"{constants.REPORTER_PREFIX} loaded project pyproject.toml from {poetry.file}" @@ -107,16 +108,18 @@ def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction): reporter.verbosity1( f"{constants.REPORTER_PREFIX} env specifies 'skip_install = true', skipping installation of project package" ) - return + return venv.envconfig.require_locked_deps or None if venv.envconfig.config.skipsdist: reporter.verbosity1( f"{constants.REPORTER_PREFIX} config specifies 'skipsdist = true', skipping installation of project package" ) - return + return venv.envconfig.require_locked_deps or None _install_project_dependencies(venv, poetry, package_map) + return venv.envconfig.require_locked_deps or None + def _install_env_dependencies( venv: ToxVirtualEnv, poetry: Poetry, packages: PackageMap From df8312f5ee854c249b17b932f196814b4b0377a1 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Thu, 12 Nov 2020 19:40:21 -0500 Subject: [PATCH 3/3] Bump feature version --- pyproject.toml | 2 +- tox_poetry_installer/__about__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 72f3327..02e9b3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tox-poetry-installer" -version = "0.4.0" +version = "0.5.0" license = "MIT" authors = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"] description = "Tox plugin to install Tox environment dependencies using the Poetry backend and lockfile" diff --git a/tox_poetry_installer/__about__.py b/tox_poetry_installer/__about__.py index 3211a6c..a665383 100644 --- a/tox_poetry_installer/__about__.py +++ b/tox_poetry_installer/__about__.py @@ -1,7 +1,7 @@ # pylint: disable=missing-docstring __title__ = "tox-poetry-installer" __summary__ = "Tox plugin to install Tox environment dependencies using the Poetry backend and lockfile" -__version__ = "0.4.0" +__version__ = "0.5.0" __url__ = "https://github.com/enpaul/tox-poetry-installer/" __license__ = "MIT" __authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]