[build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] name = "my-python-project" version = "0.1.0" description = "Example project with strict linting and formatting tools" requires-python = ">=3.10" dependencies = [] [project.optional-dependencies] dev = [ "black", "ruff", "mypy", "bandit", "safety", "docformatter", "pre-commit", # nice-to-have for git hooks "pytest", # for running tests "pytest-cov", # coverage reports "ipython", # better REPL ] # ------------------------------- # Tool configurations # ------------------------------- [tool.black] line-length = 120 target-version = ["py310", "py311", "py312"] [tool.ruff] line-length = 120 target-version = "py310" fix = true unsafe-fixes = true select = [ "E", # pycodestyle errors "F", # pyflakes "I", # import sorting "B", # bugbear (common bugs) "UP", # pyupgrade ] ignore = [ "D401", # allow "Converts ..." docstrings "ARG005", # ignore unused lambda args (if you need them in callbacks) ] exclude = ["migrations", ".venv"] [tool.mypy] python_version = "3.10" check_untyped_defs = true disallow_untyped_defs = true warn_unused_ignores = true warn_return_any = true warn_redundant_casts = true ignore_missing_imports = true pretty = true [tool.bandit] exclude = ["tests", "migrations"] # [tool.docformatter] # wrap-summaries = 120 # wrap-descriptions = 120 # pre-summary-newline = true # make-summary-multi-line = true # recursive = true [tool.pytest.ini_options] addopts = "-ra -q " testpaths = ["tests"] [tool.coverage.run] branch = true omit = ["tests/*", "migrations/*"] [tool.coverage.report] show_missing = true skip_covered = true