Update dependency identification to account for multiple platforms

Fix an issue where packages that had two or more exclusive ranges for different python
versions would only be represented by the sequentially last version to appear in the
lockfile, causing compatibility issues with the older versions of that package.

Fixes #68
This commit is contained in:
2022-04-07 00:03:47 -04:00
parent f08a18728e
commit fb65fa812e
3 changed files with 68 additions and 55 deletions

View File

@@ -17,7 +17,6 @@ from tox_poetry_installer import exceptions
from tox_poetry_installer import installer
from tox_poetry_installer import logger
from tox_poetry_installer import utilities
from tox_poetry_installer.datatypes import PackageMap
def _postprocess_install_project_deps(
@@ -186,10 +185,7 @@ def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction) -> Optional
f"Unlocked dependencies '{venv.envconfig.deps}' specified for environment '{venv.name}' which requires locked dependencies"
)
packages: PackageMap = {
package.name: package
for package in poetry.locker.locked_repository(True).packages
}
packages = utilities.build_package_map(poetry)
if venv.envconfig.install_dev_deps:
dev_deps = utilities.find_dev_deps(packages, virtualenv, poetry)