setup.py: use pytest-runner to bootstrap pytest and simply do python setup.py test
; add wheel
to setup requirements when doing pyhton setup.py bdist_wheel
This commit is contained in:
parent
b11d0c4a1b
commit
c6de6c4a5f
7
setup.py
7
setup.py
@ -14,6 +14,10 @@ def doraise_py_compile(file, cfile=None, dfile=None, doraise=False):
|
|||||||
|
|
||||||
py_compile.compile = doraise_py_compile
|
py_compile.compile = doraise_py_compile
|
||||||
|
|
||||||
|
needs_pytest = {'pytest', 'test'}.intersection(sys.argv)
|
||||||
|
pytest_runner = ['pytest_runner'] if needs_pytest else []
|
||||||
|
needs_wheel = {'bdist_wheel'}.intersection(sys.argv)
|
||||||
|
wheel = ['wheel'] if needs_wheel else []
|
||||||
|
|
||||||
# Trove classifiers for PyPI
|
# Trove classifiers for PyPI
|
||||||
classifiers = {"classifiers": [
|
classifiers = {"classifiers": [
|
||||||
@ -60,6 +64,9 @@ setup(
|
|||||||
] if sys.platform.startswith('linux') else [],
|
] if sys.platform.startswith('linux') else [],
|
||||||
setup_requires=[
|
setup_requires=[
|
||||||
"setuptools_scm>=1.11.1",
|
"setuptools_scm>=1.11.1",
|
||||||
|
] + pytest_runner + wheel,
|
||||||
|
tests_require=[
|
||||||
|
'pytest>=2.8',
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user