pyproject.toml 4.9 KB

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