"src/turbomind/vscode:/vscode.git/clone" did not exist on "816022e451cccef83c93a5c392fd4cbea2b5cffe"
pyproject.toml 4.22 KB
Newer Older
Tim Dettmers's avatar
Tim Dettmers committed
1
[build-system]
2
requires = ["setuptools >= 63.0.0"]
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
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 = "bitsandbytes"
dynamic = ["version"]
description = "k-bit optimizers and matrix multiplication routines."
authors = [{name="Tim Dettmers", email="dettmers@cs.washington.edu"}]
requires-python = ">=3.8"
readme = "README.md"
license = {file="LICENSE"}
keywords = [
    "gpu",
    "optimizers",
    "optimization",
    "8-bit",
    "quantization",
    "compression"
]
classifiers = [
    "Development Status :: 4 - Beta",
    "License :: OSI Approved :: MIT License",
    "Environment :: GPU :: NVIDIA CUDA :: 11",
    "Environment :: GPU :: NVIDIA CUDA :: 12",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "Operating System :: POSIX :: Linux",
    "Operating System :: MacOS",
    "Operating System :: Microsoft :: Windows",
    "Programming Language :: C++",
    "Programming Language :: Python :: Implementation :: CPython",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Scientific/Engineering :: Artificial Intelligence"
]
dependencies = [
    "torch>=1.11,!=1.12.0",
    "numpy>=1.17"
]

[project.optional-dependencies]
benchmark = ["pandas", "matplotlib"]
docs = ["hf-doc-builder==0.5.0"]
dev = [
    "bitsandbytes[test]",
    "build>=1.0.0,<2",
    "ruff==0.6.9",
    "pre-commit>=3.5.0,<4",
    "wheel>=0.42,<1"
]
test = [
    "einops~=0.6.0",
    "lion-pytorch==0.0.6",
    "pytest~=7.4",
    "scipy>=1.10.1,<2; python_version < '3.9'",
    "scipy>=1.11.4,<2; python_version >= '3.9'",
    "transformers>=4.30.1,<5"
]
triton = ["triton~=2.0.0; sys_platform=='linux' and platform_machine=='x86_64'"]

[project.urls]
homepage = "https://github.com/TimDettmers/bitsandbytes"
changelog = "https://github.com/TimDettmers/bitsandbytes/blob/main/CHANGELOG.md"
docs = "https://huggingface.co/docs/bitsandbytes/main"
issues = "https://github.com/TimDettmers/bitsandbytes/issues"

[tool.setuptools]
package-data = { "*" = ["libbitsandbytes*.*"] }

[tool.setuptools.dynamic]
version = {attr = "bitsandbytes.__version__"}

[tool.pytest.ini_options]
addopts = "-rP"
#    ; --cov=bitsandbytes
#    ; # contexts: record which test ran which line; can be seen in html coverage report
#    ; --cov-context=test
#    ; --cov-report html
log_cli = true
log_cli_level = "INFO"
log_file = "logs/pytest.log"
markers = [
    "benchmark: mark test as a benchmark",
    "deprecated: mark test as covering a deprecated feature",
    "slow: mark test as slow",
]

Titus von Koeller's avatar
Titus von Koeller committed
92
93
94
95
96
97
[tool.ruff]
src = [
    "bitsandbytes",
    "tests",
    "benchmarking"
]
98
99
100
101
target-version = "py38"
line-length = 119

[tool.ruff.lint]
Titus von Koeller's avatar
Titus von Koeller committed
102
103
select = [
    "B",    # bugbear: security warnings
104
105
    "E",    # pycodestyle (error)
    "W",    # pycodestyle (warning)
Titus von Koeller's avatar
Titus von Koeller committed
106
107
108
109
110
111
112
    "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
113
114
    "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
115
    "E501",  # Supress line-too-long warnings: trust yapf's judgement on this one.
Aarni Koskela's avatar
Aarni Koskela committed
116
117
118
119
120
    "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
121
    "ISC001",   # single-line-implicit-string-concatenation incompatible with formatter
Titus von Koeller's avatar
Titus von Koeller committed
122
123
]

124
[tool.ruff.lint.extend-per-file-ignores]
Aarni Koskela's avatar
Aarni Koskela committed
125
126
127
128
129
130
131
132
133
134
135
"**/__init__.py" = ["F401"]  # allow unused imports in __init__.py
"{benchmarking,tests}/**/*.py" = [
    "B007",
    "B011",
    "B023",
    "E701",
    "E731",
    "F841",
    "UP030",
]

136
[tool.ruff.lint.isort]
Titus von Koeller's avatar
Titus von Koeller committed
137
138
139
combine-as-imports = true
detect-same-package = true
force-sort-within-sections = true
140
141
142
143
144
145
146
147
148
known-first-party = ["bitsandbytes"]

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

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