forked from DiamondLightSource/pymalcolm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
89 lines (82 loc) · 2.7 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
81
82
83
84
85
86
87
88
89
# import multiprocessing to avoid this bug
# (http://bugs.python.org/issue15881#msg170215)
import multiprocessing
assert multiprocessing
import re
import os
from setuptools import setup, find_packages
module_name = "malcolm"
def get_version():
"""Extracts the version number from the version.py file.
"""
VERSION_FILE = os.path.join(module_name, 'version.py')
txt = open(VERSION_FILE).read()
mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', txt, re.M)
if mo:
version = mo.group(1)
bs_version = os.environ.get('MODULEVER', '0.0')
assert bs_version == "0.0" or bs_version == version, \
"Version {} specified by the build system doesn't match {} in " \
"version.py".format(bs_version, version)
return version
else:
raise RuntimeError('Unable to find version string in {0}.'
.format(VERSION_FILE))
install_requires = ['numpy', 'scanpointgenerator>=1.5']
def add_multiversion_require(module):
try:
# Can we import it?
__import__(module)
except ImportError:
try:
# What about if we require?
from pkg_resources import require
require(module)
except Exception:
pass
else:
# So it is there if we require, lets use it
global install_requires
install_requires.append(module)
add_multiversion_require("tornado")
add_multiversion_require("ruamel.yaml")
packages = [x for x in find_packages() if x.startswith("malcolm")]
setup(
name=module_name,
version=get_version(),
description='Scanning in the middlelayer',
long_description=open("README.rst").read(),
url='https://github.com/dls-controls/pymalcolm',
author='Tom Cobb',
author_email='[email protected]',
keywords='',
packages=packages,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
license='APACHE',
install_requires=install_requires,
extras_require={
'websocket': ['tornado'],
'ca': ['cothread'],
'hdf5': ['h5py', 'vds-gen'],
},
include_package_data=True,
test_suite='nose.collector',
tests_require=[
# 'coverage>=3.7.1',
# 'mock>=1.0.1',
'nose>=1.3.0',
],
zip_safe=False,
entry_points={'console_scripts':
["imalcolm = malcolm.imalcolm:main"]
},
)