pyproject.toml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. "License :: OSI Approved :: BSD License",
  16. "Operating System :: POSIX :: BSD :: FreeBSD",
  17. "Operating System :: POSIX :: BSD :: OpenBSD",
  18. "Operating System :: POSIX :: BSD :: NetBSD",
  19. "Operating System :: MacOS :: MacOS X",
  20. "Operating System :: POSIX :: Linux",
  21. "Programming Language :: Python",
  22. "Programming Language :: Python :: 3",
  23. "Programming Language :: Python :: 3.9",
  24. "Programming Language :: Python :: 3.10",
  25. "Programming Language :: Python :: 3.11",
  26. "Programming Language :: Python :: 3.12",
  27. "Programming Language :: Python :: 3.13",
  28. "Programming Language :: Python :: 3.14",
  29. "Topic :: Security :: Cryptography",
  30. "Topic :: System :: Archiving :: Backup",
  31. ]
  32. license = {text="BSD"}
  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>=64", "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. env_list = ["py{39,310,311,312,313,314}-{none,fuse2,fuse3}", "ruff"]
  159. # Base configuration for test environments
  160. [tool.tox.env_run_base]
  161. description = "Run tests with pytest"
  162. package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
  163. deps = ["-rrequirements.d/development.txt"]
  164. commands = [
  165. ["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]
  166. ]
  167. pass_env = ["*"] # fakeroot -u needs some env vars
  168. labels = ["test"]
  169. # Base configuration for package building
  170. [tool.tox.env_pkg_base]
  171. pass_env = ["*"] # needed by tox4, so env vars are visible for building borg
  172. # Test environments with different FUSE implementations
  173. [tool.tox.env."py{39,310,311,312,313,314}-fuse2"]
  174. description = "Run tests with llfuse (FUSE2) implementation"
  175. set_env = {BORG_FUSE_IMPL = "llfuse"}
  176. deps = ["-rrequirements.d/development.txt", "llfuse"]
  177. labels = ["test", "fuse"]
  178. [tool.tox.env."py{39,310,311,312,313,314}-fuse3"]
  179. description = "Run tests with pyfuse3 (FUSE3) implementation"
  180. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  181. deps = ["-rrequirements.d/development.txt", "pyfuse3"]
  182. labels = ["test", "fuse"]
  183. [tool.tox.env."py{39,310,311,312,313,314}-none"]
  184. description = "Run tests without FUSE support"
  185. deps = ["-rrequirements.d/development.txt"]
  186. labels = ["test", "nofuse"]
  187. [tool.tox.env.ruff]
  188. description = "Run ruff linter and formatter"
  189. skip_install = true
  190. deps = ["ruff"]
  191. commands = [
  192. ["ruff", "check", "."]
  193. ]
  194. labels = ["lint"]
  195. [tool.coverage.run]
  196. branch = true
  197. disable_warnings = ["module-not-measured"]
  198. source = ["src/borg"]
  199. omit = [
  200. "*/borg/__init__.py",
  201. "*/borg/__main__.py",
  202. "*/borg/_version.py",
  203. "*/borg/fuse.py",
  204. "*/borg/support/*",
  205. "*/borg/testsuite/*",
  206. "*/borg/hash_sizes.py",
  207. ]
  208. [tool.coverage.report]
  209. exclude_lines = [
  210. "pragma: no cover",
  211. "pragma: freebsd only",
  212. "pragma: unknown platform only",
  213. "def __repr__",
  214. "raise AssertionError",
  215. "raise NotImplementedError",
  216. "if 0:",
  217. "if __name__ == .__main__.:",
  218. ]
  219. ignore_errors = true