-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
43 lines (31 loc) · 1.14 KB
/
setup.py
File metadata and controls
43 lines (31 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""The setup script."""
import sys
from setuptools import setup
from setuptools.command.test import test
# From https://stackoverflow.com/questions/45150304/how-to-force-a-python-wheel-to-be-platform-specific-when-building-it
# Tell bdsit wheel to be platform specific even though we arent compiling extensions
try:
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False
except ImportError:
bdist_wheel = None
class PyTest(test):
"""Define what happens when we run python setup.py test"""
def initialize_options(self):
test.initialize_options(self)
self.pytest_args = "tests/"
def run_tests(self):
# Import here, because outside the eggs aren't loaded
# import shlex
import pytest
err_number = pytest.main(["-vvv"])
sys.exit(err_number)
# great info
# https://stackoverflow.com/questions/50155464/using-pytest-with-a-src-layer
setup(
test_suite="tests",
cmdclass={"test": PyTest, "bdist_wheel": bdist_wheel},
)