-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
109 lines (92 loc) · 2.62 KB
/
setup.py
File metadata and controls
109 lines (92 loc) · 2.62 KB
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
"""
Cipyright (c) 2024, My Company
"""
import re
import sys
from setuptools import Command, find_packages, setup
from setuptools.command.install import install
_deps = [
"scanpy>=1.9.3,<1.11",
"scikit-learn>=1.3.0,<1.4",
"scipy>=1.10.1",
"pandas>=2.0.3,<2.1",
"anndata>=0.10.7,<0.11",
"torch>=1.13.1",
"diffusers>=0.17.1,<0.18",
"torch-geometric>=2.3.1",
"tqdm>=4.65.0",
"rpy2>=3.5.13",
"jupyter>=1.0.0",
"ipywidgets==7.6.5",
"widgetsnbextension==3.5.1",
"notebook==6.1.5"
]
# set rpy2 "rpy2>=3.5.13,<3.6", to be optional
deps = {b: a for a, b in (re.findall(r"^(([^!=<>~]+)(?:[!=<>~].*)?$)", x)[0] for x in _deps)}
def deps_list(*pkgs):
return [deps[pkg] for pkg in pkgs]
class DepsTableUpdateCommand(Command):
"""
A custom command that updates the dependency table.
usage: python setup.py deps_table_update
"""
description = "build runtime dependency table"
user_options = [
# format: (long option, short option, description).
(
"dep-table-update",
None,
"updates stadiffuser/dependency_versions_table.py",
),
]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
entries = "\n".join([f' "{k}": "{v}",' for k, v in deps.items()])
content = [
"# THIS FILE HAS BEEN AUTOGENERATED. To update:",
"# 1. modify the `_deps` dict in setup.py",
"# 2. run `make deps_table_update`",
"deps = {",
entries,
"}",
"",
]
target = "stadiffuser/dependency_versions_table.py"
print(f"updating {target}")
with open(target, "w", encoding="utf-8", newline="\n") as f:
f.write("\n".join(content))
extras = {}
extras["rpy2"] = deps_list("rpy2")
version_range_max = max(sys.version_info[1], 10) + 1
install_requires = [
deps["scanpy"],
deps["scikit-learn"],
deps["scipy"],
deps["torch"],
deps["torch-geometric"],
deps["diffusers"],
deps["tqdm"],
deps["ipywidgets"],
deps["jupyter"],
deps["widgetsnbextension"],
deps["notebook"],
]
setup(
name="stadiffuser",
version="0.1.1",
description="A versatile simulation framework for spatial transcriptomics data",
author="Chihao Zhang",
author_email="zhangchihao11@outlook.com",
python_requires=">=3.8.0",
install_requires=list(list(install_requires)),
extras_require=extras,
packages=find_packages(),
entry_points={
'console_scripts': [
'stadiffuser-cli=scripts.cli:main',
],
},
)