pyproject.toml 4.38 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
[project]
name = "bitsandbytes"
dynamic = ["version"]
description = "k-bit optimizers and matrix multiplication routines."
authors = [{name="Tim Dettmers", email="dettmers@cs.washington.edu"}]
10
11
12
13
maintainers = [
    {name="Titus von Köller", email="titus@huggingface.co"},
    {name="Matthew Douglas", email="matthew.douglas@huggingface.co"}
]
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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",
33
    # "Operating System :: MacOS",
34
35
36
37
38
39
40
41
42
43
44
    "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 = [
45
    "torch>=2.2,<3",
46
47
48
    "numpy>=1.17"
]

49
50
51
52
53
54
[project.urls]
homepage = "https://github.com/bitsandbytes-foundation/bitsandbytes"
changelog = "https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/CHANGELOG.md"
docs = "https://huggingface.co/docs/bitsandbytes/main"
issues = "https://github.com/bitsandbytes-foundation/bitsandbytes/issues"

55
56
57
58
59
60
[project.optional-dependencies]
benchmark = ["pandas", "matplotlib"]
docs = ["hf-doc-builder==0.5.0"]
dev = [
    "bitsandbytes[test]",
    "build>=1.0.0,<2",
61
    "ruff==0.9.6",
62
63
64
65
    "pre-commit>=3.5.0,<4",
    "wheel>=0.42,<1"
]
test = [
66
67
68
    "einops~=0.8.0",
    "lion-pytorch==0.2.3",
    "pytest~=8.3",
69
70
71
72
73
74
75
76
    "scipy>=1.10.1,<2; python_version < '3.9'",
    "scipy>=1.11.4,<2; python_version >= '3.9'",
    "transformers>=4.30.1,<5"
]

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

77
78
79
[tool.setuptools.packages.find]
include = ["bitsandbytes*"]

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[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
98
99
100
101
102
103
[tool.ruff]
src = [
    "bitsandbytes",
    "tests",
    "benchmarking"
]
104
105
106
107
target-version = "py38"
line-length = 119

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

130
[tool.ruff.lint.extend-per-file-ignores]
Aarni Koskela's avatar
Aarni Koskela committed
131
132
133
134
135
136
137
138
139
140
141
"**/__init__.py" = ["F401"]  # allow unused imports in __init__.py
"{benchmarking,tests}/**/*.py" = [
    "B007",
    "B011",
    "B023",
    "E701",
    "E731",
    "F841",
    "UP030",
]

142
[tool.ruff.lint.isort]
Titus von Koeller's avatar
Titus von Koeller committed
143
144
145
combine-as-imports = true
detect-same-package = true
force-sort-within-sections = true
146
147
148
149
150
151
152
153
154
known-first-party = ["bitsandbytes"]

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

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