setup.py 678 Bytes
Newer Older
Leo Pound Singer's avatar
Leo Pound Singer committed
1
import sys
Leo Pound Singer's avatar
Leo Pound Singer committed
2

3
import versioneer
Leo Pound Singer's avatar
Leo Pound Singer committed
4
import pkg_resources
5
from setuptools import setup
6

7 8 9 10 11 12

def get_requirements(filename):
    with open(filename, 'r') as f:
        return [str(r) for r in pkg_resources.parse_requirements(f)]


13
setup_requires = ['setuptools >= 30.3.0']
14
if {'pytest', 'test', 'ptr'}.intersection(sys.argv):
15
    setup_requires.extend(get_requirements('test-requirements.txt'))
16
if {'build_sphinx'}.intersection(sys.argv):
17
    setup_requires.extend(get_requirements('docs-requirements.txt'))
Leo Pound Singer's avatar
Leo Pound Singer committed
18

19
setup(install_requires=get_requirements('requirements.txt'),
20 21 22
      setup_requires=setup_requires,
      version=versioneer.get_version(),
      cmdclass=versioneer.get_cmdclass())