-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
110 lines (101 loc) · 3.94 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
#!/usr/bin/env python3
import os
import platform
from setuptools import Extension, setup, find_packages
from glob import glob
if os.name == "nt":
raise NotImplementedError(
"Python metacells does not support native windows.\nInstead, "
"install Windows Subsystem for Linux, and metacells within it."
)
DEFINE_MACROS = [("ASSERT_LEVEL", 1)] # 0 for none, 1 for fast, 2 for slow.
COMPILE_ARGS = [f"-I{os.getcwd()}", "-std=c++14"]
# COMPILE_ARGS += ["-fsanitize=address", "-fno-omit-frame-pointer"]
# COMPILE_ARGS += ["-fopt-info-vec-all", "-fopt-info-loop-optimized"]
with open("metacells/should_check_avx2.py", "w") as file:
file.write("# file generated by setup\n")
file.write("# don't change, don't track in version control\n")
if str(os.getenv("WHEEL", "")) == "":
if platform.processor() == "x86_64":
COMPILE_ARGS += ["-march=native", "-mtune=native"]
file.write("SHOULD_CHECK_AVX2 = False\n")
elif platform.processor() == "x86_64":
COMPILE_ARGS += ["-march=haswell", "-mtune=broadwell"]
DEFINE_MACROS.append(("USE_AVX2", 1))
file.write("SHOULD_CHECK_AVX2 = True\n")
else:
file.write("SHOULD_CHECK_AVX2 = False\n")
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = open("requirements.txt").read().split()
test_requirements = open("requirements_test.txt").read().split()
dev_requirements = open("requirements_dev.txt").read().split()
packages = ['metacells'] + [sub_dir for sub_dir in glob('metacells/*') if '.' not in sub_dir and '__' not in sub_dir]
setup(
author="Oren Ben-Kiki",
author_email="[email protected]",
python_requires=">=3.7",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
],
description="Single-cell RNA Sequencing Analysis",
headers=["metacells/extensions.h"],
ext_modules=[
Extension( #
"metacells.extensions",
include_dirs=["pybind11/include"],
sources=[
"metacells/auroc.cpp",
"metacells/choose_seeds.cpp",
"metacells/correlate.cpp",
"metacells/cover.cpp",
"metacells/downsample.cpp",
"metacells/extensions.cpp",
"metacells/folds.cpp",
"metacells/gaps.cpp",
"metacells/logistics.cpp",
"metacells/partitions.cpp",
"metacells/prune_per.cpp",
"metacells/rank.cpp",
"metacells/relayout.cpp",
"metacells/shuffle.cpp",
"metacells/top_per.cpp",
],
define_macros=DEFINE_MACROS,
extra_compile_args=COMPILE_ARGS,
),
],
entry_points={
"console_scripts": [
"metacells_timing=metacells.scripts.timing:main",
]
},
install_requires=requirements,
license="MIT license",
long_description=readme + "\n\n" + history,
long_description_content_type="text/x-rst",
include_package_data=True,
keywords="metacells",
name="metacells",
packages=packages,
test_suite="tests",
tests_require=test_requirements,
extras_require={"dev": dev_requirements},
url="https://github.com/tanaylab/metacells.git",
version="0.9.5",
)