-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpyproject.toml
201 lines (182 loc) · 6.78 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
[project]
name = "PIS"
version = "25.0.1-rc.1"
description = "Open Targets Pipeline Input Stage application"
readme = "README.md"
requires-python = ">=3.13"
authors = [{ name = "Open Targets core team", email = "[email protected]" }]
license = { text = "Apache-2.0" }
dependencies = [
"elasticsearch==7.17.12", # must be ^7.0.0 to be compatible with chembl es server
"filelock==3.16.1",
"google-cloud-storage==2.19.0",
"jq==1.8.0",
"loguru==0.7.3",
"pydantic==2.10.4",
"PyYAML==6.0.2",
"requests==2.32.3",
"urllib3==2.3.0", # must be <= 2 for elasticsearch, see overrides
]
[tool.uv]
override-dependencies = ["urllib3>=2.2.0"]
[dependency-groups]
dev = ["ruff==0.8.6", "deptry==0.21.2"]
[project.optional-dependencies]
test = [
"coverage==7.6.10",
"freezegun==1.5.1",
"pytest==8.3.4",
"pytest-mock==3.14.0",
]
docs = [
"autodoc-pydantic>=2.2.0",
"sphinx-autobuild>=2024.10.3",
"sphinx-issues>=5.0.0",
"sphinx-rtd-theme>=3.0.2",
"sphinx>=8.1.3",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
exclude = ["**/*_test.py"]
[project.scripts]
pis = "pis.core:main"
pipeline_input_stage = "pis.core:main"
platform_input_support = "pis.core:main" # legacy name
[tool.pytest.ini_options]
testpaths = ["src/pis"]
filterwarnings = "ignore:.*google._upb*" # warning from google protobuf library
[tool.coverage.report]
omit = ["src/pis/**/*_test.py"]
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"]
[tool.deptry]
extend_exclude = ["[0-9a-zA-Z_/]+_test.py"]
pep621_dev_dependency_groups = ["dev", "test", "docs"]
[tool.ruff]
target-version = 'py312'
line-length = 120
preview = true
[tool.ruff.format]
quote-style = 'single'
[tool.ruff.lint]
select = [
'E', # pycodestyle
'F', # pyflakes
'N', # pep8-naming
'Q', # flake8-quotes
'RUF', # ruff
'UP', # pyupgrade
'D', # pydocstyle
'D212', # flake8-docstrings
'S', # flake8-bandit
'C4', # flake8-comprehensions
'INT', # flake8-gettext
'LOG', # flake8-logging
'G', # flake8-logging-format
'I', # isort
'ICN001', # flake8-import-conventions
'B', # flake8-bugbear
'A001', # flake8-builtins
'COM', # flake8-commas
'T10', # flake8-debugger
'T20', # flake8-todo
'EXE', # flake8-executable
'ISC', # flake8-implicit-str-concat
'PIE', # flake8-pie
'PT', # flake8-pytest-style
'RSE', # flake8-raise
'RET504', # flake8-return
'SIM', # flake8-simplify
'TID', # flake8-tidy-imports
'PGH', # pygrep-hooks
'PL', # pylint
'TRY', # tryceratops
'PERF', # perflint
'FURB', # refurb
'W', # pycodestyle
]
ignore = [
'D107', # we don't want to document every single init method
'D213', # we prefer D212
'G004', # we don't care about logging format
'E226', # allow omitting whitespace around arithmetic operators
'E731', # allow assigning lambdas (it's useful for single-line functions defined inside other functions)
'RUF012', # ultra-noisy and dicts in classvars are very common
'RUF015', # not always more readable
'UP038', # it looks kind of weird and it slower than a tuple
'S101', # we use asserts outside tests, and do not run python with `-O` (also see B011)
'S311', # false positives, it does not care about the context
'S324', # all our md5/sha1 usages are for non-security purposes
'S404', # useless, triggers on *all* subprocess imports
'S403', # there's already a warning on using pickle, no need to have one for the import
'S405', # we don't use lxml in unsafe ways
'S603', # useless, triggers on *all* subprocess calls: https://github.com/astral-sh/ruff/issues/4045
'S607', # we trust the PATH to be sane
'B011', # we don't run python with `-O` (also see S101)
'B904', # possibly useful but too noisy
'COM812', # trailing commas on multiline lists are nice, but we have 2.5k violations
'PIE807', # `lambda: []` is much clearer for `load_default` in schemas
'PT011', # very noisy
'PT015', # nice for tests but not so nice elsewhere
'PT018', # ^ likewise
'S301', # we trust our pickled data
'SIM102', # sometimes nested ifs are more readable
'SIM103', # sometimes this is more readable (especially when checking multiple conditions)
'SIM105', # try-except-pass is faster and people are used to it
'SIM108', # noisy ternary
'SIM114', # sometimes separate ifs are more readable (especially if they just return a bool)
'SIM117', # nested context managers may be more readable
'PLC0415', # local imports are there for a reason
'PLC2701', # some private imports are needed
'PLR09', # too-many-<whatever> is just noisy
'PLR0913', # very noisy
'PLR2004', # extremely noisy and generally annoying
'PLR6201', # sets are faster (by a factor of 10!) but it's noisy and we're in nanoseconds territory
'PLR6301', # extremely noisy and generally annoying
'PLW0108', # a lambda often makes it more clear what you actually want
'PLW1510', # we often do not care about the status code of commands
'PLW1514', # we expect UTF8 environments everywhere
'PLW1641', # false positives with SA comparator classes
'PLW2901', # noisy and reassigning to the loop var is usually intentional
'TRY002', # super noisy, and those exceptions are pretty exceptional anyway
'TRY003', # super noisy and also useless w/ werkzeugs http exceptions
'TRY300', # kind of strange in many cases
'TRY301', # sometimes doing that is actually useful
'TRY400', # not all exceptions need exception logging
'PERF203', # noisy, false positives, and not applicable for 3.11+
'FURB113', # less readable
'FURB140', # less readable and actually slower in 3.12+
]
extend-safe-fixes = [
'RUF005', # we typically don't deal with objects overriding `__add__` or `__radd__`
'C4', # they seem pretty safe
'UP008', # ^ likewise
'D200', # ^ likewise
'D400', # ^ likewise
'PT014', # duplicate test case parametrizations are never intentional
'RSE102', # we do not use `raise func()` (with `func` returning the exception instance)
'RET504', # looks pretty safe
'SIM110', # ^ likewise
'PERF102', # ^ likewise
]
[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'
multiline-quotes = 'double'
docstring-quotes = 'double'
avoid-escape = true
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = 'tuple'
parametrize-values-type = 'list'
parametrize-values-row-type = 'tuple'
[tool.ruff.lint.per-file-ignores]
'**/*_test.py' = ['S108', 'S602', 'D']
'**/__init__.py' = ['F401']
'**/tasks/*.py' = ['D102']
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = ["pis.tasks.report", "pis.manifest.task_reporter.report"]