pyproject.toml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [build-system]
  2. requires = ["setuptools", "pkgconfig", "Cython", "setuptools_scm[toml]>=6.2"]
  3. build-backend = "setuptools.build_meta"
  4. [tool.setuptools_scm]
  5. # make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files
  6. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052
  7. # https://github.com/borgbackup/borg/issues/6875
  8. write_to = "src/borg/_version.py"
  9. write_to_template = "__version__ = version = {version!r}\n"
  10. [tool.black]
  11. line-length = 120
  12. skip-magic-trailing-comma = true
  13. [tool.ruff]
  14. line-length = 120
  15. target-version = "py39"
  16. # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
  17. select = ["E", "F"]
  18. # for reference ...
  19. # E402 module level import not at top
  20. # E501 line too long
  21. # F401 import unused
  22. # F405 undefined or defined from star imports
  23. # F811 redef of unused var
  24. # borg code style guidelines:
  25. # Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373
  26. ignore = ["E203", "F405", "E402"]
  27. # Allow autofix for all enabled rules (when `--fix`) is provided.
  28. fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
  29. unfixable = []
  30. # Exclude a variety of commonly ignored directories.
  31. exclude = [
  32. ".cache",
  33. ".eggs",
  34. ".git",
  35. ".git-rewrite",
  36. ".idea",
  37. ".mypy_cache",
  38. ".ruff_cache",
  39. ".tox",
  40. "build",
  41. "dist",
  42. ]
  43. # Allow unused variables when underscore-prefixed.
  44. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  45. # Code style violation exceptions:
  46. # please note that the values are adjusted so that they do not cause failures
  47. # with existing code. if you want to change them, you should first fix all
  48. # ruff failures that appear with your change.
  49. [tool.ruff.per-file-ignores]
  50. "setup_docs.py" = ["E501"]
  51. "src/borg/archive.py" = ["E501"]
  52. "src/borg/archiver/help_cmd.py" = ["E501"]
  53. "src/borg/cache.py" = ["E501"]
  54. "src/borg/helpers/__init__.py" = ["F401"]
  55. "src/borg/platform/__init__.py" = ["F401"]
  56. "src/borg/testsuite/archiver/disk_full.py" = ["F811"]
  57. "src/borg/testsuite/archiver/return_codes.py" = ["F811"]
  58. "src/borg/testsuite/benchmark.py" = ["F811"]
  59. "src/borg/testsuite/platform.py" = ["F811"]