pyproject.toml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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.2",
  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. "shtab>=1.8.0",
  41. ]
  42. [project.optional-dependencies]
  43. llfuse = ["llfuse >= 1.3.8"]
  44. pyfuse3 = ["pyfuse3 >= 3.1.1"]
  45. mfusepy = ["mfusepy"]
  46. nofuse = []
  47. s3 = ["borgstore[s3] ~= 0.3.0"]
  48. sftp = ["borgstore[sftp] ~= 0.3.0"]
  49. cockpit = ["textual>=6.8.0"] # might also work with older versions, untested
  50. [project.urls]
  51. "Homepage" = "https://borgbackup.org/"
  52. "Bug Tracker" = "https://github.com/borgbackup/borg/issues"
  53. "Documentation" = "https://borgbackup.readthedocs.io/"
  54. "Repository" = "https://github.com/borgbackup/borg"
  55. "Changelog" = "https://github.com/borgbackup/borg/blob/master/docs/changes.rst"
  56. [project.scripts]
  57. borg = "borg.archiver:main"
  58. borgfs = "borg.archiver:main"
  59. [tool.setuptools]
  60. # See also the MANIFEST.in file.
  61. # We want to install all the files in the package directories...
  62. include-package-data = true
  63. [tool.setuptools.packages.find]
  64. where = ["src"]
  65. [tool.setuptools.exclude-package-data]
  66. # ...except the source files which have been compiled (C extensions):
  67. "*" = ["*.c", "*.h", "*.pyx"]
  68. [build-system]
  69. requires = ["setuptools>=78.1.1", "wheel", "pkgconfig", "Cython>=3.0.3", "setuptools_scm[toml]>=6.2"]
  70. build-backend = "setuptools.build_meta"
  71. [tool.setuptools_scm]
  72. # Make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files.
  73. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052
  74. # https://github.com/borgbackup/borg/issues/6875
  75. write_to = "src/borg/_version.py"
  76. write_to_template = "__version__ = version = {version!r}\n"
  77. [tool.black]
  78. line-length = 120
  79. skip-magic-trailing-comma = true
  80. [tool.ruff]
  81. line-length = 120
  82. target-version = "py310"
  83. # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
  84. select = ["E", "F"]
  85. # for reference ...
  86. # E402 module level import not at top
  87. # E501 line too long
  88. # F401 import unused
  89. # F405 undefined or defined from star imports
  90. # F811 redef of unused var
  91. # borg code style guidelines:
  92. # Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373.
  93. ignore = ["E203", "F405", "E402"]
  94. # Allow autofix for all enabled rules (when `--fix` is provided).
  95. 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"]
  96. unfixable = []
  97. # Exclude a variety of commonly ignored directories.
  98. exclude = [
  99. ".cache",
  100. ".eggs",
  101. ".git",
  102. ".git-rewrite",
  103. ".idea",
  104. ".mypy_cache",
  105. ".ruff_cache",
  106. ".tox",
  107. "build",
  108. "dist",
  109. ]
  110. # Allow unused variables when underscore-prefixed.
  111. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  112. # Code style violation exceptions:
  113. # please note that the values are adjusted so that they do not cause failures
  114. # with existing code. if you want to change them, you should first fix all
  115. # ruff failures that appear with your change.
  116. [tool.ruff.per-file-ignores]
  117. "scripts/make.py" = ["E501"]
  118. "src/borg/archive.py" = ["E501"]
  119. "src/borg/archiver/help_cmd.py" = ["E501"]
  120. "src/borg/cache.py" = ["E501"]
  121. "src/borg/helpers/__init__.py" = ["F401"]
  122. "src/borg/platform/__init__.py" = ["F401"]
  123. "src/borg/testsuite/archiver/disk_full_test.py" = ["F811"]
  124. "src/borg/testsuite/archiver/return_codes_test.py" = ["F811"]
  125. "src/borg/testsuite/benchmark_test.py" = ["F811"]
  126. "src/borg/testsuite/platform_test.py" = ["F811"]
  127. [tool.pytest.ini_options]
  128. markers = []
  129. [tool.mypy]
  130. python_version = "3.10"
  131. strict_optional = false
  132. local_partial_types = true
  133. show_error_codes = true
  134. files = "src/borg/**/*.py"
  135. [[tool.mypy.overrides]]
  136. module = [
  137. "msgpack.*",
  138. "llfuse",
  139. "pyfuse3",
  140. "trio",
  141. "borg.crypto.low_level",
  142. "borg.platform.*",
  143. ]
  144. ignore_missing_imports = true
  145. [tool.tox]
  146. requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
  147. # Important: when adding/removing Python versions here,
  148. # also update the section "Test environments with different FUSE implementations" accordingly.
  149. env_list = ["py{310,311,312,313,314}-{none,fuse2,fuse3,mfuse}", "docs", "ruff", "mypy", "bandit"]
  150. [tool.tox.env_run_base]
  151. package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
  152. deps = ["-rrequirements.d/development.txt"]
  153. commands = [["python", "-m", "pytest", "-v", "-n", "{env:XDISTN:auto}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]]
  154. pass_env = ["*"] # fakeroot -u needs some env vars
  155. [tool.tox.env_pkg_base]
  156. pass_env = ["*"] # needed by tox4, so env vars are visible for building borg
  157. # Test environments with different FUSE implementations
  158. [tool.tox.env.py310-none]
  159. [tool.tox.env.py310-fuse2]
  160. set_env = {BORG_FUSE_IMPL = "llfuse"}
  161. extras = ["llfuse", "sftp", "s3"]
  162. [tool.tox.env.py310-fuse3]
  163. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  164. extras = ["pyfuse3", "sftp", "s3"]
  165. [tool.tox.env.py310-mfuse]
  166. set_env = {BORG_FUSE_IMPL = "none"}
  167. extras = ["mfusepy", "sftp", "s3"]
  168. [tool.tox.env.py311-none]
  169. [tool.tox.env.py311-fuse2]
  170. set_env = {BORG_FUSE_IMPL = "llfuse"}
  171. extras = ["llfuse", "sftp", "s3"]
  172. [tool.tox.env.py311-fuse3]
  173. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  174. extras = ["pyfuse3", "sftp", "s3"]
  175. [tool.tox.env.py311-mfuse]
  176. set_env = {BORG_FUSE_IMPL = "none"}
  177. extras = ["mfusepy", "sftp", "s3"]
  178. [tool.tox.env.py312-none]
  179. [tool.tox.env.py312-fuse2]
  180. set_env = {BORG_FUSE_IMPL = "llfuse"}
  181. extras = ["llfuse", "sftp", "s3"]
  182. [tool.tox.env.py312-fuse3]
  183. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  184. extras = ["pyfuse3", "sftp", "s3"]
  185. [tool.tox.env.py312-mfuse]
  186. set_env = {BORG_FUSE_IMPL = "none"}
  187. extras = ["mfusepy", "sftp", "s3"]
  188. [tool.tox.env.py313-none]
  189. [tool.tox.env.py313-fuse2]
  190. set_env = {BORG_FUSE_IMPL = "llfuse"}
  191. extras = ["llfuse", "sftp", "s3"]
  192. [tool.tox.env.py313-fuse3]
  193. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  194. extras = ["pyfuse3", "sftp", "s3"]
  195. [tool.tox.env.py313-mfuse]
  196. set_env = {BORG_FUSE_IMPL = "none"}
  197. extras = ["mfusepy", "sftp", "s3"]
  198. [tool.tox.env.py314-none]
  199. [tool.tox.env.py314-fuse2]
  200. set_env = {BORG_FUSE_IMPL = "llfuse"}
  201. extras = ["llfuse", "sftp", "s3"]
  202. [tool.tox.env.py314-fuse3]
  203. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  204. extras = ["pyfuse3", "sftp", "s3"]
  205. [tool.tox.env.py314-mfuse]
  206. set_env = {BORG_FUSE_IMPL = "none"}
  207. extras = ["mfusepy", "sftp", "s3"]
  208. [tool.tox.env.ruff]
  209. skip_install = true
  210. deps = ["ruff"]
  211. commands = [["ruff", "check", "."]]
  212. [tool.tox.env.mypy]
  213. deps = ["pytest", "mypy", "pkgconfig"]
  214. commands = [["mypy", "--ignore-missing-imports"]]
  215. [tool.tox.env.docs]
  216. change_dir = "docs"
  217. deps = ["sphinx", "sphinxcontrib-jquery", "guzzle_sphinx_theme"]
  218. commands = [["sphinx-build", "-n", "-v", "-W", "--keep-going", "-b", "html", "-d", "{envtmpdir}/doctrees", ".", "{envtmpdir}/html"]]
  219. [tool.bandit]
  220. exclude_dirs = [".cache", ".eggs", ".git", ".git-rewrite", ".idea", ".mypy_cache", ".ruff_cache", ".tox", "build", "dist", "src/borg/testsuite"]
  221. skips = [
  222. "B101", # skip assert warnings, we do not allow running borg with assertions disabled.
  223. "B404", # do not warn about just import subprocess
  224. ]
  225. [tool.tox.env.bandit]
  226. skip_install = true
  227. deps = ["bandit[toml]"]
  228. commands = [["bandit", "-r", "src/borg", "-c", "pyproject.toml"]]
  229. [tool.coverage.run]
  230. branch = true
  231. disable_warnings = ["module-not-measured", "no-ctracer"]
  232. source = ["src/borg"]
  233. omit = [
  234. "*/borg/__init__.py",
  235. "*/borg/__main__.py",
  236. "*/borg/_version.py",
  237. "*/borg/fuse.py",
  238. "*/borg/support/*",
  239. "*/borg/testsuite/*",
  240. "*/borg/hash_sizes.py",
  241. ]
  242. [tool.coverage.report]
  243. exclude_lines = [
  244. "pragma: no cover",
  245. "pragma: freebsd only",
  246. "pragma: unknown platform only",
  247. "def __repr__",
  248. "raise AssertionError",
  249. "raise NotImplementedError",
  250. "if 0:",
  251. "if __name__ == .__main__.:",
  252. ]
  253. ignore_errors = true