mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
Merge pull request #427 from pre-commit/setup_cfg_issue_425
Allow virtualenv creation with strange setup.cfg. Resolves #425
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user