|
| 1 | +[build-system] |
| 2 | +requires = ["setuptools>=68", "wheel"] |
| 3 | +build-backend = "setuptools.build_meta" |
| 4 | + |
| 5 | +# NOTE: Project metadata, dependencies and extras are still declared in |
| 6 | +# ``setup.py`` for now to keep a single source of truth and avoid duplicating |
| 7 | +# the install-requires list. ``setup.py`` defines: |
| 8 | +# |
| 9 | +# * ``install_requires`` (mandatory deps) |
| 10 | +# * ``extras_require`` (``gguf``, ``onnx``, ``mlx``, ``triton``, ``flash``, |
| 11 | +# ``hub``, ``full``, ``dev``) |
| 12 | +# * ``entry_points`` (the ``quantllm`` CLI) |
| 13 | +# |
| 14 | +# Adding a ``[project]`` table here would silently override those values in |
| 15 | +# editable installs, which has tripped up several contributors. Once the |
| 16 | +# ``setup.py`` migration to PEP 621 is complete, this file will own the full |
| 17 | +# project metadata. |
| 18 | + |
| 19 | +[tool.ruff] |
| 20 | +line-length = 120 |
| 21 | +target-version = "py310" |
| 22 | +extend-exclude = [ |
| 23 | + "build", |
| 24 | + "dist", |
| 25 | + ".venv", |
| 26 | + "examples/output", |
| 27 | + "docs/_build", |
| 28 | +] |
| 29 | + |
| 30 | +[tool.ruff.lint] |
| 31 | +# Minimal "blocker" ruleset enforced on every push. The codebase predates |
| 32 | +# ruff, so we deliberately start small -- this catches genuine bugs (syntax |
| 33 | +# errors, undefined names, broken comparisons) without producing a giant |
| 34 | +# reformatting diff. Stricter rules can be opted-in incrementally. |
| 35 | +select = [ |
| 36 | + "E9", # pycodestyle runtime errors (syntax, indentation) |
| 37 | + "F63", # invalid `is` comparisons / `not in` issues |
| 38 | + "F7", # syntax errors in expressions |
| 39 | + "F82", # undefined names actually used |
| 40 | + "F811", # redefinition of unused name |
| 41 | + "F821", # undefined-name reference |
| 42 | + "F823", # local variable referenced before assignment |
| 43 | + # NOTE: F841 (unused local) is intentionally NOT enabled yet. The existing |
| 44 | + # codebase has several intentional unused-binding patterns (progress |
| 45 | + # tasks, documenting intent, etc.) and fixing them is out of scope. |
| 46 | + "B006", # mutable default arguments (genuine bug class) |
| 47 | + "B017", # ``assertRaises(Exception)`` -- masks real failures |
| 48 | +] |
| 49 | +ignore = [ |
| 50 | + "E501", # line length: not enforced strictly |
| 51 | + "E402", # module-level import not at top of file |
| 52 | + "E741", # ambiguous variable names |
| 53 | +] |
| 54 | + |
| 55 | +[tool.ruff.lint.per-file-ignores] |
| 56 | +"tests/*" = ["F401", "F811", "F841"] |
| 57 | +"quantllm/__init__.py" = ["F401", "E402"] |
| 58 | +"quantllm/core/__init__.py" = ["F401"] |
| 59 | + |
| 60 | +[tool.pytest.ini_options] |
| 61 | +minversion = "7.0" |
| 62 | +testpaths = ["tests"] |
| 63 | +addopts = "-ra --strict-markers" |
| 64 | +filterwarnings = [ |
| 65 | + "ignore::DeprecationWarning", |
| 66 | + "ignore::FutureWarning", |
| 67 | +] |
0 commit comments