pyproject.toml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. [project]
  2. name = "borgbackup"
  3. dynamic = ["version", "readme"]
  4. authors = [{name="The Borg Collective (see AUTHORS file)"}]
  5. maintainers = [
  6. {name="Thomas Waldmann", email="tw@waldmann-edv.de"},
  7. ]
  8. description = "Deduplicated, encrypted, authenticated and compressed backups"
  9. requires-python = ">=3.10"
  10. keywords = ["backup", "borgbackup"]
  11. classifiers = [
  12. "Development Status :: 4 - Beta",
  13. "Environment :: Console",
  14. "Intended Audience :: System Administrators",
  15. "Operating System :: POSIX :: BSD :: FreeBSD",
  16. "Operating System :: POSIX :: BSD :: OpenBSD",
  17. "Operating System :: POSIX :: BSD :: NetBSD",
  18. "Operating System :: MacOS :: MacOS X",
  19. "Operating System :: POSIX :: Linux",
  20. "Programming Language :: Python",
  21. "Programming Language :: Python :: 3",
  22. "Programming Language :: Python :: 3.10",
  23. "Programming Language :: Python :: 3.11",
  24. "Programming Language :: Python :: 3.12",
  25. "Programming Language :: Python :: 3.13",
  26. "Programming Language :: Python :: 3.14",
  27. "Topic :: Security :: Cryptography",
  28. "Topic :: System :: Archiving :: Backup",
  29. ]
  30. license = "BSD-3-Clause"
  31. license-files = ["LICENSE", "AUTHORS"]
  32. dependencies = [
  33. "borghash ~= 0.1.0",
  34. "borgstore ~= 0.3.0",
  35. "msgpack >=1.0.3, <=1.1.1",
  36. "packaging",
  37. "platformdirs >=3.0.0, <5.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0,
  38. "platformdirs >=2.6.0, <5.0.0; sys_platform != 'darwin'", # for others: 2.6+ works consistently.
  39. "argon2-cffi",
  40. ]
  41. [project.optional-dependencies]
  42. llfuse = ["llfuse >= 1.3.8"]
  43. pyfuse3 = ["pyfuse3 >= 3.1.1"]
  44. nofuse = []
  45. [project.urls]
  46. "Homepage" = "https://borgbackup.org/"
  47. "Bug Tracker" = "https://github.com/borgbackup/borg/issues"
  48. "Documentation" = "https://borgbackup.readthedocs.io/"
  49. "Repository" = "https://github.com/borgbackup/borg"
  50. "Changelog" = "https://github.com/borgbackup/borg/blob/master/docs/changes.rst"
  51. [project.scripts]
  52. borg = "borg.archiver:main"
  53. borgfs = "borg.archiver:main"
  54. [tool.setuptools]
  55. # See also the MANIFEST.in file.
  56. # We want to install all the files in the package directories...
  57. include-package-data = true
  58. [tool.setuptools.packages.find]
  59. where = ["src"]
  60. [tool.setuptools.exclude-package-data]
  61. # ...except the source files which have been compiled (C extensions):
  62. "*" = ["*.c", "*.h", "*.pyx"]
  63. [build-system]
  64. requires = ["setuptools>=77.0.0", "wheel", "pkgconfig", "Cython>=3.0.3", "setuptools_scm[toml]>=6.2"]
  65. build-backend = "setuptools.build_meta"
  66. [tool.setuptools_scm]
  67. # make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files
  68. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052
  69. # https://github.com/borgbackup/borg/issues/6875
  70. write_to = "src/borg/_version.py"
  71. write_to_template = "__version__ = version = {version!r}\n"
  72. [tool.black]
  73. line-length = 120
  74. skip-magic-trailing-comma = true
  75. [tool.ruff]
  76. line-length = 120
  77. target-version = "py310"
  78. # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
  79. select = ["E", "F"]
  80. # for reference ...
  81. # E402 module level import not at top
  82. # E501 line too long
  83. # F401 import unused
  84. # F405 undefined or defined from star imports
  85. # F811 redef of unused var
  86. # borg code style guidelines:
  87. # Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373
  88. ignore = ["E203", "F405", "E402"]
  89. # Allow autofix for all enabled rules (when `--fix`) is provided.
  90. 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"]
  91. unfixable = []
  92. # Exclude a variety of commonly ignored directories.
  93. exclude = [
  94. ".cache",
  95. ".eggs",
  96. ".git",
  97. ".git-rewrite",
  98. ".idea",
  99. ".mypy_cache",
  100. ".ruff_cache",
  101. ".tox",
  102. "build",
  103. "dist",
  104. ]
  105. # Allow unused variables when underscore-prefixed.
  106. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  107. # Code style violation exceptions:
  108. # please note that the values are adjusted so that they do not cause failures
  109. # with existing code. if you want to change them, you should first fix all
  110. # ruff failures that appear with your change.
  111. [tool.ruff.per-file-ignores]
  112. "scripts/make.py" = ["E501"]
  113. "src/borg/archive.py" = ["E501"]
  114. "src/borg/archiver/help_cmd.py" = ["E501"]
  115. "src/borg/cache.py" = ["E501"]
  116. "src/borg/helpers/__init__.py" = ["F401"]
  117. "src/borg/platform/__init__.py" = ["F401"]
  118. "src/borg/testsuite/archiver/disk_full_test.py" = ["F811"]
  119. "src/borg/testsuite/archiver/return_codes_test.py" = ["F811"]
  120. "src/borg/testsuite/benchmark_test.py" = ["F811"]
  121. "src/borg/testsuite/platform_test.py" = ["F811"]
  122. [tool.pytest.ini_options]
  123. markers = []
  124. [tool.mypy]
  125. python_version = "3.10"
  126. strict_optional = false
  127. local_partial_types = true
  128. show_error_codes = true
  129. files = "src/borg/**/*.py"
  130. [[tool.mypy.overrides]]
  131. module = [
  132. "msgpack.*",
  133. "llfuse",
  134. "pyfuse3",
  135. "trio",
  136. "borg.crypto.low_level",
  137. "borg.platform.*",
  138. ]
  139. ignore_missing_imports = true
  140. [tool.tox]
  141. requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
  142. env_list = ["py{310,311,312,313,314}-{none,fuse2,fuse3}", "docs", "ruff", "mypy", "bandit"]
  143. [tool.tox.env_run_base]
  144. package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
  145. deps = ["-rrequirements.d/development.txt"]
  146. commands = [["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]]
  147. pass_env = ["*"] # fakeroot -u needs some env vars
  148. [tool.tox.env_pkg_base]
  149. pass_env = ["*"] # needed by tox4, so env vars are visible for building borg
  150. # Environment-specific configurations
  151. [tool.tox.env."py{310,311,312,313,314}-fuse2"]
  152. set_env = {BORG_FUSE_IMPL = "llfuse"}
  153. deps = ["-rrequirements.d/development.txt", "llfuse"]
  154. [tool.tox.env."py{310,311,312,313,314}-fuse3"]
  155. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  156. deps = ["-rrequirements.d/development.txt", "pyfuse3"]
  157. [tool.tox.env."py{310,311,312,313,314}-none"]
  158. deps = ["-rrequirements.d/development.txt"]
  159. [tool.tox.env.ruff]
  160. skip_install = true
  161. deps = ["ruff"]
  162. commands = [["ruff", "check", "."]]
  163. [tool.tox.env.mypy]
  164. deps = ["pytest", "mypy", "pkgconfig"]
  165. commands = [["mypy", "--ignore-missing-imports"]]
  166. [tool.tox.env.docs]
  167. change_dir = "docs"
  168. deps = ["sphinx", "sphinxcontrib-jquery", "guzzle_sphinx_theme"]
  169. commands = [["sphinx-build", "-n", "-v", "-W", "--keep-going", "-b", "html", "-d", "{envtmpdir}/doctrees", ".", "{envtmpdir}/html"]]
  170. [tool.bandit]
  171. exclude_dirs = [".cache", ".eggs", ".git", ".git-rewrite", ".idea", ".mypy_cache", ".ruff_cache", ".tox", "build", "dist", "src/borg/testsuite"]
  172. skips = [
  173. "B101", # skip assert warnings, we do not allow running borg with assertions disabled.
  174. "B404", # do not warn about just import subprocess
  175. ]
  176. [tool.tox.env.bandit]
  177. skip_install = true
  178. deps = ["bandit[toml]"]
  179. commands = [["bandit", "-r", "src/borg", "-c", "pyproject.toml"]]
  180. [tool.coverage.run]
  181. branch = true
  182. disable_warnings = ["module-not-measured", "no-ctracer"]
  183. source = ["src/borg"]
  184. omit = [
  185. "*/borg/__init__.py",
  186. "*/borg/__main__.py",
  187. "*/borg/_version.py",
  188. "*/borg/fuse.py",
  189. "*/borg/support/*",
  190. "*/borg/testsuite/*",
  191. "*/borg/hash_sizes.py",
  192. ]
  193. [tool.coverage.report]
  194. exclude_lines = [
  195. "pragma: no cover",
  196. "pragma: freebsd only",
  197. "pragma: unknown platform only",
  198. "def __repr__",
  199. "raise AssertionError",
  200. "raise NotImplementedError",
  201. "if 0:",
  202. "if __name__ == .__main__.:",
  203. ]
  204. ignore_errors = true