-
Notifications
You must be signed in to change notification settings - Fork 22
/
setup.py
81 lines (65 loc) · 1.81 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
import re
from setuptools.command.test import test as TestCommand
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
class PyTest(TestCommand):
'''Pytest command.'''
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
'''Import pytest and run.'''
import pytest
errno = pytest.main(self.test_args)
raise SystemExit(errno)
with open(os.path.join(
os.path.dirname(__file__), 'source', 'lucidity', '_version.py'
)) as _version_file:
_version = re.match(
r'.*__version__ = \'(.*?)\'', _version_file.read(), re.DOTALL
).group(1)
# Requirements.
setup_requires = [
'Sphinx >= 1.3, < 2',
'Lowdown >= 0.1.1, < 2'
]
install_requires = [
]
# Readthedocs requires Sphinx extensions to be specified as part of
# install_requires in order to build properly.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
install_requires.extend(setup_requires)
setup(
name='Lucidity',
version=_version,
description='Filesystem templating and management.',
long_description=open('README.rst').read(),
keywords='filesystem, management, templating',
url='https://gitlab.com/4degrees/lucidity',
author='Martin Pengelly-Phillips',
author_email='[email protected]',
license='Apache License (2.0)',
packages=[
'lucidity',
],
package_dir={
'': 'source'
},
setup_requires=setup_requires,
install_requires=install_requires,
tests_require=[
'pytest >= 2.3.5'
],
cmdclass={
'test': PyTest
},
zip_safe=False
)