From e8d3f4fcacb111bee027dc8f390f14e097b1f78f Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Sat, 24 Oct 2020 11:07:16 -0400 Subject: [PATCH] Fix support for non-single extra dependency installation --- tox_poetry_installer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tox_poetry_installer.py b/tox_poetry_installer.py index f13ce9c..efd7880 100644 --- a/tox_poetry_installer.py +++ b/tox_poetry_installer.py @@ -233,7 +233,7 @@ def _install_env_dependencies( raise err reporter.verbosity1( - f"{_REPORTER_PREFIX} identified {len(dependencies)} total dependencies from {len(venv.envconfig.deps)} env dependencies" + f"{_REPORTER_PREFIX} identified {len(dependencies)} total dependencies from {len(env_deps.locked_deps)} locked env dependencies" ) reporter.verbosity1( @@ -262,13 +262,16 @@ def _install_project_dependencies( f"{_REPORTER_PREFIX} performing installation of project dependencies" ) - base_dependencies = [ - packages[item.name] for item in poetry.package.requires if not item.is_optional + base_dependencies: List[PoetryPackage] = [ + packages[item.name] + for item in poetry.package.requires + if not item.is_optional() ] + extra_dependencies: List[PoetryPackage] = [] for extra in venv.envconfig.extras: try: - extra_dependencies = [ + extra_dependencies += [ packages[item.name] for item in poetry.package.extras[extra] ] except KeyError: