pyproject.toml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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.9"
  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.9",
  23. "Programming Language :: Python :: 3.10",
  24. "Programming Language :: Python :: 3.11",
  25. "Programming Language :: Python :: 3.12",
  26. "Programming Language :: Python :: 3.13",
  27. "Programming Language :: Python :: 3.14",
  28. "Topic :: Security :: Cryptography",
  29. "Topic :: System :: Archiving :: Backup",
  30. ]
  31. license = "BSD-3-Clause"
  32. license-files = ["LICENSE", "AUTHORS"]
  33. dependencies = [
  34. # We are rather picky about msgpack versions, because a good working msgpack is
  35. # very important for Borg, see: https://github.com/borgbackup/borg/issues/3753
  36. # Please note:
  37. # Using any other msgpack version is not supported by Borg development and
  38. # any feedback related to issues caused by this will be ignored.
  39. "msgpack >=1.0.3, <=1.1.1",
  40. "packaging",
  41. ]
  42. # Note for package maintainers: If you package BorgBackup for distribution,
  43. # please (if available) add pyfuse3 (preferably) or llfuse as a requirement.
  44. # "borg mount" needs one of them to work.
  45. # If neither is available, do not require it; most of BorgBackup will work.
  46. [project.optional-dependencies]
  47. llfuse = ["llfuse >= 1.3.8"]
  48. pyfuse3 = ["pyfuse3 >= 3.1.1"]
  49. nofuse = []
  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/1.4-maint/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>=77.0.0", "setuptools_scm>=8", "wheel", "pkgconfig", "Cython>=3.0.3"]
  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.ruff]
  78. line-length = 120
  79. target-version = "py39"
  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. "setup.py" = ["E501"]
  115. "scripts/make.py" = ["E501"]
  116. "src/borg/archive.py" = ["E501", "F401"]
  117. "src/borg/archiver.py" = ["E501", "F401", "E722", "E741"]
  118. "src/borg/cache.py" = ["E501", "E722"]
  119. "src/borg/crypto/key.py" = ["E501", "F401"]
  120. "src/borg/crypto/keymanager.py" = ["E501", "F401"]
  121. "src/borg/crypto/nonces.py" = ["E501"]
  122. "src/borg/fuse.py" = ["E501", "E722"]
  123. "src/borg/fuse_impl.py" = ["F811"]
  124. "src/borg/helpers/__init__.py" = ["F401"]
  125. "src/borg/helpers/checks.py" = ["F401"]
  126. "src/borg/helpers/manifest.py" = ["E501"]
  127. "src/borg/helpers/misc.py" = ["F401", "E722"]
  128. "src/borg/helpers/parseformat.py" = ["E501", "F401", "E741"]
  129. "src/borg/helpers/process.py" = ["F401"]
  130. "src/borg/locking.py" = ["E501", "E722"]
  131. "src/borg/platform/__init__.py" = ["F401", "F811"]
  132. "src/borg/remote.py" = ["E501"]
  133. "src/borg/repository.py" = ["E501", "F401"]
  134. "src/borg/shellpattern.py" = ["E501"]
  135. "src/borg/testsuite/__init__.py" = ["E501", "F401"]
  136. "src/borg/testsuite/archiver.py" = ["E501", "E722", "F401"]
  137. "src/borg/testsuite/benchmark.py" = ["F811", "F401"]
  138. "src/borg/testsuite/chunker.py" = ["E501"]
  139. "src/borg/testsuite/crypto.py" = ["E501", "E741"]
  140. "src/borg/testsuite/file_integrity.py" = ["F401"]
  141. "src/borg/testsuite/hashindex.py" = ["F401"]
  142. "src/borg/testsuite/helpers.py" = ["E501"]
  143. "src/borg/testsuite/key.py" = ["F401"]
  144. "src/borg/testsuite/locking.py" = ["E501", "E722", "F401"]
  145. "src/borg/testsuite/platform.py" = ["E501", "F811", "F401"]
  146. "src/borg/testsuite/repository.py" = ["E501", "F401"]
  147. "src/borg/upgrader.py" = ["E501"]
  148. [tool.pytest.ini_options]
  149. python_files = "testsuite/*.py"
  150. markers = [
  151. "allow_cache_wipe",
  152. ]
  153. # tox configuration - if you change anything here, run this to verify:
  154. # fakeroot -u tox --recreate
  155. [tool.tox]
  156. min_version = "4.19"
  157. requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
  158. # Important: when adding/removing Python versions here,
  159. # also update the section "Test environments with different FUSE implementations" accordingly.
  160. env_list = ["py{39,310,311,312,313,314}-{none,fuse2,fuse3}", "ruff"]
  161. # Base configuration for test environments
  162. [tool.tox.env_run_base]
  163. description = "Run tests with pytest"
  164. package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
  165. deps = ["-rrequirements.d/development.txt"]
  166. commands = [
  167. ["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]
  168. ]
  169. pass_env = ["*"] # fakeroot -u needs some env vars
  170. labels = ["test"]
  171. # Base configuration for package building
  172. [tool.tox.env_pkg_base]
  173. pass_env = ["*"] # needed by tox4, so env vars are visible for building borg
  174. # Test environments with different FUSE implementations
  175. [tool.tox.env.py39-none]
  176. [tool.tox.env.py39-fuse2]
  177. set_env = {BORG_FUSE_IMPL = "llfuse"}
  178. extras = ["llfuse"]
  179. [tool.tox.env.py39-fuse3]
  180. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  181. extras = ["pyfuse3"]
  182. [tool.tox.env.py310-none]
  183. [tool.tox.env.py310-fuse2]
  184. set_env = {BORG_FUSE_IMPL = "llfuse"}
  185. extras = ["llfuse"]
  186. [tool.tox.env.py310-fuse3]
  187. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  188. extras = ["pyfuse3"]
  189. [tool.tox.env.py311-none]
  190. [tool.tox.env.py311-fuse2]
  191. set_env = {BORG_FUSE_IMPL = "llfuse"}
  192. extras = ["llfuse"]
  193. [tool.tox.env.py311-fuse3]
  194. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  195. extras = ["pyfuse3"]
  196. [tool.tox.env.py312-none]
  197. [tool.tox.env.py312-fuse2]
  198. set_env = {BORG_FUSE_IMPL = "llfuse"}
  199. extras = ["llfuse"]
  200. [tool.tox.env.py312-fuse3]
  201. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  202. extras = ["pyfuse3"]
  203. [tool.tox.env.py313-none]
  204. [tool.tox.env.py313-fuse2]
  205. set_env = {BORG_FUSE_IMPL = "llfuse"}
  206. extras = ["llfuse"]
  207. [tool.tox.env.py313-fuse3]
  208. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  209. extras = ["pyfuse3"]
  210. [tool.tox.env.py314-none]
  211. [tool.tox.env.py314-fuse2]
  212. set_env = {BORG_FUSE_IMPL = "llfuse"}
  213. extras = ["llfuse"]
  214. [tool.tox.env.py314-fuse3]
  215. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  216. extras = ["pyfuse3"]
  217. [tool.tox.env.ruff]
  218. description = "Run ruff linter and formatter"
  219. skip_install = true
  220. deps = ["ruff"]
  221. commands = [
  222. ["ruff", "check", "."]
  223. ]
  224. labels = ["lint"]
  225. [tool.coverage.run]
  226. branch = true
  227. disable_warnings = ["module-not-measured"]
  228. source = ["src/borg"]
  229. omit = [
  230. "*/borg/__init__.py",
  231. "*/borg/__main__.py",
  232. "*/borg/_version.py",
  233. "*/borg/fuse.py",
  234. "*/borg/support/*",
  235. "*/borg/testsuite/*",
  236. "*/borg/hash_sizes.py",
  237. ]
  238. [tool.coverage.report]
  239. exclude_lines = [
  240. "pragma: no cover",
  241. "pragma: freebsd only",
  242. "pragma: unknown platform only",
  243. "def __repr__",
  244. "raise AssertionError",
  245. "raise NotImplementedError",
  246. "if 0:",
  247. "if __name__ == .__main__.:",
  248. ]
  249. ignore_errors = true