pyproject.toml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. [project]
  2. name = "bambuddy"
  3. version = "0.1.5"
  4. description = "Archive and manage Bambu Lab 3MF files"
  5. requires-python = ">=3.11"
  6. [tool.ruff]
  7. target-version = "py311"
  8. line-length = 120
  9. exclude = [
  10. ".git",
  11. ".venv",
  12. "venv",
  13. "__pycache__",
  14. "static",
  15. "frontend",
  16. "*.pyc",
  17. ]
  18. [tool.ruff.lint]
  19. select = [
  20. "E", # pycodestyle errors
  21. "W", # pycodestyle warnings
  22. "F", # Pyflakes
  23. "I", # isort
  24. "B", # flake8-bugbear
  25. "C4", # flake8-comprehensions
  26. "UP", # pyupgrade
  27. "ARG", # flake8-unused-arguments
  28. "SIM", # flake8-simplify
  29. ]
  30. ignore = [
  31. "E501", # line too long (handled by formatter)
  32. "B008", # do not perform function calls in argument defaults (FastAPI Depends)
  33. "B904", # raise from (too noisy)
  34. "ARG001", # unused function argument (common in FastAPI)
  35. "ARG002", # unused method argument
  36. "SIM108", # ternary operator (readability preference)
  37. "SIM102", # nested if (readability preference)
  38. "SIM105", # contextlib.suppress (readability preference)
  39. "UP017", # datetime.UTC alias (style preference: the codebase uses timezone.utc)
  40. "UP042", # (str, Enum) -> StrEnum changes str() of the members; not a mechanical swap
  41. ]
  42. # Allow autofix for all enabled rules
  43. fixable = ["ALL"]
  44. unfixable = []
  45. [tool.ruff.lint.per-file-ignores]
  46. # Tests can have unused imports and assertions
  47. "**/tests/**" = ["F401", "F811", "ARG"]
  48. # Init files often have unused imports for re-export
  49. "**/__init__.py" = ["F401"]
  50. # main.py needs early logging setup before other imports
  51. "backend/app/main.py" = ["E402"]
  52. # MQTT client has some unused variables for debugging
  53. "backend/app/services/bambu_mqtt.py" = ["F841"]
  54. [tool.ruff.lint.isort]
  55. known-first-party = ["backend"]
  56. force-single-line = false
  57. combine-as-imports = true
  58. [tool.ruff.format]
  59. quote-style = "double"
  60. indent-style = "space"
  61. skip-magic-trailing-comma = false
  62. line-ending = "auto"
  63. [tool.basedpyright]
  64. # Errors that existed when the check was introduced are recorded in
  65. # .basedpyright/baseline.json and do not fail; any new one does. A local run
  66. # without new errors drops fixed errors from the baseline; CI (lock mode) never
  67. # rewrites it and fails if it still lists a fixed error. Check against the pinned
  68. # environment in requirements-typecheck.lock -- other library versions report
  69. # different errors (see requirements-typecheck.txt).
  70. include = ["backend/app"]
  71. typeCheckingMode = "standard"
  72. pythonVersion = "3.11"
  73. # The baseline was made for Linux; the host OS would otherwise change results.
  74. pythonPlatform = "Linux"
  75. [tool.pytest.ini_options]
  76. testpaths = ["backend/tests"]
  77. python_files = ["test_*.py"]
  78. python_functions = ["test_*"]
  79. asyncio_mode = "auto"
  80. filterwarnings = [
  81. "ignore::DeprecationWarning",
  82. ]
  83. markers = [
  84. "docker: marks tests that run in Docker integration environment",
  85. "sqlite_only: tests of SQLite-specific behaviour, skipped when the suite runs on PostgreSQL",
  86. ]
  87. [dependency-groups]
  88. dev = [
  89. "cryptography>=46.0.7",
  90. "pyjwt>=2.15.1",
  91. ]