-
Notifications
You must be signed in to change notification settings - Fork 91
/
setup.py
106 lines (87 loc) · 2.58 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Custom commands following:
# https://seasonofcode.com/posts/how-to-add-custom-build-steps-and-commands-to-setuppy.html
#
import distutils.cmd
import platform
import os
import setuptools.command.build_py
import subprocess
import sys
from setuptools import setup, find_packages
from distutils.core import Extension
version = "2.2"
description = "STORM movie analysis code."
long_description = ""
class SConsCommand(distutils.cmd.Command):
"""
Custom command to run scons (http://scons.org/) to build the C libraries.
"""
description = 'run scons to build C libraries'
user_options = [
('scons-exe=', None, 'location of the scons executable'),
('compiler=', None, 'which C compiler to use, e.g. "mingw", ..')
]
def initialize_options(self):
self.scons_exe = ''
self.compiler = ''
def finalize_options(self):
if self.scons_exe:
assert os.path.exists(self.scons_exe), ("scon executable " + self.scons_exe + " not found")
def run(self):
if self.scons_exe:
command = [self.scons_exe]
else:
command = ['scons']
if self.compiler:
command.extend(['-Q', 'compiler=' + self.compiler])
self.announce('Running command: ' + str(command))
try:
subprocess.check_call(command)
except OSError:
print("Failed to build C libraries, is scons installed?")
setup(
name='storm_analysis',
version=version,
description=description,
long_description=long_description,
author='Hazen Babcock',
author_email='hbabcock at fas.harvard.edu',
url='https://github.com/ZhuangLab/storm-analysis',
cmdclass={
'build_c' : SConsCommand,
},
zip_safe=False,
packages=find_packages(),
package_data={},
exclude_package_data={},
include_package_data=True,
requires=[],
install_requires=[
"numpy",
"scipy",
"matplotlib",
"pillow",
"tifffile",
"Shapely",
"randomcolor",
"PyWavelets",
"h5py",
"astropy"
],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
license="",
keywords='storm,microscopy',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: Mixed',
"Programming Language :: C",
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
)