mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #1431 from pre-commit/better_healthy
Improve python healthy() and eliminate python_venv
This commit is contained in:
commit
f455312944
8 changed files with 164 additions and 146 deletions
|
|
@ -3,8 +3,7 @@ import sys
|
|||
|
||||
LANGUAGES = [
|
||||
'conda', 'docker', 'docker_image', 'fail', 'golang', 'node', 'perl',
|
||||
'pygrep', 'python', 'python_venv', 'ruby', 'rust', 'script', 'swift',
|
||||
'system',
|
||||
'pygrep', 'python', 'ruby', 'rust', 'script', 'swift', 'system',
|
||||
]
|
||||
FIELDS = [
|
||||
'ENVIRONMENT_DIR', 'get_default_version', 'healthy', 'install_environment',
|
||||
|
|
|
|||
|
|
@ -45,20 +45,6 @@ xfailif_windows_no_ruby = pytest.mark.xfail(
|
|||
xfailif_windows = pytest.mark.xfail(os.name == 'nt', reason='windows')
|
||||
|
||||
|
||||
def supports_venv(): # pragma: no cover (platform specific)
|
||||
try:
|
||||
__import__('ensurepip')
|
||||
__import__('venv')
|
||||
return True
|
||||
except ImportError:
|
||||
return False
|
||||
|
||||
|
||||
xfailif_no_venv = pytest.mark.xfail(
|
||||
not supports_venv(), reason='Does not support venv module',
|
||||
)
|
||||
|
||||
|
||||
def run_opts(
|
||||
all_files=False,
|
||||
files=(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue