mirror of
https://github.com/enpaul/tox-poetry-installer.git
synced 2025-09-18 03:13:25 +00:00
Move install function to dedicated submodule
Fix duplicate package installs caused by using list for ordering
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import sys
|
||||
import typing
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from typing import Sequence
|
||||
from typing import Set
|
||||
@@ -22,32 +21,6 @@ if typing.TYPE_CHECKING:
|
||||
from tox_poetry_installer import _poetry
|
||||
|
||||
|
||||
def install_to_venv(
|
||||
poetry: "_poetry.Poetry", venv: ToxVirtualEnv, packages: Sequence[PoetryPackage]
|
||||
):
|
||||
"""Install a bunch of packages to a virtualenv
|
||||
|
||||
:param poetry: Poetry object the packages were sourced from
|
||||
:param venv: Tox virtual environment to install the packages to
|
||||
:param packages: List of packages to install to the virtual environment
|
||||
"""
|
||||
from tox_poetry_installer import _poetry
|
||||
|
||||
tox.reporter.verbosity1(
|
||||
f"{constants.REPORTER_PREFIX} Installing {len(packages)} packages to environment at {venv.envconfig.envdir}"
|
||||
)
|
||||
|
||||
installer = _poetry.PipInstaller(
|
||||
env=_poetry.VirtualEnv(path=Path(venv.envconfig.envdir)),
|
||||
io=_poetry.NullIO(),
|
||||
pool=poetry.pool,
|
||||
)
|
||||
|
||||
for dependency in packages:
|
||||
tox.reporter.verbosity1(f"{constants.REPORTER_PREFIX} Installing {dependency}")
|
||||
installer.install(dependency)
|
||||
|
||||
|
||||
def identify_transients(
|
||||
packages: PackageMap, dependency_name: str, allow_missing: Sequence[str] = ()
|
||||
) -> List[PoetryPackage]:
|
||||
|
Reference in New Issue
Block a user