-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
182 lines (158 loc) · 4.46 KB
/
pyproject.toml
File metadata and controls
182 lines (158 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
[project]
name = "datakult"
version = "1.6.2"
description = "Review and analyse the media and culture that you consume."
readme = "README.md"
license = "AGPL-3.0"
requires-python = ">=3.12"
dependencies = [
"django (>=6.0.0)",
"django-htmx>=1.23.2",
"django-markdownfield>=0.11.0",
"django-partial-date>=1.3.2",
"django-tailwind>=4.2.0",
"lucide[django]>=1.1.3",
"pillow>=12.0.0",
"whitenoise>=6.11.0",
]
[dependency-groups]
dev = [
# Dev environment
"django-browser-reload>=1.18.0",
"honcho>=2.0.0",
# Tests and quality
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"pytest-django>=4.11.1",
"freezegun>=1.5.0",
"djlint>=1.36.4",
"pip-audit>=2.10.0",
"ruff>=0.12.4",
# Tools
"poethepoet>=0.36.0",
"python-semantic-release>=10.5.3",
]
prod = [
"gunicorn>=23.0.0",
]
[tool.poe.tasks]
# Dev tasks
server = "./src/manage.py tailwind dev"
collectstatic = "./src/manage.py collectstatic --noinput"
makemigrations = "./src/manage.py makemigrations"
migrate = "./src/manage.py migrate"
shell = "./src/manage.py shell"
setup = "./scripts/setup_dev.sh"
bootstrap = "./scripts/bootstrap.sh"
# Localisation
makemessages = "./src/manage.py makemessages -l fr --ignore=theme/* --ignore=staticfiles/* --ignore=venv/*"
compilemessages = "./src/manage.py compilemessages"
# Tests and quality
test = "pytest ./src --cov=src --cov-report=term-missing"
format = "ruff format ./src"
lint = "ruff check ./src"
check-format = "ruff format ./src --check"
audit-python = "pip-audit"
audit-js = { shell = "cd ./src/theme/static_src && npm audit" }
[tool.poe.tasks.ci]
sequence = ["check-format", "lint", "audit-python", "audit-js", "test"]
help = "Run all quality checks (format, lint, security audits, tests)"
# Release management
[tool.poe.tasks.changelog]
cmd = "semantic-release changelog"
help = "Preview the next changelog without making changes"
[tool.poe.tasks.version]
cmd = "semantic-release version --print"
help = "Print the next version number without making changes"
[tool.poe.tasks.release]
cmd = "semantic-release version --no-push --no-tag --no-commit"
help = "Generate changelog and bump version locally (does not push, tag, or commit - for local testing only)"
[tool.ruff]
line-length = 120
src = [
"src",
]
respect-gitignore = true
fix = true
show-fixes = true
output-format = "grouped"
extend-exclude = ["./src/config/settings.py"]
# https://docs.astral.sh/ruff/rules/
lint.select = ["ALL"]
lint.ignore = [
"ANN",
"D",
"PGH004",
"RUF012",
"COM812",
]
[tool.ruff.lint.per-file-ignores]
"*/tests/**/*.py" = [
"S101", # asserts allowed in tests
"S106", # hardcoded passwords allowed in tests
"ARG", # unused arguments allowed
"FBT", # boolean positional args allowed
"PLR2004", # magic values allowed
"PLC0415", # imports not at top level allowed (fixtures)
]
"**/conftest.py" = [
"PLC0415", # imports not at top level allowed (fixtures)
]
[tool.uv]
package = false
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "config.settings"
python_files = ["test_*.py", "*_test.py"]
pythonpath = ["./src"]
testpaths = ["./src/tests"]
addopts = [
"-v",
"--tb=short",
"--strict-markers",
]
[tool.coverage.run]
source = ["src"]
omit = [
"*/migrations/*",
"*/tests/*",
"*/__pycache__/*",
"*/staticfiles/*",
"*/theme/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
branch = "main"
major_on_zero = true
tag_format = "v{version}"
commit_message = "chore(release): {version}"
build_command = """
uv lock --upgrade-package datakult
git add uv.lock
"""
[tool.semantic_release.commit_author]
env = "GIT_COMMIT_AUTHOR"
default = "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
[tool.semantic_release.commit_parser_options]
allowed_tags = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf", "chore", "docs", "style", "refactor", "test", "build", "ci"]
[tool.semantic_release.changelog]
exclude_commit_patterns = [
"chore\\(release\\):.*",
]
mode = "update"
[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease = false