Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions tests/_data/infiles/environment/editable-self/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import dirname, join
from subprocess import check_call # nosec:B404
from sys import executable
from sys import executable, stderr
from venv import EnvBuilder

__all__ = ['main']
Expand All @@ -33,13 +33,11 @@

def pip_install(*args: str) -> None:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
'install', '--require-virtualenv', '--no-input', '--progress-bar=off', '--no-color',
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
'install', '--require-virtualenv', '--no-input', '--progress-bar=off', '--no-color',
*args)
print('+ ', *call, file=stderr)
check_call(call, cwd=this_dir, shell=False) # nosec:B603


Expand Down
14 changes: 6 additions & 8 deletions tests/_data/infiles/environment/local/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import abspath, dirname, join
from subprocess import check_call # nosec:B404
from sys import executable
from sys import executable, stderr
from venv import EnvBuilder

__all__ = ['main']
Expand All @@ -35,13 +35,11 @@

def pip_install(*args: str) -> None:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
'install', '--require-virtualenv', '--no-input', '--progress-bar=off', '--no-color',
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
'install', '--require-virtualenv', '--no-input', '--progress-bar=off', '--no-color',
*args)
print('+ ', *call, file=stderr)
check_call(call, cwd=this_dir, shell=False) # nosec:B603


Expand Down
14 changes: 6 additions & 8 deletions tests/_data/infiles/environment/normalize-packagename/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import dirname, join
from subprocess import PIPE, CompletedProcess, run # nosec:B404
from sys import argv, executable
from sys import argv, executable, stderr
from typing import Any
from venv import EnvBuilder

Expand All @@ -35,12 +35,10 @@

def pip_run(*args: str, **kwargs: Any) -> CompletedProcess:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
*args)
print('+ ', *call, file=stderr)
res = run(call, **kwargs, cwd=this_dir, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand All @@ -66,7 +64,7 @@ def main() -> None:
'--no-deps', # the clib dep cannot be installed consistently...
# https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization
'ruamel-YAML[jinja2]', # actually "ruamel.yaml", normalizes to "ruamel-yaml"
'ruamel-Yaml.Jinja2', # actually "ruamel.yaml.jinja2", normalizes to "ruamel-yaml-jinja2"
'ruamel-Yaml.Jinja2', # actually "ruamel.yaml.jinja2", normalizes to "ruamel-yaml-jinja2"
)


Expand Down
10 changes: 4 additions & 6 deletions tests/_data/infiles/environment/private-packages/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@

def pip_run(*args: str) -> CompletedProcess:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
*args)
print('+ ', *call, file=stderr)
res = run(call, cwd=this_dir, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
10 changes: 4 additions & 6 deletions tests/_data/infiles/environment/via-pdm/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from os.path import dirname, join
from shutil import rmtree
from subprocess import CompletedProcess, run # nosec:B404
from sys import executable
from sys import executable, stderr

__all__ = ['main']

Expand All @@ -37,11 +37,9 @@

def pdm_run(*args: str) -> CompletedProcess:
# PDM is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pdm',
*args
)
print('+ ', *call)
call = (executable, '-m', 'pdm',
*args)
print('+ ', *call, file=stderr)
res = run(call, cwd=this_dir, env=pdm_env, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
10 changes: 4 additions & 6 deletions tests/_data/infiles/environment/via-pipenv/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from os.path import dirname, join
from shutil import rmtree
from subprocess import CompletedProcess, run # nosec:B404
from sys import executable
from sys import executable, stderr
from typing import Any

__all__ = ['main']
Expand All @@ -40,11 +40,9 @@

def pipenv_run(*args: str) -> CompletedProcess:
# pipenv is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pipenv',
*args
)
print('+ ', *call)
call = (executable, '-m', 'pipenv',
*args)
print('+ ', *call, file=stderr)
res = run(call, cwd=this_dir, env=pipenv_env, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
11 changes: 4 additions & 7 deletions tests/_data/infiles/environment/via-poetry/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,21 @@
from os import environ
from os.path import dirname
from subprocess import CompletedProcess, run # nosec:B404
from sys import executable
from sys import executable, stderr

__all__ = ['main']

this_dir = dirname(__file__)


poetry_env = environ.copy()
poetry_env['VIRTUAL_ENV'] = ''


def poetry_run(*args: str) -> CompletedProcess:
# Poetry is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'poetry',
*args
)
print('+ ', *call)
call = (executable, '-m', 'poetry',
*args)
print('+ ', *call, file=stderr)
res = run(call, cwd=this_dir, env=poetry_env, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
10 changes: 4 additions & 6 deletions tests/_data/infiles/environment/via-uv/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from os.path import dirname, join
from shutil import rmtree
from subprocess import CompletedProcess, run # nosec:B404
from sys import executable
from sys import executable, stderr

__all__ = ['main']

Expand All @@ -37,11 +37,9 @@

def uv_run(*args: str) -> CompletedProcess:
# uv is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'uv',
*args
)
print('+ ', *call)
call = (executable, '-m', 'uv',
*args)
print('+ ', *call, file=stderr)
res = run(call, cwd=this_dir, env=uv_env, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
12 changes: 5 additions & 7 deletions tests/_data/infiles/environment/with-extras/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import dirname, isdir, join
from subprocess import PIPE, CompletedProcess, run # nosec:B404
from sys import argv, executable, version_info
from sys import argv, executable, stderr, version_info
from typing import Any
from venv import EnvBuilder

Expand All @@ -35,12 +35,10 @@

def pip_run(*args: str, **kwargs: Any) -> CompletedProcess:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
*args)
print('+ ', *call, file=stderr)
res = run(call, **kwargs, cwd=this_dir, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
12 changes: 5 additions & 7 deletions tests/_data/infiles/environment/with-license-pep639/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import dirname, join
from subprocess import PIPE, CompletedProcess, run # nosec:B404
from sys import argv, executable
from sys import argv, executable, stderr
from typing import Any
from venv import EnvBuilder

Expand All @@ -35,12 +35,10 @@

def pip_run(*args: str, **kwargs: Any) -> CompletedProcess:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
*args)
print('+ ', *call, file=stderr)
res = run(call, **kwargs, cwd=this_dir, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
12 changes: 5 additions & 7 deletions tests/_data/infiles/environment/with-license-text/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import abspath, dirname, join
from subprocess import CompletedProcess, run # nosec:B404
from sys import executable
from sys import executable, stderr
from typing import Any
from venv import EnvBuilder

Expand All @@ -37,12 +37,10 @@

def pip_run(*args: str, **kwargs: Any) -> CompletedProcess:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
*args)
print('+ ', *call, file=stderr)
res = run(call, **kwargs, cwd=this_dir, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down
12 changes: 5 additions & 7 deletions tests/_data/infiles/environment/with-urls/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from os import name as os_name
from os.path import dirname, join
from subprocess import CompletedProcess, run # nosec:B404
from sys import executable
from sys import executable, stderr
from venv import EnvBuilder

__all__ = ['main']
Expand All @@ -33,12 +33,10 @@

def pip_run(*args: str) -> CompletedProcess:
# pip is not API, but a CLI -- call it like that!
call = (
executable, '-m', 'pip',
'--python', env_dir,
*args
)
print('+ ', *call)
call = (executable, '-m', 'pip',
'--python', env_dir,
*args)
print('+ ', *call, file=stderr)
res = run(call, cwd=this_dir, shell=False) # nosec:B603
if res.returncode != 0:
raise RuntimeError('process failed')
Expand Down