pyproject.toml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [project]
  2. name = "bambuddy"
  3. version = "0.1.5"
  4. description = "Archive and manage Bambu Lab 3MF files"
  5. requires-python = ">=3.10"
  6. [tool.ruff]
  7. target-version = "py310"
  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 (Python 3.11+ only, we support 3.10)
  40. ]
  41. # Allow autofix for all enabled rules
  42. fixable = ["ALL"]
  43. unfixable = []
  44. [tool.ruff.lint.per-file-ignores]
  45. # Tests can have unused imports and assertions
  46. "**/tests/**" = ["F401", "F811", "ARG"]
  47. # Init files often have unused imports for re-export
  48. "**/__init__.py" = ["F401"]
  49. # main.py needs early logging setup before other imports
  50. "backend/app/main.py" = ["E402"]
  51. # MQTT client has some unused variables for debugging
  52. "backend/app/services/bambu_mqtt.py" = ["F841"]
  53. # compat module intentionally uses version checks for Python 3.10 support
  54. "backend/app/core/compat.py" = ["UP036"]
  55. [tool.ruff.lint.isort]
  56. known-first-party = ["backend"]
  57. force-single-line = false
  58. combine-as-imports = true
  59. [tool.ruff.format]
  60. quote-style = "double"
  61. indent-style = "space"
  62. skip-magic-trailing-comma = false
  63. line-ending = "auto"
  64. [tool.pytest.ini_options]
  65. testpaths = ["backend/tests"]
  66. python_files = ["test_*.py"]
  67. python_functions = ["test_*"]
  68. asyncio_mode = "auto"
  69. filterwarnings = [
  70. "ignore::DeprecationWarning",
  71. ]
  72. markers = [
  73. "docker: marks tests that run in Docker integration environment",
  74. ]