-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
219 lines (192 loc) · 5.91 KB
/
pyproject.toml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
requires-python = ">=3.7"
name = "openpredict"
description = "A package to help serve predictions of biomedical concepts associations as Translator Reasoner API."
readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [
{ name = "Remzi Çelebi", email = "[email protected]" },
{ name = "Vincent Emonet", email = "[email protected]" },
{ name = "Arif Yilmaz" },
{ name = "Elif" },
]
keywords = [
"Python",
"Biomedical Data Translator",
"TRAPI",
"Predictions"
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dynamic = ["version"]
dependencies = [
"numpy",
"pandas",
"scikit-learn",
"gensim", # For word2vec
"scipy ==1.10.1", # https://stackoverflow.com/questions/78279136/importerror-cannot-import-name-triu-from-scipy-linalg-gensim
"requests >=2.23.0",
"rdflib >=6.1.1",
"SPARQLWrapper >=2.0.0,<3.0.0",
"reasoner-pydantic >=4.1.4",
# "trapi-predict-kit[web,opentelemetry] >=0.2.3",
"trapi-predict-kit[web,opentelemetry] @ git+https://github.com/MaastrichtU-IDS/trapi-predict-kit.git",
# "trapi-predict-kit @ {root:uri}/trapi-predict-kit",
"predict-drug-target @ git+https://github.com/MaastrichtU-IDS/predict-drug-target.git", # Uncomment for prod
# "predict-drug-target", # Uncomment if you want to run locally in dev
# "predict-drug-target @ {root:uri}/predict-drug-target",
]
[project.optional-dependencies]
train = [
# Dependencies to train the original OpenPredict drug-disease model
#"numpy ==1.16.1", # requires python 3.8
"numpy ==1.19.5", # requires python 3.8
"pandas ==1.1.1",
"torch ==1.13.1",
"networkx",
"gensim ==3.8.3",
"scipy ==1.5.4",
# scipy ==0.19.1
## Cannot update to numpy1.16.5 because it requires werkzeug>=2.0
# numpy ==1.16.5
# werkzeug >=2.0
"cython ==0.29.32",
"pyspark ==3.1.1",
# "findspark",
"scikit-learn ==0.23.1",
"shap ==0.41.0",
"matplotlib ==3.4.3",
"pyRDF2vec ==0.0.5",
"python-multipart >=0.0.5",
"kgx",
]
test = [
"pytest",
"pytest-cov",
"httpx",
"typer >=0.7.0",
"pre-commit >=3.2.0",
"dvc >=2.38.1",
"pip-tools",
"types-requests",
]
test-prod = [
# Cannot be installed on python 3.8
"reasoner-validator >=3.9.0",
]
doc = [
"mkdocs >=1.4.2",
"mkdocs-material >=8.2.7",
"mkdocstrings[python] >=0.19.1",
"mdx-include >=1.4.1",
"mkdocs-markdownextradata-plugin >=0.2.5",
]
[project.urls]
Homepage = "https://github.com/MaastrichtU-IDS/translator-openpredict"
Documentation = "https://github.com/MaastrichtU-IDS/translator-openpredict"
History = "https://github.com/MaastrichtU-IDS/translator-openpredict/releases"
Tracker = "https://github.com/MaastrichtU-IDS/translator-openpredict/issues"
Source = "https://github.com/MaastrichtU-IDS/translator-openpredict"
# [tool.hatch.build.targets.wheel]
# packages = ["src/openpredict"]
# [project.scripts]
# openpredict = "openpredict.__main__:main"
# HATCH CONFIG: ENVS AND SCRIPTS
[tool.hatch.envs.default]
features = [
"test",
"test-prod",
"doc",
# "train",
]
post-install-commands = [
"pre-commit install",
"dvc pull"
]
# type = "container"
# image = "ghcr.io/maastrichtu-ids/openpredict-api:0.1.0"
# command = ["/bin/sleep", "infinity"]
# start-on-creation = false
# NOTE: we can't run training and integration out of docker (require python 3.8)
[tool.hatch.envs.default.scripts]
dev = "uvicorn src.trapi.main:app --reload --log-level debug"
docs = "mkdocs serve -a localhost:8001 {args}"
fmt = "pre-commit run --all --all-files"
test-dev = "pytest tests/production {args}"
test-ci = "pytest tests/production --server https://openpredict.ci.transltr.io {args}"
test-prod = "pytest tests/production --server https://openpredict.transltr.io {args}"
requirements = "pip-compile --extra dev --extra test --extra train -o requirements.txt pyproject.toml"
requirements-test = "pip-compile --extra dev --extra test --extra test-prod -o requirements-tests.txt pyproject.toml"
fix-permission = "sudo chown -R $(id -u):$(id -g) models data"
# train = "python src/openpredict_model/train.py train-model"
# TOOLS
[tool.hatch.build.targets.wheel]
packages = ["src/trapi", "src/openpredict_model", "src/drkg_model"]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.version]
path = "src/trapi/__init__.py"
# [tool.coverage.run]
# source = ["src/openpredict"]
# branch = true
# [tool.coverage.report]
# omit = ["tests/*"]
[tool.pytest.ini_options]
addopts = [
"-vvv",
"--cov=src",
"--color=yes",
"--cov-report=term-missing",
]
[tool.ruff]
src = ["src", "tests"]
target-version = "py38"
line-length = 120
select = [
"A",
"B", # flake8-bugbear
"C", # flake8-comprehensions
"E", # pycodestyle errors
"F", # pyflakes
# "FBT", # flake8-boolean-trap
"I", # isort
"ICN",
"N",
"PLC",
"PLE",
# "PLR", # Magic value used in comparison, consider replacing the str with a constant variable
"PLW",
"Q",
"RUF",
"S",
"SIM",
"T",
"TID",
"UP",
"W", # pycodestyle warnings
"YTT",
]
ignore = [
"Q000", # no single quotes
"N806", "N802", "N803", # lowercase variables
"E501", # line too long
"B008", # do not perform function calls in argument defaults
"B006", # do not use mutable data structures for argument defaults
"C901", # too complex
"S101", # Use of `assert` detected
"T201", "T203", # remove print and pprint
"A003", # Class attribute `type` is shadowing a python builtin
"SIM118", # dont use .keys()
]
[tool.ruff.per-file-ignores]
"__init__.py" = [ "I", "F401" ]
[tool.ruff.isort]
known-third-party = ["trapi_predict_kit"]