pyproject.toml 8.5 KB

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