pyproject.toml 1.6 KB
Newer Older
Tim Dettmers's avatar
Tim Dettmers committed
1
[build-system]
2
requires = [ "setuptools", "wheel" ]
Tim Dettmers's avatar
Tim Dettmers committed
3
build-backend = "setuptools.build_meta"
Titus von Koeller's avatar
Titus von Koeller committed
4
5
6
7
8
9
10

[tool.ruff]
src = [
    "bitsandbytes",
    "tests",
    "benchmarking"
]
11
12
13
14
target-version = "py38"
line-length = 119

[tool.ruff.lint]
Titus von Koeller's avatar
Titus von Koeller committed
15
16
select = [
    "B",    # bugbear: security warnings
17
18
    "E",    # pycodestyle (error)
    "W",    # pycodestyle (warning)
Titus von Koeller's avatar
Titus von Koeller committed
19
20
21
22
23
24
25
    "F",    # pyflakes
    "I",    # isort
    "ISC",  # implicit string concatenation
    "UP",   # alert you when better syntax is available in your python version
    "RUF",  # the ruff developer's own rules
]
ignore = [
Aarni Koskela's avatar
Aarni Koskela committed
26
27
    "B007",  # Loop control variable not used within the loop body (TODO: enable)
    "B028",  # Warning without stacklevel (TODO: enable)
Titus von Koeller's avatar
Titus von Koeller committed
28
    "E501",  # Supress line-too-long warnings: trust yapf's judgement on this one.
Aarni Koskela's avatar
Aarni Koskela committed
29
30
31
32
33
    "E701",  # Multiple statements on one line (TODO: enable)
    "E712",  # Allow using if x == False, as it's not always equivalent to if x.
    "E731",  # Do not use lambda
    "F841",  # Local assigned but not used (TODO: enable, these are likely bugs)
    "RUF012",  # Mutable class attribute annotations
Titus von Koeller's avatar
Titus von Koeller committed
34
35
]

36
[tool.ruff.lint.extend-per-file-ignores]
Aarni Koskela's avatar
Aarni Koskela committed
37
38
39
40
41
42
43
44
45
46
47
"**/__init__.py" = ["F401"]  # allow unused imports in __init__.py
"{benchmarking,tests}/**/*.py" = [
    "B007",
    "B011",
    "B023",
    "E701",
    "E731",
    "F841",
    "UP030",
]

48
[tool.ruff.lint.isort]
Titus von Koeller's avatar
Titus von Koeller committed
49
50
51
combine-as-imports = true
detect-same-package = true
force-sort-within-sections = true
52
53
54
55
56
57
58
59
60
known-first-party = ["bitsandbytes"]

[[tool.mypy.overrides]]
module = "triton.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "scipy.stats"
ignore_missing_imports = true