pyproject.toml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. [project]
  2. name = "borgbackup"
  3. dynamic = ["version"]
  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. readme = "README.rst"
  10. requires-python = ">=3.9"
  11. keywords = ["backup", "borgbackup"]
  12. classifiers = [
  13. "Development Status :: 4 - Beta",
  14. "Environment :: Console",
  15. "Intended Audience :: System Administrators",
  16. "License :: OSI Approved :: BSD License",
  17. "Operating System :: POSIX :: BSD :: FreeBSD",
  18. "Operating System :: POSIX :: BSD :: OpenBSD",
  19. "Operating System :: POSIX :: BSD :: NetBSD",
  20. "Operating System :: MacOS :: MacOS X",
  21. "Operating System :: POSIX :: Linux",
  22. "Programming Language :: Python",
  23. "Programming Language :: Python :: 3",
  24. "Programming Language :: Python :: 3.9",
  25. "Programming Language :: Python :: 3.10",
  26. "Programming Language :: Python :: 3.11",
  27. "Programming Language :: Python :: 3.12",
  28. "Topic :: Security :: Cryptography",
  29. "Topic :: System :: Archiving :: Backup",
  30. ]
  31. license = {text="BSD"}
  32. dependencies = [
  33. "msgpack >=1.0.3, <=1.0.7",
  34. "packaging",
  35. "platformdirs >=3.0.0, <4.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0,
  36. "platformdirs >=2.6.0, <4.0.0; sys_platform != 'darwin'", # for others: 2.6+ works consistently.
  37. "argon2-cffi",
  38. ]
  39. [project.optional-dependencies]
  40. llfuse = ["llfuse >= 1.3.8"]
  41. pyfuse3 = ["pyfuse3 >= 3.1.1"]
  42. nofuse = []
  43. [project.urls]
  44. "Homepage" = "https://borgbackup.org/"
  45. "Bug Tracker" = "https://github.com/borgbackup/borg/issues"
  46. "Documentation" = "https://borgbackup.readthedocs.io/"
  47. "Repository" = "https://github.com/borgbackup/borg"
  48. "Changelog" = "https://github.com/borgbackup/borg/blob/master/docs/changes.rst"
  49. [project.scripts]
  50. borg = "borg.archiver:main"
  51. borgfs = "borg.archiver:main"
  52. [tool.setuptools]
  53. # See also the MANIFEST.in file.
  54. # We want to install all the files in the package directories...
  55. include-package-data = true
  56. [tool.setuptools.packages.find]
  57. where = ["src"]
  58. [tool.setuptools.exclude-package-data]
  59. # ...except the source files which have been compiled (C extensions):
  60. "*" = ["*.c", "*.h", "*.pyx"]
  61. [build-system]
  62. requires = ["setuptools", "wheel", "pkgconfig", "Cython", "setuptools_scm[toml]>=6.2"]
  63. build-backend = "setuptools.build_meta"
  64. [tool.setuptools_scm]
  65. # make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files
  66. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052
  67. # https://github.com/borgbackup/borg/issues/6875
  68. write_to = "src/borg/_version.py"
  69. write_to_template = "__version__ = version = {version!r}\n"
  70. [tool.black]
  71. line-length = 120
  72. skip-magic-trailing-comma = true
  73. [tool.ruff]
  74. line-length = 120
  75. target-version = "py39"
  76. # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
  77. select = ["E", "F"]
  78. # for reference ...
  79. # E402 module level import not at top
  80. # E501 line too long
  81. # F401 import unused
  82. # F405 undefined or defined from star imports
  83. # F811 redef of unused var
  84. # borg code style guidelines:
  85. # Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373
  86. ignore = ["E203", "F405", "E402"]
  87. # Allow autofix for all enabled rules (when `--fix`) is provided.
  88. 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"]
  89. unfixable = []
  90. # Exclude a variety of commonly ignored directories.
  91. exclude = [
  92. ".cache",
  93. ".eggs",
  94. ".git",
  95. ".git-rewrite",
  96. ".idea",
  97. ".mypy_cache",
  98. ".ruff_cache",
  99. ".tox",
  100. "build",
  101. "dist",
  102. ]
  103. # Allow unused variables when underscore-prefixed.
  104. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  105. # Code style violation exceptions:
  106. # please note that the values are adjusted so that they do not cause failures
  107. # with existing code. if you want to change them, you should first fix all
  108. # ruff failures that appear with your change.
  109. [tool.ruff.per-file-ignores]
  110. "setup_docs.py" = ["E501"]
  111. "src/borg/archive.py" = ["E501"]
  112. "src/borg/archiver/help_cmd.py" = ["E501"]
  113. "src/borg/cache.py" = ["E501"]
  114. "src/borg/helpers/__init__.py" = ["F401"]
  115. "src/borg/platform/__init__.py" = ["F401"]
  116. "src/borg/testsuite/archiver/disk_full.py" = ["F811"]
  117. "src/borg/testsuite/archiver/return_codes.py" = ["F811"]
  118. "src/borg/testsuite/benchmark.py" = ["F811"]
  119. "src/borg/testsuite/platform.py" = ["F811"]
  120. [tool.pytest.ini_options]
  121. python_files = "testsuite/*.py"
  122. markers = [
  123. "allow_cache_wipe",
  124. ]
  125. [tool.mypy]
  126. python_version = "3.9"
  127. strict_optional = false
  128. local_partial_types = true
  129. show_error_codes = true
  130. files = "src/borg/**/*.py"
  131. [[tool.mypy.overrides]]
  132. module = [
  133. "msgpack.*",
  134. "llfuse",
  135. "pyfuse3",
  136. "trio",
  137. "borg.crypto.low_level",
  138. "borg.platform.*",
  139. ]
  140. ignore_missing_imports = true