-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpyproject.toml
137 lines (126 loc) · 3.11 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
# package
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "imgx"
authors = [
{name = "Yunguan Fu", email = "[email protected]"},
]
description = "A Jax-based deep learning toolkit for biomedical applications."
requires-python = ">=3.9"
license = {text = "Apache-2.0"}
version = "0.3.2"
[project.scripts]
imgx_train="imgx.run_train:main"
imgx_valid="imgx.run_valid:main"
imgx_test="imgx.run_test:main"
[tool.setuptools]
packages = ["imgx"]
package-dir = {"imgx"="./imgx"}
# pytest
[tool.pytest.ini_options]
markers = [
"slow", # slow unit tests
"integration", # integration tests
]
# pre-commit
[tool.isort]
py_version=39
known_third_party = ["SimpleITK","absl","chex","hydra","jax","numpy","omegaconf","optax",
"pandas","pytest","ray","rdkit","setuptools","tensorflow","tensorflow_datasets","tree","wandb"]
multi_line_output = 3
force_grid_wrap = 0
line_length = 100
include_trailing_comma = true
use_parentheses = true
[tool.mypy]
python_version = "3.9"
warn_unused_configs = true
ignore_missing_imports = true
disable_error_code = ["misc","attr-defined","call-arg"]
show_error_codes = true
files = "**/*.py"
[tool.ruff]
line-length = 100
# Enable Pyflakes `E` and `F` codes by default.
select = [
"F", # Pyflakes
"E", "W", # pycodestyle
"UP", # pyupgrade
"N", # pep8-naming
# flake8
"YTT",
"ANN",
"S",
"BLE",
"B",
"A",
"C4",
"T10",
"EM",
"ISC",
"ICN",
"T20",
"PT",
"Q",
"RET",
"SIM",
"TID",
"ARG",
"DTZ",
"PIE",
"PGH", # pygrep-hooks
"RUF", # ruff
"PLC", "PLE", "PLR", "PLW", # Pylint
]
ignore = [
"ANN002", # MissingTypeArgs
"ANN003", # MissingTypeKwargs
"ANN101", # MissingTypeSelf
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"RET504", # Unnecessary variable assignment before `return` statement
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLE0605", # Invalid format for `__all__`, must be `tuple` or `list`
"PLR0912", # Too many branches
]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.9
target-version = "py39"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.per-file-ignores]
"test_*.py" = ["S101"]
"*_test.py" = ["S101"]
[tool.ruff.pydocstyle]
# Use Google-style docstrings.
convention = "google"
[tool.ruff.pylint]
allow-magic-value-types = ["int", "str"]