-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
30 lines (22 loc) · 930 Bytes
/
setup.py
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
""" :noindex:
Setup.py file that governs the installatino process of
`how_to_make_a_python_package` it is used by
`conda install -f environment.yml` which will install the package in an
environment specified in that file.
"""
from setuptools import setup
from setuptools.command.test import test as testcommand
# This installs the pytest command. Meaning that you can simply type pytest
# anywhere and "pytest" will look for all available tests in the current
# directory and subdirectories recursively (not yet supported in the setup.cfg)
class PyTest(testcommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.tests")]
def initialize_options(self):
testcommand.initialize_options(self)
self.pytest_args = []
def run_tests(self):
import pytest
import sys
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(cmdclass={'tests': PyTest})