-
Notifications
You must be signed in to change notification settings - Fork 16
/
pyproject.toml
280 lines (238 loc) · 8.59 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
271
272
273
274
275
276
277
278
279
280
# Based on https://packaging.python.org/en/latest/tutorials/packaging-projects/
[build-system]
requires = ["setuptools>=42", "wheel", "versioneer[toml]==0.29", "tomli"]
build-backend = "setuptools.build_meta"
[project]
name = "sophios"
dynamic = ["version"]
authors = [{name = "Jake Fennick", email = "[email protected]"}]
description = "DSL for inferring the edges of a CWL workflow DAG"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
dependencies = [
# NOTE: This 'graphviz' refers to the python bindings to the underlying
# system binary graphviz package (i.e. the `dot` executable) which we need to
# install separately using either `conda install graphviz` or `sudo apt install graphviz`.
# This 'graphviz' is equivalent to `conda install python-graphviz` or
# `sudo apt install python3-graphviz` ONLY.
"graphviz",
"jsonschema",
"pyyaml",
"requests",
"mergedeep",
"networkx",
"cwl-utils>=0.32",
# CommandInputParameter attr changed from `type_` to `type` and back to `type_`
# between versions 0.30, 0.31, 0.32
# See https://github.com/common-workflow-language/cwl-utils/releases/
"typeguard",
"pydantic>=2.6",
"pydantic-settings",
"pydantic[email]",
"docker",
# FYI also need uidmap to run podman rootless
"podman",
# We are using the official release for these packages for now
"toil[cwl]",
"fastapi",
"python-jose",
"uvicorn",
"referencing"
]
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.urls]
Homepage = "https://github.com/PolusAI/workflow-inference-compiler"
"Bug Tracker" = "https://github.com/PolusAI/workflow-inference-compiler/issues"
[project.optional-dependencies]
test = [
"pre-commit",
"py", # See https://github.com/kevlened/pytest-parallel/pull/119
"pytest",
"pytest-cov",
"pytest-parallel",
"coverage",
"mypy",
"numpy",
"scipy",
"pylint",
"autopep8",
"pre-commit",
"hypothesis",
"hypothesis-jsonschema",
]
# NOTE: The following list was generated using the command
# mypy --install-types
# When updating this list, also update .pre-commit-config.yaml
# Alternatively, the --non-interactive flag can be used install these automatically.
# See https://mypy.readthedocs.io/en/stable/command_line.html#miscellaneous
mypy-types = [
"lxml-stubs",
"types-Pillow",
"types-PyYAML",
"types-Pygments",
"types-colorama",
"types-decorator",
"types-docutils",
"types-html5lib",
"types-jsonschema",
"types-psutil",
"types-python-jose",
"types-pytz",
"types-redis",
"types-requests",
"types-setuptools",
"types-six",
"types-urllib3",
]
# NOTE: toil and cwltool have a somewhat continuous release model. However,
# there can be updates and bugfixes in main that have not yet been released.
# If you need to install from source, simply run `pip install .[runners-src]`
# This will overwrite the existing release versions, so if you want to revert
# to the release versions, `pip uninstall toil cwltool` and then `pip install .`
# toml language has problem with underscore in array name
runners = [
"toil[cwl]",
"cwl-utils",
]
runners-src = [
"toil[cwl] @ git+https://github.com/sameeul/toil.git",
"cwltool @ git+https://github.com/sameeul/cwltool.git",
"cwl-utils @ git+https://github.com/sameeul/cwl-utils.git",
]
# See docs/requirements.txt
doc = [
"sphinx",
"myst-parser",
"sphinx-autodoc-typehints",
]
plots = ["matplotlib"]
cyto = ["ipycytoscape"] # only for DAG visualization
all_except_runner_src = ["sophios[test,doc,plots,cyto,mypy-types]"]
all = ["sophios[test,doc,plots,cyto,runners-src,mypy-types]"]
[project.scripts]
sophios = "sophios.main:main"
cwl_subinterpreter = "sophios.cwl_subinterpreter:main"
cwltool_filterlog = "sophios.run_local:cwltool_main"
# Need an extra entrypoint to avoid mixing up WIC cli flags with cwltool cli flags
cwltool_filterlog_pf = "sophios.run_local:cwltool_main_pf"
# Need the following defined in order to make versioneer work with git tags
[tool.setuptools.dynamic]
version = {attr = "sophios.__version__"}
[tool.setuptools]
package-dir = {"" = "src"}
include-package-data = true
[tool.setuptools.packages.find]
where = ["src"]
namespaces = true
[tool.setuptools.package-data]
"*" = ["*.txt"]
"sophios" = ["**/*.json"]
[tool.aliases]
test = "pytest --workers 8"
[tool.versioneer]
VCS = "git"
style = "pep440-pre"
versionfile_source = "src/sophios/_version.py"
versionfile_build = "sophios/_version.py"
tag_prefix = "v"
[tool.build_sphinx]
source_dir = "docs"
# Based on https://packaging.python.org/en/latest/tutorials/packaging-projects/
[tool.mypy]
# See https://docs.pydantic.dev/latest/integrations/mypy/#enabling-the-plugin
plugins = ["pydantic.mypy"]
# See https://mypy.readthedocs.io/en/stable/running_mypy.html#follow-imports
follow_imports = "normal"
# Specifies the paths to use, after trying the paths from MYPYPATH environment variable.
# mypy_path = ''
# NOTE: mypy requires __init__.py files and/or namespace_packages = True. Otherwise, you will get
# "error: Cannot find implementation or library stub for module named 'module'"
namespace_packages = true
# Disallows defining functions without type annotations or with incomplete type annotations.
disallow_untyped_defs = true
# Disallows defining functions with incomplete type annotations.
disallow_incomplete_defs = true
# Type-checks the interior of functions without type annotations.
check_untyped_defs = true
# Warns about casting an expression to its inferred type.
warn_redundant_casts = true
# Warns about unneeded `# type: ignore` comments.
warn_unused_ignores = true
# Shows a warning when returning a value with type Any from a function declared with a non-Any return type.
warn_return_any = true
# A regular expression that matches file names, directory names and paths which
# mypy should ignore while recursively discovering files to check.
# Note that if you want to exclude multiple regexes, you have to concatenate
# them with |, and sometimes it doesn't even work. It is much easier to
# just use the [mypy-*] notation below with ignore_errors = True
# exclude =
# Allows disabling one or multiple error codes globally.
# disable_error_code = ["ignore-missing-imports"] # comma-separated list of strings
# Disallows usage of generic types that do not specify explicit type parameters.
# disallow_any_generics = False # NOTE: This one tends to generate a medium number of warnings, so enable with caution.
# Disallows all expressions in the module that have type Any.
# disallow_any_expr = False # NOTE: This one tends to generate a MASSIVE number of warnings, so enable with caution.
# Ignores all non-fatal errors.
ignore_errors = false
# Probably because it is in the root directory, I was unable to add
# versioneer to the exclude=regex above, but this works.
[[tool.mypy.overrides]]
module = ["sophios._version", "versioneer"]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"graphviz.*",
"mergedeep.*",
"networkx.*",
"matplotlib.*",
"ipywidgets.*",
"scipy.*",
"ruamel.*",
"toil.*",
"version.*",
"podman.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
markers = [
"fast: (i.e. for maximum speed, use 'pytest -m fast')",
"slow: (i.e. for medium speed, use 'pytest -m \"not slow\"')",
"serial: (These tests CANNOT be run in parallel with --workers n > 1)",
]
addopts = ""
[tool.codespell]
skip = "*.svg,*.html"
ignore-words = "codespellwords.txt"
# See https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html
[tool.pylint.main]
# TODO: Add class and module docstrings.
disable=[
"missing-class-docstring",
"missing-module-docstring",
"dangerous-default-value",
"pointless-string-statement",
"unused-variable",
"fixme",
"invalid-name",
]
# Specify a score threshold to be exceeded before program exits with error.
# Try to keep the threshold near the default of a perfect 10/10.
# However, for some reason, on github actions CI/CD the scores are slightly
# lower and fails, so let's use 9.25 instead of 9.50 for now.
fail-under=9.25
[tool.pylint.format]
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines='^\s*(# )?(See )?(and )?<?https?://\S+>?$'
# Maximum number of characters on a single line.
max-line-length=120
# Maximum number of lines in a module.
max-module-lines=750
[tool.pylint.miscellaneous]
# List of note tags to take in consideration, separated by a comma.
notes="FIXME,XXX,TODO"