pyproject.toml 8.5 KB

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