mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add test for python_venv language
This commit is contained in:
parent
e8954e2bf3
commit
b5af5a5b27
12 changed files with 55 additions and 15 deletions
|
|
@ -3,7 +3,7 @@ from __future__ import print_function
|
|||
import sys
|
||||
|
||||
|
||||
def func():
|
||||
def main():
|
||||
print(sys.version_info[0])
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
|
|
@ -1,11 +1,8 @@
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='python3_hook',
|
||||
version='0.0.0',
|
||||
packages=find_packages('.'),
|
||||
entry_points={
|
||||
'console_scripts': ['python3-hook = python3_hook.main:func'],
|
||||
},
|
||||
py_modules=['py3_hook'],
|
||||
entry_points={'console_scripts': ['python3-hook = py3_hook:main']},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import print_function
|
|||
import sys
|
||||
|
||||
|
||||
def func():
|
||||
def main():
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
return 0
|
||||
|
|
@ -1,11 +1,8 @@
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='Foo',
|
||||
name='foo',
|
||||
version='0.0.0',
|
||||
packages=find_packages('.'),
|
||||
entry_points={
|
||||
'console_scripts': ['foo = foo.main:func'],
|
||||
},
|
||||
py_modules=['foo'],
|
||||
entry_points={'console_scripts': ['foo = foo:main']},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
- id: foo
|
||||
name: Foo
|
||||
entry: foo
|
||||
language: python_venv
|
||||
files: \.py$
|
||||
9
testing/resources/python_venv_hooks_repo/foo.py
Normal file
9
testing/resources/python_venv_hooks_repo/foo.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
return 0
|
||||
8
testing/resources/python_venv_hooks_repo/setup.py
Normal file
8
testing/resources/python_venv_hooks_repo/setup.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='foo',
|
||||
version='0.0.0',
|
||||
py_modules=['foo'],
|
||||
entry_points={'console_scripts': ['foo = foo:main']},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue