pyproject.toml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. "Topic :: Security :: Cryptography",
  27. "Topic :: System :: Archiving :: Backup",
  28. ]
  29. license = "BSD-3-Clause"
  30. license-files = ["LICENSE", "AUTHORS"]
  31. dependencies = [
  32. "borghash ~= 0.1.0",
  33. "borgstore ~= 0.3.0",
  34. "msgpack >=1.0.3, <=1.1.0",
  35. "packaging",
  36. "platformdirs >=3.0.0, <5.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0,
  37. "platformdirs >=2.6.0, <5.0.0; sys_platform != 'darwin'", # for others: 2.6+ works consistently.
  38. "argon2-cffi",
  39. ]
  40. [project.optional-dependencies]
  41. llfuse = ["llfuse >= 1.3.8"]
  42. pyfuse3 = ["pyfuse3 >= 3.1.1"]
  43. nofuse = []
  44. [project.urls]
  45. "Homepage" = "https://borgbackup.org/"
  46. "Bug Tracker" = "https://github.com/borgbackup/borg/issues"
  47. "Documentation" = "https://borgbackup.readthedocs.io/"
  48. "Repository" = "https://github.com/borgbackup/borg"
  49. "Changelog" = "https://github.com/borgbackup/borg/blob/master/docs/changes.rst"
  50. [project.scripts]
  51. borg = "borg.archiver:main"
  52. borgfs = "borg.archiver:main"
  53. [tool.setuptools]
  54. # See also the MANIFEST.in file.
  55. # We want to install all the files in the package directories...
  56. include-package-data = true
  57. [tool.setuptools.packages.find]
  58. where = ["src"]
  59. [tool.setuptools.exclude-package-data]
  60. # ...except the source files which have been compiled (C extensions):
  61. "*" = ["*.c", "*.h", "*.pyx"]
  62. [build-system]
  63. requires = ["setuptools>=77.0.0", "wheel", "pkgconfig", "Cython>=3.0.3", "setuptools_scm[toml]>=6.2"]
  64. build-backend = "setuptools.build_meta"
  65. [tool.setuptools_scm]
  66. # make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files
  67. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052
  68. # https://github.com/borgbackup/borg/issues/6875
  69. write_to = "src/borg/_version.py"
  70. write_to_template = "__version__ = version = {version!r}\n"
  71. [tool.black]
  72. line-length = 120
  73. skip-magic-trailing-comma = true
  74. [tool.ruff]
  75. line-length = 120
  76. target-version = "py310"
  77. # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
  78. select = ["E", "F"]
  79. # for reference ...
  80. # E402 module level import not at top
  81. # E501 line too long
  82. # F401 import unused
  83. # F405 undefined or defined from star imports
  84. # F811 redef of unused var
  85. # borg code style guidelines:
  86. # Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373
  87. ignore = ["E203", "F405", "E402"]
  88. # Allow autofix for all enabled rules (when `--fix`) is provided.
  89. 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"]
  90. unfixable = []
  91. # Exclude a variety of commonly ignored directories.
  92. exclude = [
  93. ".cache",
  94. ".eggs",
  95. ".git",
  96. ".git-rewrite",
  97. ".idea",
  98. ".mypy_cache",
  99. ".ruff_cache",
  100. ".tox",
  101. "build",
  102. "dist",
  103. ]
  104. # Allow unused variables when underscore-prefixed.
  105. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  106. # Code style violation exceptions:
  107. # please note that the values are adjusted so that they do not cause failures
  108. # with existing code. if you want to change them, you should first fix all
  109. # ruff failures that appear with your change.
  110. [tool.ruff.per-file-ignores]
  111. "scripts/make.py" = ["E501"]
  112. "src/borg/archive.py" = ["E501"]
  113. "src/borg/archiver/help_cmd.py" = ["E501"]
  114. "src/borg/cache.py" = ["E501"]
  115. "src/borg/helpers/__init__.py" = ["F401"]
  116. "src/borg/platform/__init__.py" = ["F401"]
  117. "src/borg/testsuite/archiver/disk_full_test.py" = ["F811"]
  118. "src/borg/testsuite/archiver/return_codes_test.py" = ["F811"]
  119. "src/borg/testsuite/benchmark_test.py" = ["F811"]
  120. "src/borg/testsuite/platform_test.py" = ["F811"]
  121. [tool.pytest.ini_options]
  122. markers = []
  123. [tool.mypy]
  124. python_version = "3.10"
  125. strict_optional = false
  126. local_partial_types = true
  127. show_error_codes = true
  128. files = "src/borg/**/*.py"
  129. [[tool.mypy.overrides]]
  130. module = [
  131. "msgpack.*",
  132. "llfuse",
  133. "pyfuse3",
  134. "trio",
  135. "borg.crypto.low_level",
  136. "borg.platform.*",
  137. ]
  138. ignore_missing_imports = true
  139. [tool.tox]
  140. requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
  141. env_list = ["py{310,311,312,313}-{none,fuse2,fuse3}", "docs", "ruff", "mypy"]
  142. [tool.tox.env_run_base]
  143. package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
  144. deps = ["-rrequirements.d/development.txt"]
  145. commands = [["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=.coveragerc", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]]
  146. pass_env = ["*"] # fakeroot -u needs some env vars
  147. [tool.tox.env_pkg_base]
  148. pass_env = ["*"] # needed by tox4, so env vars are visible for building borg
  149. # Environment-specific configurations
  150. [tool.tox.env."py{310,311,312,313}-fuse2"]
  151. set_env = {BORG_FUSE_IMPL = "llfuse"}
  152. deps = ["-rrequirements.d/development.txt", "llfuse"]
  153. [tool.tox.env."py{310,311,312,313}-fuse3"]
  154. set_env = {BORG_FUSE_IMPL = "pyfuse3"}
  155. deps = ["-rrequirements.d/development.txt", "pyfuse3"]
  156. [tool.tox.env."py{310,311,312,313}-none"]
  157. deps = ["-rrequirements.d/development.txt"]
  158. [tool.tox.env.ruff]
  159. skip_install = true
  160. deps = ["ruff"]
  161. commands = [["ruff", "check", "."]]
  162. [tool.tox.env.mypy]
  163. deps = ["pytest", "mypy", "pkgconfig"]
  164. commands = [["mypy", "--ignore-missing-imports"]]
  165. [tool.tox.env.docs]
  166. change_dir = "docs"
  167. deps = ["sphinx", "sphinxcontrib-jquery", "guzzle_sphinx_theme"]
  168. commands = [["sphinx-build", "-n", "-v", "-W", "--keep-going", "-b", "html", "-d", "{envtmpdir}/doctrees", ".", "{envtmpdir}/html"]]