-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
91 lines (82 loc) · 2.93 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
[project]
name = "xdsl-bench"
version = "0.1.0"
description = "Benchmarks for xDSL"
readme = "README.md"
requires-python = ">=3.10.0"
[dependency-groups]
asv = [
"asv>=0.6.4",
"versioneer>=0.29",
]
dev = [
"mypy>=1.13.0",
"ruff>=0.8.3",
"tqdm>=4.67.1",
]
profile = [
"viztracer>=1.0.0",
"snakeviz>=2.2.2",
"xdsl @ file:///${PROJECT_ROOT}/xdsl",
"flameprof>=0.4",
]
[tool.uv]
default-groups = ["asv", "dev", "profile"]
## TODO: Can we use this instead of `@` syntax?
# [tool.uv.sources]
# xdsl = { path = "xdsl" }
[build-system]
requires = ["setuptools>=42", "wheel", "versioneer[toml]"]
build-backend = "setuptools.build_meta"
[tool.mypy]
python_version = "3.10"
strict = true
ignore_missing_imports = true
implicit_reexport = true
warn_redundant_casts = true
warn_unused_ignores = true
# https://blog.wolt.com/engineering/2021/09/30/professional-grade-mypy-configuration/
disallow_untyped_defs = true
disallow_any_unimported = true
no_implicit_optional = true
check_untyped_defs = true
warn_return_any = true
show_error_codes = true
# Manually loosen rough edges of `mypy`, particularly for pytest fixtures
disallow_untyped_decorators = false
# # Explicitly allow missing imports for untyped modules where required
[[tool.mypy.overrides]]
module = "viztracer.*"
ignore_missing_imports = true
[tool.ruff]
# Support Python 3.10+.
target-version = "py310"
src = ["src/", "tests/"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
### From https://github.com/jerry-git/pytest-split/blob/master/pyproject.toml
"ANN", # Type hints related, let mypy handle these.
"COM812", # "Trailing comma missing". If black is happy, I'm happy.
"E501", # "Line too long". If black is happy, I'm happy.
"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"
"S101", # "Use of `assert` detected"
"SIM108", # "Use ternary operator ...". Ternary is harmful for readability in some cases.
"TRY003", # "Avoid specifying long messages outside the exception class"
# "D", # Docstrings related. We want to keep this to replace `pydocstyle`
"D203", # Disable incompatible docstring rules to avoid warnings
"D212", # "
"ISC001", # May cause conflicts with auto-formatter
### Edmund's preferences
"T201", # Allow print statements!
"ERA001", # Don't remove commented out code
"TD", # Allow TODOs in code (controversial, I know...)
"FBT001", "FBT002", # Get off my back about boolean positional arguments
"FIX002", # "
"INP001", # "Add an `__init__.py`". The `test` directory should be a namespace package (https://stackoverflow.com/a/8450858)!
# "I", # Ignore import sorting, as we using `isort` instead, as it has more functionality
]
# Use Google-style docstrings.
pydocstyle.convention = "google"