mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Allow virtualenv creation with strange setup.cfg. Resolves #425
This commit is contained in:
parent
4f73a74378
commit
5ace43765b
2 changed files with 15 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ def install_environment(
|
|||
venv_cmd.extend(['-p', norm_version(version)])
|
||||
else:
|
||||
venv_cmd.extend(['-p', os.path.realpath(sys.executable)])
|
||||
repo_cmd_runner.run(venv_cmd)
|
||||
repo_cmd_runner.run(venv_cmd, cwd='/')
|
||||
with in_env(repo_cmd_runner, version):
|
||||
helpers.run_setup_cmd(
|
||||
repo_cmd_runner,
|
||||
|
|
|
|||
|
|
@ -81,6 +81,20 @@ def test_python_hook_args_with_spaces(tempdir_factory, store):
|
|||
)
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_python_hook_weird_setup_cfg(tempdir_factory, store):
|
||||
path = git_dir(tempdir_factory)
|
||||
with cwd(path):
|
||||
with io.open('setup.cfg', 'w') as setup_cfg:
|
||||
setup_cfg.write('[install]\ninstall_scripts=/usr/sbin\n')
|
||||
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'python_hooks_repo',
|
||||
'foo', [os.devnull],
|
||||
b"['" + five.to_bytes(os.devnull) + b"']\nHello World\n"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_switch_language_versions_doesnt_clobber(tempdir_factory, store):
|
||||
# We're using the python3 repo because it prints the python version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue