-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
250 lines (234 loc) · 6.92 KB
/
Copy pathpyproject.toml
File metadata and controls
250 lines (234 loc) · 6.92 KB
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
[tool.poetry]
name = "kdp"
# This version is managed by semantic-release and will be updated automatically during release
version = "1.11.2"
documentation = "https://unicolab.github.io/keras-data-processor/"
repository = "https://github.com/UnicoLab/keras-data-processor"
description = "Data Preprocessing model based on Keras preprocessing layers"
authors = ["Piotr Laczkowski <piotr.laczkowski@gmail.com>"]
license = "MIT"
readme = "README.md"
include = ["docs/getting-started/imgs/kdp_logo.png"]
keywords = ["keras", "tensorflow", "preprocessing", "tabular", "feature-engineering"]
# Poetry derives the Python-version and license classifiers from the fields
# above; only the ones it cannot infer are listed here.
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
# The package uses PEP 604 unions (`X | Y`) in annotations that are evaluated at
# import time, so 3.10 is the real floor -- `import kdp` fails on 3.9.
python = ">=3.10,<4.0"
tensorflow = "^2.18.0"
# Declared explicitly rather than inherited from TensorFlow: the package targets
# the Keras 3 API directly (`import keras`) instead of the `tf.keras`
# compatibility shim, so the requirement belongs here.
keras = ">=3.5,<4.0"
numpy = ">=1.22.0"
pandas = "^2.2.0"
loguru = "^0.7.2"
[tool.poetry.group.dev.dependencies]
pre-commit = "^3.6.0"
ipython = "^8.8.0"
pytest = "^8.0.0"
pytest-cov = "^4.1.0"
pytest-mock = "^3.12.0"
pytest-xdist = "^3.5.0"
pytest-benchmark = "^4.0.0"
pytest-timeout = "^2.2.0"
pytest-sugar = "^0.9.7"
pytest-html = "^4.1.1"
pytest-parallel = "^0.1.1"
parameterized = "^0.9.0"
psutil = "^5.9.0"
ipykernel = "^6.29.3"
pydot = "^2.0.0"
scipy = "^1.12.0"
# Used by the scripts in examples/, which are referenced from the docs and were
# not runnable from a plain `poetry install`.
matplotlib = "^3.8.0"
scikit-learn = "^1.4.0"
[tool.poetry.group.doc.dependencies]
mkdocs = "^1.5.3"
mkdocs-material = "^9.5.3"
mkdocs-material-extensions = ">=1.3.1"
mkdocs-gen-files = "^0.5.0"
mkdocstrings-python = "^0.9.0"
mkdocstrings = {extras = ["python"], version = "^0.24.0"}
mkdocs-redirects = "^1.2.2"
mike = ">=2.0.0"
griffe = "^0.25.0"
# Pytest is configured by pytest.ini (plus the pytest-fast/parallel/ultrafast
# variants). A [tool.pytest.ini_options] block used to live here too, but
# pytest.ini takes precedence over pyproject.toml, so it never applied -- which
# hid the fact that it set the invalid key `python_paths` (the option is
# `pythonpath`) and omitted the `micro` and `smoke` markers that CI selects
# under --strict-markers.
[tool.coverage.run]
branch = true
omit = [
"*/__init__.py",
"*/test_*.py",
"*/tests/*.py",
"*/conftest.py",
"*/venv/*",
"*/virtualenv/*",
"*/.venv/*",
"*/.virtualenv/*",
"*/env/*",
"*/.env/*",
"*/setup.py"
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == '__main__':",
"logger",
"try",
"except",
"^\\s*self\\.\\w+(:\\s*[^=]+)?\\s*=.*$",
"continue",
]
[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
[tool.ruff]
# Matches the formatter default the codebase is written against.
line-length = 88
indent-width = 4
target-version = "py310"
extend-unsafe-fixes = ["D"]
[tool.ruff.lint]
# List of rules: https://docs.astral.sh/ruff/rules
select = [
# flake8-builtins
"A",
# flake8-commas
"COM812",
# flake8-comprehensions
"C4",
# pydocstyle
"D",
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# flake8-implicit-str-concat
"ISC",
# pep8-naming
"N",
# flake8-annotations
"ANN",
# flake8-async
"ASYNC",
# flake8-bandid selected
"S",
# flake8-print
"T20",
# flake8-return
"RET",
# flake8-simplify
"SIM",
# flake8-unused-arguments
"ARG",
# flake8-use-pathlib
"PTH",
# eradicate
"ERA",
# pandas-vet
"PD",
]
ignore = [
"D100",
"D101",
"D104",
"D106",
# missing-type-self
"ANN101",
# missing-type-cls
"ANN102",
# missing-type-kwargs
"ANN003",
# utf-8 encoding skip
"UP009",
# First argument of a method should be named `self`
"N805",
# 1 blank line required between summary line and description
"D205",
# Missing return type annotation for special method `__init__`
"ANN204",
# Avoid using the generic variable name `df` for DataFrames
"PD901",
# Unnecessary assignment to `df` before `return` statement
"RET504",
# commented code
"ERA001",
# Star-arg unpacking after a keyword argument is strongly discouraged
"B026",
# Missing type annotation for function argument `self`
"ANN001",
# Dynamically typed expressions (typing.Any) are disallowed in `wrapper`
"ANN401",
# Unnecessary `elif` after `return` statement
"RET505",
# Within an `except` clause, raise exceptions with `raise
"B904",
"PD013",
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
docstring-code-format = true
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-unused-arguments]
# `layer_creator` callables and Keras hooks accept **kwargs they never read.
ignore-variadic-names = true
[tool.ruff.lint.pycodestyle]
# The formatter wraps code at `line-length`; prose in docstrings and comments is
# allowed to run wider before E501 fires.
max-line-length = 120
[tool.ruff.lint.per-file-ignores]
# `*` does not cross directory separators, so the previous "**/{test,docs}/*"
# pattern silently missed everything under test/layers/ and friends.
"test/**" = ["ALL"]
"docs/**" = ["ALL"]
# Developer entry points: printing to stdout is the point, os.path is fine in a
# one-off script, and they are not part of the published API surface.
"scripts/**" = ["T20", "ANN", "D", "N806", "PTH", "S603", "S607"]
# `X_train` and friends are the conventional ML spelling.
"examples/**" = ["T20", "ANN", "D", "N806", "PTH"]
# Keras fixes the signatures of `call`, `build` and `__init__`: `training` and
# `**kwargs` must be accepted whether or not a given layer reads them, and the
# `tf.while_loop` condition callable must accept the full loop-variable tuple.
"kdp/layers/**" = ["ARG002"]
"kdp/moe.py" = ["ARG002"]