|
| 1 | +[project] |
| 2 | +dependencies = [] |
| 3 | +description = "Add your description here" |
| 4 | +name = "uv-python-workflow" |
| 5 | +readme = "README.md" |
| 6 | +requires-python = ">=3.12" |
| 7 | +version = "0.1.0" |
| 8 | + |
| 9 | +[dependency-groups] |
| 10 | +dev = [ |
| 11 | + "commitizen>=4.9.1", |
| 12 | + "pre-commit>=4.3.0", |
| 13 | + "pyright[nodejs]>=1.1.405", |
| 14 | + "pytest>=8.4.2", |
| 15 | + "pytest-cov>=7.0.0", |
| 16 | + "pytest-sugar>=1.1.1", |
| 17 | +] |
| 18 | + |
| 19 | +[tool.commitizen] |
| 20 | +major_version_zero = true |
| 21 | +name = "cz_conventional_commits" |
| 22 | +tag_format = "v$version" |
| 23 | +update_changelog_on_bump = true |
| 24 | +version_provider = "pyproject" |
| 25 | +version_scheme = "pep440" |
| 26 | + |
| 27 | +[tool.ruff] # https://docs.astral.sh/ruff/settings/#top-level |
| 28 | +exclude = [".venv"] |
| 29 | +line-length = 100 |
| 30 | + |
| 31 | +[tool.ruff.lint] # https://docs.astral.sh/ruff/settings/#lint |
| 32 | +extend-select = [ |
| 33 | + "FAST001", # fast-api-redundant-response-model |
| 34 | + "FAST002", # fast-api-non-annotated-dependency |
| 35 | + "D100", # missing-module-docstring |
| 36 | + "D101", # undocumented-public-class |
| 37 | + "D102", # missing-class-docstring |
| 38 | + "D103", # undocumented-public-function |
| 39 | + "D213", # multi-line-summary-second-line |
| 40 | + "D400", # missing-trailing-period |
| 41 | + "ERA001", # commented-out-code |
| 42 | +] |
| 43 | +select = [ |
| 44 | + "B", # flake8-bugbear |
| 45 | + "E", # pycodestyle |
| 46 | + "F", # pyflakes |
| 47 | + "I", # isort |
| 48 | + "S", # bandit |
| 49 | + "W", # pycodestyle |
| 50 | + "UP", # pyupgrade |
| 51 | + "C4", # flake8-comprehensions |
| 52 | + "ANN", # flake8-annotations |
| 53 | + "TRY", # tryceratops |
| 54 | + "PERF", # perflint |
| 55 | + "ASYNC", # flake8-async |
| 56 | +] |
| 57 | + |
| 58 | +# Globally ignore noisy rules (example) |
| 59 | +ignore = [ |
| 60 | + "E402", # module level import not at top of file |
| 61 | + "TRY003", # Avoid specifying long messages outside the exception class |
| 62 | + "TRY301", # Abstract `raise` to an inner function |
| 63 | +] |
| 64 | + |
| 65 | +[tool.ruff.lint.per-file-ignores] |
| 66 | +"tests/*" = [ |
| 67 | + "S101", # Allow use of assert statements in tests |
| 68 | + "S105", # hardcoded-password-string |
| 69 | + "S106", # hardcoded-password-func-arg |
| 70 | +] |
| 71 | + |
| 72 | +[tool.ruff.format] # https://docs.astral.sh/ruff/settings/#format |
| 73 | +quote-style = "double" # Quote style, double quotes are default |
| 74 | + |
| 75 | +[tool.coverage.run] |
| 76 | +branch = true |
| 77 | +omit = [ |
| 78 | + "tests/*", |
| 79 | + ".venv/*", |
| 80 | +] |
| 81 | +source = ["src"] |
| 82 | + |
| 83 | +[tool.coverage.report] |
| 84 | +exclude_also = [ |
| 85 | + "def __repr__", |
| 86 | + "if self\\.debug", |
| 87 | + "raise AssertionError", |
| 88 | + "raise NotImplementedError", |
| 89 | + "if 0:", |
| 90 | + "if __name__ == .__main__.:", |
| 91 | + "if TYPE_CHECKING:", |
| 92 | + "class .*\\bProtocol\\):", |
| 93 | + "@(abc\\.)?abstractmethod", |
| 94 | +] |
| 95 | +ignore_errors = true |
| 96 | +show_missing = true |
| 97 | +# skip_covered = true |
| 98 | + |
| 99 | +[tool.coverage.xml] |
| 100 | +output = "coverage.xml" |
| 101 | + |
| 102 | +[tool.coverage.html] # pytest --cov=src --cov-report=html |
| 103 | +directory = "coverage_html_report" |
| 104 | +show_contexts = true |
| 105 | +title = "Coverage Report" |
| 106 | + |
| 107 | +[tool.pytest.ini_options] |
| 108 | +addopts = "-ra --strict-config --strict-markers --cov=src --cov-report=xml --cov-report=term-missing" |
| 109 | +filterwarnings = ["error"] |
| 110 | +markers = [ |
| 111 | + "asyncio: marks tests as asyncio tests", |
| 112 | +] |
| 113 | +python_files = ["test_*.py"] |
| 114 | +testpaths = ["tests"] |
| 115 | + |
| 116 | +[tool.pyright] |
| 117 | +exclude = [ |
| 118 | + ".venv", |
| 119 | +] |
| 120 | +typeCheckingMode = "basic" |
| 121 | +venv = ".venv" |
| 122 | +venvPath = "." |
0 commit comments