forked from wiesnim9/CSSFinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
306 lines (287 loc) · 12.1 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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
[tool.poetry] # ANCHOR: tool.poetry
name = "cssfinder"
version = "0.8.0"
description = "Tool for Hilbert-Schmidt distance calculation with Gilbert algorithm."
authors = [
"Krzysztof Wiśniewski <[email protected]>",
"Marcin Wieśniak <[email protected]>",
]
repository = "https://github.com/argmaster/CSSFinder"
readme = "README.md"
[tool.poetry.dependencies] # ANCHOR: tool.poetry.dependencies
python = "^3.8"
click = "^8.1.3"
numpy = "^1.23.0"
numba = "^0.56.4"
pendulum = "^2.1.2"
scipy = "^1.9.3"
pydantic = { extras = ["email"], version = "^1.10.5" }
typing-extensions = "^4.5.0"
rich = "^13.3.1"
jsonref = "^1.1.0"
matplotlib = "^3.7.0"
pandas = ">=1.5.3,<3.0.0"
weasyprint = "^58.1"
psutil = "^5.9.4"
pytermgui = "^7.3.0"
jinja2 = "^3.1.2"
cssfinder-backend-numpy = { version = ">=0.5.0", optional = true }
cssfinder-backend-rust = { version = ">=0.1.1", optional = true }
filelock = "^3.12.0"
threadpoolctl = "^3.1.0"
[tool.poetry.group.dev.dependencies] # ANCHOR: tool.poetry.dev-dependencies
black = ">=22.12,<24.0"
isort = "^5.11.4"
docformatter = { extras = ["tomli"], version = "==1.5.1" }
pytest = "^7.2.0"
autoflake = "^2.0.0"
pre-commit = ">=2.20,<4.0"
pytest-cov = "^4.0.0"
mypy = "^1.0.1"
ptpython = "^3.0.22"
typing-extensions = "^4.4.0"
snakeviz = "^2.1.1"
poethepoet = ">=0.18.1,<0.20.0"
poetry = "^1.3.2"
jinja2 = "^3.1.2"
ruff = ">=0.0.254"
ipykernel = "^6.21.3"
cssfinder-backend-numpy = ">=0.5.0"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.5.2"
mkdocs-material = "^9.1.21"
mkdocstrings = { extras = ["python"], version = ">=0.22,<0.25" }
mkdocs-literate-nav = "^0.6.0"
mkdocs-macros-plugin = "^1.0.2"
mkdocs-gen-files = "^0.5.0"
pygments = "^2.15.1"
pymdown-extensions = "^10.3"
mike = "^1.1.2"
[tool.poetry.extras]
backend-numpy = ["cssfinder-backend-numpy"]
backend-rust = ["cssfinder-backend-rust"]
[tool.poetry.scripts]
cssfinder = "cssfinder.cli:main"
cssf = "cssfinder.cli:main"
[tool.poe.tasks]
release = { script = "scripts.release:main" }
install-hooks = [
{ cmd = "poetry install --sync --with=docs --no-ansi" },
{ cmd = "poetry run pre-commit install --install-hooks --overwrite" },
]
run-hooks = [
{ cmd = "poetry install --sync --with=docs --no-ansi" },
{ cmd = "pre-commit run --all-files -v" },
]
build = [
{ cmd = "poetry build --format=wheel --no-ansi" },
{ cmd = "poetry build --format=sdist --no-ansi" },
]
gen-numpy-impl = { script = "scripts.gen_numpy_impl:main" }
test-system = { cmd = "pytest test/test_system -v --cov" }
test-reports = { cmd = "pytest test/test_reports -v --cov" }
type-check = [
{ cmd = "poetry install --sync --with=docs --no-ansi" },
{ cmd = "mypy cssfinder test scripts" },
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options] # ANCHOR: tool.pytest
minversion = "7.2.0"
norecursedirs = [
"external",
"data",
".venv",
".env",
"env",
"venv",
"cssfinder/examples",
]
python_files = ["test_*.py", "*_test.py"]
testpaths = ["cssfinder", "test"]
addopts = """ -ra --strict-markers --doctest-modules --log-level=DEBUG --cov-report=term-missing:skip-covered"""
filterwarnings = []
[tool.isort] # ANCHOR: tool.isort
# ---------------------------------------------------------------------------- #
# https://pycqa.github.io/isort/docs/configuration/options.html #
# ---------------------------------------------------------------------------- #
profile = "black"
known_first_party = "cssfinder"
# src_paths = ["cssfinder", "tests"]
line_length = 88
[tool.black] # ANCHOR: tool.black
# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
extend-exclude = "(external)"
[tool.mypy] # ANCHOR: tool.mypy
# ---------------------------------------------------------------------------- #
# https://mypy.readthedocs.io/en/stable/config_file.html #
# https://mypy.readthedocs.io/en/stable/command_line.html #
# https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html #
# ---------------------------------------------------------------------------- #
python_version = "3.8"
# A regular expression that matches file names, directory names and paths which
# mypy should ignore while recursively discovering files to check. Use forward
#slashes (/) as directory separators on all platforms.
exclude = ["external/", ".tox/", ".venv/", ".vscode/"]
# ---------------------------------------------------------------------------- #
# Import discovery #
# ---------------------------------------------------------------------------- #
# Suppresses error messages about imports that cannot be resolved.
ignore_missing_imports = true
# Directs what to do with imports when the imported module is found as a .py file
# and not part of the files, modules and packages provided on the command line.
# The four possible values are normal, silent, skip and error. For explanations
# see the discussion for the --follow-imports command line flag.
follow_imports = "normal"
# Enables reporting error messages generated within installed packages (see
# :pep:`561` for more details on distributing type information). Those error
# messages are suppressed by default, since you are usually not able to
# control errors in 3rd party code.
no_silence_site_packages = false
# ---------------------------------------------------------------------------- #
# Disallow dynamic typing #
# ---------------------------------------------------------------------------- #
# Disallows usage of types that come from unfollowed imports (anything imported from
# an unfollowed import is automatically given a type of ``Any``).
disallow_any_unimported = false
# Disallows all expressions in the module that have type ``Any``.
disallow_any_expr = false
# Disallows functions that have ``Any`` in their signature after decorator transformation.
disallow_any_decorated = false
# Disallows explicit ``Any`` in type positions such as type annotations and generic
# type parameters.
disallow_any_explicit = false
# Disallows usage of generic types that do not specify explicit type parameters.
disallow_any_generics = false
# Disallows subclassing a value of type ``Any``.
disallow_subclassing_any = false
# ---------------------------------------------------------------------------- #
# Untyped definitions and calls #
# ---------------------------------------------------------------------------- #
# Disallows calling functions without type annotations from functions with type
# annotations.
disallow_untyped_calls = false
# 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
# Reports an error whenever a function with type annotations is decorated with a
# decorator without annotations.
disallow_untyped_decorators = false
# ---------------------------------------------------------------------------- #
# None and Optional handling #
# ---------------------------------------------------------------------------- #
# Changes the treatment of arguments with a default value of ``None`` by not implicitly
# making their type :py:data:`~typing.Optional`.
no_implicit_optional = true
# Enables or disables strict Optional checks. If False, mypy treats ``None``
# as compatible with every type.
strict_optional = true
# ---------------------------------------------------------------------------- #
# Warnings #
# ---------------------------------------------------------------------------- #
# warns about casting an expression to its inferred type.
warn_redundant_casts = true
# Warns about unneeded ``# type: ignore`` comments.
warn_unused_ignores = false
# Shows errors for missing return statements on some execution paths.
no_warn_no_return = false
# Shows a warning when returning a value with type ``Any`` from a function
# declared with a non- ``Any`` return type.
warn_return_any = true
# Shows a warning when encountering any code inferred to be unreachable or
# redundant after performing type analysis.
warn_unreachable = true
# ---------------------------------------------------------------------------- #
# Miscellaneous strictness flags #
# ---------------------------------------------------------------------------- #
# Causes mypy to suppress errors caused by not being able to fully
# infer the types of global and class variables.
allow_untyped_globals = false
# Allows variables to be redefined with an arbitrary type, as long as the redefinition
# is in the same block and nesting level as the original definition.
# Example where this can be useful:
allow_redefinition = true
# Disallows inferring variable type for ``None`` from two assignments in different scopes.
# This is always implicitly enabled when using the :ref:`mypy daemon <mypy_daemon>`.
local_partial_types = false
# By default, imported values to a module are treated as exported and mypy allows
# other modules to import them. When false, mypy will not re-export unless
# the item is imported using from-as or is included in ``__all__``. Note that mypy
# treats stub files as if this is always disabled. For example:
no_implicit_reexport = false
# Prohibit equality checks, identity checks, and container checks between
# non-overlapping types.
strict_equality = true
# ---------------------------------------------------------------------------- #
# https://mypy.readthedocs.io/en/stable/error_codes.html#error-codes #
# ---------------------------------------------------------------------------- #
# Allows disabling one or multiple error codes globally.
# disable_error_code =
# Allows enabling one or multiple error codes globally.
enable_error_code = "redundant-expr"
# ---------------------------------------------------------------------------- #
# Configuring error messages #
# ---------------------------------------------------------------------------- #
# Prefixes each error with the relevant context.
show_error_context = true
# Shows column numbers in error messages.
show_column_numbers = true
# hows error codes in error messages. See :ref:`error-codes` for more information.
show_error_codes = true
# Use visually nicer output in error messages: use soft word wrap,
# show source code snippets, and show error location markers.
pretty = true
# Shows error messages with color enabled.
color_output = true
# Shows a short summary line after error messages.
error_summary = true
# Show absolute paths to files.
show_absolute_path = true
[tool.ruff]
show-fixes = true
target-version = "py38"
src = ["src", "test"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN401",
"ANN101",
"ANN102",
"D203",
"D205",
"D213",
"UP007",
"UP006",
"TCH001",
"D105", # Adding docstrings in all magic methods doesn't make sense, as usually they are just boilerplate to support operators.
"FIX002",
"D107", # Adding docstring to __init__ doesn't make sense when class already has its docstring.
"T201", # print() function is extensively used to interact with user.
"S603", # `subprocess` call: check for execution of untrusted input.
"S607", # Starting a process with a partial executable path.
]
[tool.ruff.lint.pylint]
max-args = 8
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"FrozenGeneralModel",
"BaseModel",
]