forked from opentargets/gentropy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
270 lines (238 loc) · 8.47 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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
[tool.poetry]
name = "gentropy"
# !! version is managed by semantic_release
version = "0.0.0"
description = "Open Targets python framework for post-GWAS analysis"
authors = ["Open Targets core team"]
license = "Apache-2.0"
readme = "README.md"
documentation = "https://opentargets.github.io/gentropy/"
repository = "https://github.com/opentargets/gentropy"
packages = [{ include = "gentropy", from = "src" }]
[tool.poetry.urls]
"Bug Tracker" = "http://github.com/opentargets/issues"
"Funding" = "https://www.opentargets.org"
"Documentation" = "https://opentargets.github.io/gentropy/"
[tool.poetry.scripts]
gentropy = "gentropy.cli:main"
[tool.poetry.dependencies]
python = "^3.10, <3.11"
pyspark = "3.3.4"
scipy = "^1.11.4"
hydra-core = "^1.3.2"
pyliftover = "^0.4"
numpy = "^1.26.2"
hail = "0.2.127"
wandb = ">=0.16.2,<0.19.0"
google = "^3.0.0"
omegaconf = "^2.3.0"
typing-extensions = "^4.9.0"
scikit-learn = "^1.3.2"
pandas = { extras = ["gcp", "parquet"], version = "^2.2.2" }
skops = ">=0.9,<0.11"
google-cloud-secret-manager = "^2.20.0"
shap = "^0.46.0"
matplotlib = "3.7.3"
[tool.poetry.dev-dependencies]
pre-commit = "^4.0.0"
mypy = "^1.13"
pep8-naming = "^0.14.1"
interrogate = "^1.7.0"
isort = "^5.13.2"
darglint = "^1.8.1"
ruff = "^0.7.0"
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.5.3"
mkdocstrings-python = "^1.8.0"
mkdocs-material = "*"
mkdocs-section-index = "^0.3.4"
mkdocs-git-revision-date-localized-plugin = "^1.2.2"
mkdocs-autolinks-plugin = "^0.7.1"
mkdocs-awesome-pages-plugin = "^2.9.2"
mkdocs-exclude = "^1.0.2"
mkdocs-git-committers-plugin-2 = "^2.2.3"
lxml = "^5.1.0"
pymdown-extensions = "^10.7"
[tool.poetry.group.tests.dependencies]
pytest-cov = ">=4.1,<6.0"
pytest-sugar = ">=0.9.5,<1.1.0"
dbldatagen = ">=0.3.1,<0.5.0"
pyparsing = "^3.1.1"
pytest = ">=7.4.4,<9.0.0"
pytest-xdist = "^3.5.0"
[tool.poetry.group.dev.dependencies]
ipython = "^8.19.0"
ipykernel = "^6.28.0"
google-cloud-dataproc = "^5.8.0"
pydoclint = ">=0.3.8,<0.6.0"
prettier = "^0.0.7"
deptry = ">=0.12,<0.21"
yamllint = "^1.33.0"
[tool.semantic_release]
logging_use_named_masks = true
build_command = "pip install poetry && poetry build"
assets = []
version_toml = ["pyproject.toml:tool.poetry.version"]
upload_to_pypi = false
upload_to_release = true
[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease = false
[tool.semantic_release.branches."release"]
match = "release/*"
prerelease = true
prerelease_token = "rc"
[tool.semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true
[tool.semantic_release.changelog]
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = ["chore\\(release\\):"]
[tool.semantic_release.branches."step"]
match = "(build|chore|ci|docs|feat|fix|perf|style|refactor|test)"
prerelease = true
prerelease_token = "alpha"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.deptry]
extend_exclude = ["src/conftest.py", "src/utils"]
[tool.deptry.per_rule_ignores]
DEP001 = ["gentropy"]
DEP003 = ["gentropy"]
[tool.interrogate]
fail-under = 95
color = true
exclude = ["dist"]
[tool.pytest.ini_options]
addopts = "-n auto --doctest-modules --cov=src/ --cov-report=xml"
pythonpath = ["."]
testpaths = ["tests/gentropy", "src/gentropy"]
markers = ["step_test"]
# Semi-strict mode for mypy
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
no_implicit_optional = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"google.cloud",
"yaml",
"hail",
"pyliftover",
"dbldatagen",
"scipy",
"scipy.stats",
"chardet",
"omegaconf",
"xgboost",
"sklearn",
]
ignore_missing_imports = true
[tool.ruff.lint]
select = [
"B002", # Python does not support the unary prefix increment
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
"B023", # Function definition does not bind loop variable {name}
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B904", # Checks for raise statements in exception handlers that lack a from clause
"C", # complexity
"COM818", # Trailing comma on bare tuple prohibited
"D", # docstrings
"DTZ003", # Use datetime.now(tz=) instead of datetime.utcnow()
"DTZ004", # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts)
"E", # pycodestyle
"F", # pyflakes/autoflake
"G", # flake8-logging-format
"I", # isort
"ICN001", # import concentions; {name} should be imported as {asname}
"ISC001", # Implicitly concatenated string literals on one line
"N804", # First argument of a class method should be named cls
"N805", # First argument of a method should be named self
"N815", # Variable {name} in class scope should not be mixedCase
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
"PLW", # pylint
"Q000", # Double quotes found but single quotes preferred
"RUF006", # Store a reference to the return value of asyncio.create_task
"S102", # Use of exec detected
"S103", # bad-file-permissions
"S108", # hardcoded-temp-file
"S306", # suspicious-mktemp-usage
"S307", # suspicious-eval-usage
"S313", # suspicious-xmlc-element-tree-usage
"S314", # suspicious-xml-element-tree-usage
"S315", # suspicious-xml-expat-reader-usage
"S316", # suspicious-xml-expat-builder-usage
"S317", # suspicious-xml-sax-usage
"S318", # suspicious-xml-mini-dom-usage
"S319", # suspicious-xml-pull-dom-usage
"S320", # suspicious-xmle-tree-usage
"S601", # paramiko-call
"S602", # subprocess-popen-with-shell-equals-true
"S604", # call-with-shell-equals-true
"S608", # hardcoded-sql-expression
"S609", # unix-command-wildcard-injection
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"SIM201", # Use {left} != {right} instead of not {left} == {right}
"SIM208", # Use {expr} instead of not (not {expr})
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
"SIM401", # Use get from dict with default instead of an if block
"T100", # Trace found: {name} used
"T20", # flake8-print
"TID251", # Banned imports
"TRY004", # Prefer TypeError exception for invalid type
"TRY302", # Remove exception handler; error is immediately re-raised
"UP", # pyupgrade
"W", # pycodestyle
]
ignore = [
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
# Ignore ignored, as the rule is now back in preview/nursery, which cannot
# be ignored anymore without warnings.
# https://github.com/astral-sh/ruff/issues/7491
# "PLC1901", # Lots of false positives
# False positives https://github.com/astral-sh/ruff/issues/5386
"PLC0208", # Use a sequence type instead of a `set` when iterating over values
"PLR0911", # Too many return statements ({returns} > {max_returns})
"PLR0912", # Too many branches ({branches} > {max_branches})
"PLR0913", # Too many arguments to function call ({c_args} > {max_args})
"PLR0915", # Too many statements ({statements} > {max_statements})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"UP006", # keep type annotation style as is
"UP007", # keep type annotation style as is
# Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"path/to/file.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pydoclint]
style = 'google'
exclude = '\.git|\.venv|__init__.py|tests|docs'
require-return-section-when-returning-nothing = false
check-return-types = true
allow-init-docstring = true
arg-type-hints-in-docstring = true
skip-checking-short-docstrings = false
check-class-attributes = false