pyproject.toml 9.3 KB

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