[FIX] use virtualenv command instead of cli

This commit is contained in:
Sylvain LE GAL 2022-03-28 20:55:01 +02:00
parent c069757168
commit 613eeb9d93
4 changed files with 11 additions and 13 deletions

View File

@ -36,8 +36,6 @@ pylint:
script:
- source .venv/bin/activate
- pylint --version
# - pylint --disable fixme ociedoo
# - pylint --disable fixme tests
pytest:
stage: tests

View File

@ -1,6 +1,5 @@
import argparse
import os
import subprocess
from git_aggregator import main as gitaggregate_cmd
from git_aggregator.utils import working_directory_keeper
@ -8,6 +7,7 @@ from jinja2 import Template
from loguru import logger
from plumbum import local
from plumbum.cmd import mkdir
from virtualenv.run import cli_run as virtualenv_cmd
def ensure_folder_exists(folder_path, mode=False):
@ -72,11 +72,10 @@ def create_virtualenv(folder_path, python_version):
Create a virtual env named ``env`` in the ``folder_path`` folder
with the given ``python_version``.
"""
with local.cwd(folder_path):
logger.info(
"Create Virtual Env in %s with version %s"
% (folder_path, python_version)
)
subprocess.check_output(
["virtualenv", "env", "--python", python_version]
)
virtualenv_cmd(["env", "--python", python_version])

14
poetry.lock generated
View File

@ -134,7 +134,7 @@ toml = ["tomli"]
name = "distlib"
version = "0.3.4"
description = "Distribution utilities"
category = "dev"
category = "main"
optional = false
python-versions = "*"
@ -158,7 +158,7 @@ pipenv = ["pipenv"]
name = "filelock"
version = "3.4.1"
description = "A platform independent file lock."
category = "dev"
category = "main"
optional = false
python-versions = ">=3.6"
@ -223,7 +223,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
name = "importlib-resources"
version = "5.4.0"
description = "Read resources from Python packages"
category = "dev"
category = "main"
optional = false
python-versions = ">=3.6"
@ -346,7 +346,7 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5"
name = "platformdirs"
version = "2.4.0"
description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
category = "dev"
category = "main"
optional = false
python-versions = ">=3.6"
@ -557,7 +557,7 @@ importlib_metadata = {version = ">=3.0,<5", markers = "python_version < \"3.8\""
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
category = "dev"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
@ -651,7 +651,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
name = "virtualenv"
version = "20.14.0"
description = "Virtual Python Environment builder"
category = "dev"
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
@ -701,7 +701,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes
[metadata]
lock-version = "1.1"
python-versions = "^3.6"
content-hash = "cff9b335836283e1c1f9185ba1b575de62e19d3d6409257a03836f9a8cfaaaf5"
content-hash = "fbd32c0469f499827b4fd98ab355e0a83cf9c53606a59eb545b47f5029364d74"
[metadata.files]
aiocontextvars = [

View File

@ -31,6 +31,7 @@ loguru = "^0.6"
plumbum = "^1.7"
single-source = "^0.3"
git-aggregator = "^2.1"
virtualenv = "^20.14"
pyyaml = "5.4.1"
[tool.poetry.dev-dependencies]