pyproject.toml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. ]
  40. # Allow autofix for all enabled rules
  41. fixable = ["ALL"]
  42. unfixable = []
  43. [tool.ruff.lint.per-file-ignores]
  44. # Tests can have unused imports and assertions
  45. "**/tests/**" = ["F401", "F811", "ARG"]
  46. # Init files often have unused imports for re-export
  47. "**/__init__.py" = ["F401"]
  48. # main.py needs early logging setup before other imports
  49. "backend/app/main.py" = ["E402"]
  50. # MQTT client has some unused variables for debugging
  51. "backend/app/services/bambu_mqtt.py" = ["F841"]
  52. [tool.ruff.lint.isort]
  53. known-first-party = ["backend"]
  54. force-single-line = false
  55. combine-as-imports = true
  56. [tool.ruff.format]
  57. quote-style = "double"
  58. indent-style = "space"
  59. skip-magic-trailing-comma = false
  60. line-ending = "auto"
  61. [tool.pytest.ini_options]
  62. testpaths = ["backend/tests"]
  63. python_files = ["test_*.py"]
  64. python_functions = ["test_*"]
  65. asyncio_mode = "auto"
  66. filterwarnings = [
  67. "ignore::DeprecationWarning",
  68. ]
  69. markers = [
  70. "docker: marks tests that run in Docker integration environment",
  71. ]