mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
fix python local template when artifact dirs are present
This commit is contained in:
parent
67e8faf80b
commit
51592eecec
2 changed files with 15 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
setup(name='pre-commit-placeholder-package', version='0.0.0')
|
setup(name='pre-commit-placeholder-package', version='0.0.0', py_modules=[])
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import pre_commit.constants as C
|
||||||
from pre_commit.envcontext import envcontext
|
from pre_commit.envcontext import envcontext
|
||||||
from pre_commit.languages import python
|
from pre_commit.languages import python
|
||||||
from pre_commit.prefix import Prefix
|
from pre_commit.prefix import Prefix
|
||||||
|
from pre_commit.store import _make_local_repo
|
||||||
|
from pre_commit.util import cmd_output_b
|
||||||
from pre_commit.util import make_executable
|
from pre_commit.util import make_executable
|
||||||
from pre_commit.util import win_exe
|
from pre_commit.util import win_exe
|
||||||
from testing.auto_namedtuple import auto_namedtuple
|
from testing.auto_namedtuple import auto_namedtuple
|
||||||
|
|
@ -351,3 +353,15 @@ def test_python_hook_weird_setup_cfg(tmp_path):
|
||||||
|
|
||||||
ret = run_language(tmp_path, python, 'socks', [os.devnull])
|
ret = run_language(tmp_path, python, 'socks', [os.devnull])
|
||||||
assert ret == (0, f'[{os.devnull!r}]\nhello hello\n'.encode())
|
assert ret == (0, f'[{os.devnull!r}]\nhello hello\n'.encode())
|
||||||
|
|
||||||
|
|
||||||
|
def test_local_repo_with_other_artifacts(tmp_path):
|
||||||
|
cmd_output_b('git', 'init', tmp_path)
|
||||||
|
_make_local_repo(str(tmp_path))
|
||||||
|
# pretend a rust install also ran here
|
||||||
|
tmp_path.joinpath('target').mkdir()
|
||||||
|
|
||||||
|
ret, out = run_language(tmp_path, python, 'python --version')
|
||||||
|
|
||||||
|
assert ret == 0
|
||||||
|
assert out.startswith(b'Python ')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue