summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index d7cc51f..c49745a 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,23 @@
# -*- coding: utf-8 -*-
+import sys
+
from setuptools import setup, find_packages
+from setuptools.command.test import test as TestCommand
+
+
+with open('test-requirements.txt') as requirements:
+ test_required = requirements.read().splitlines()
+
+
+class PyTestCommand(TestCommand):
+
+ def run_tests(self):
+ # import here, cause outside the eggs aren't loaded
+ import pytest
+ errno = pytest.main([])
+ sys.exit(errno)
+
setup(
name = 'glucometerutils',
@@ -27,8 +44,8 @@ setup(
data_files = [
('lib/udev/rules', ['udev/69-glucometerutils.rules']),
],
+ tests_require = test_required,
extras_require = {
- 'test': ['absl-py'],
# These are all the drivers' dependencies. Optional dependencies are
# listed as mandatory for the feature.
'otultra2': ['pyserial'],
@@ -46,4 +63,7 @@ setup(
'glucometer=glucometerutils.glucometer:main'
]
},
+ cmdclass = {
+ 'test': PyTestCommand,
+ },
)