-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
110 lines (95 loc) · 3.79 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
107
108
109
110
'''
pySRM: Statistical Region Merging for python3 (C++ backend)
Note that "python setup.py test" invokes pytest on the package. With appropriately
configured setup.cfg, this will check both xxx_test modules and docstrings.
Copyright 2019, Markus Joppich.
Licensed under MIT.
'''
import sys, os
from setuptools import setup, find_packages, Extension
from setuptools.command.test import test as TestCommand
# This is a plug-in for setuptools that will invoke py.test
# when you run python setup.py test
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest # import here, because outside the required eggs aren't loaded yet
sys.exit(pytest.main(self.test_args))
ext_lib_path = 'rectangle'
include_dir = os.path.join(ext_lib_path, 'include')
curBaseFolder = os.path.relpath(os.path.abspath(os.path.dirname(__file__)), os.getcwd())
print(curBaseFolder, file=sys.stderr)
segment_sources = [os.path.join(curBaseFolder, 'cIMZ/segment.cpp')]
imageregion_sources = [os.path.join(curBaseFolder, 'cIMZ/src/imageregion.cpp')]
srm_sources = [os.path.join(curBaseFolder, 'cIMZ/src/srm.cpp')]
print(segment_sources, file=sys.stderr)
compileArgs = ["-std=c++1z", "-Wall", "-fopenmp", "-fPIC", "-std=gnu++17",'-O3']
libPIMZ=Extension('pIMZ.libPIMZ',
sources=srm_sources+imageregion_sources+segment_sources,
language='c++',
libraries=['z', 'gomp'],
extra_compile_args=compileArgs,
extra_objects=[],
)
version = "1.0a"
import pathlib
setup(name="pIMZ",
version=version,
description="pIMZ: an integrative framework for imaging mass spectrometry analysis",
long_description=open("README.md").read(),
long_description_content_type='text/markdown',
classifiers=[ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Medical Science Apps.'
],
keywords="IMS MSI imaging mass-spectrometry interactive integrative", # Separate with spaces
author="Markus Joppich",
author_email="[email protected]",
url="https://github.com/mjoppich/pIMZ",
license="MIT",
packages=find_packages(exclude=['examples', 'tests']),
include_package_data=True,
zip_safe=False,
tests_require=['pytest'],
cmdclass={'test': PyTest},
python_requires='>=3.6',
# TODO: List of packages that this one depends upon:
install_requires=[
'numpy>=1.17.5',
'h5py', "networkx~=2.3", "pronto", "upsetplot",
'matplotlib', "joblib",
'pandas',
'scipy',
'scikit-image',
'scikit-learn',
'dill',
'pathos',
'ms_peak_picker',
'globus_sdk',
'progressbar',
'anndata',
'diffxpy',
'pyimzml',
'natsort',
'seaborn',
'llvmlite', 'pykeops',
'imageio', 'umap', 'jinja2', 'hdbscan', 'regex',
'Pillow', 'adjustText', 'intervaltree'], #dabest, 'fuzzy-c-means'
# TODO: List executable scripts, provided by the package (this is just an example)
entry_points={
'console_scripts':
[]
},
ext_modules=[libPIMZ]
)