-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
135 lines (121 loc) · 4.5 KB
/
Copy pathpyproject.toml
File metadata and controls
135 lines (121 loc) · 4.5 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
[project]
name = "django-templates-cythonized"
version = "0.1.0"
description = "Cython-accelerated Django template engine for benchmarking template rendering speedup (3-14x faster)"
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.12"
keywords = ["django", "templates", "cython", "performance"]
authors = [{ name = "Oliver Haas", email = "ohaas@e1plus.de" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 5.2",
"Framework :: Django :: 6.0",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Cython",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
]
dependencies = ["Django>=5.2,<7"]
[project.urls]
Homepage = "https://github.com/oliverhaas/django-templates-cythonized"
Repository = "https://github.com/oliverhaas/django-templates-cythonized.git"
[build-system]
requires = ["setuptools>=74.1", "Cython>=3.0"]
build-backend = "setuptools.build_meta"
[dependency-groups]
dev = [
"Cython==3.2.4",
"pre-commit==4.6.0",
"pytest==9.1.1",
"pytest-codspeed==5.0.3",
"pytest-cov==7.1.0",
"pytest-django==4.12.0",
"ruff==0.15.18",
]
[tool.setuptools.packages.find]
include = ["django_templates_cythonized*"]
[tool.setuptools.package-data]
django_templates_cythonized = ["*.pxd"]
[tool.ruff]
target-version = "py312"
line-length = 120
fix = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"COM812", # Conflicts with ruff-format
"D", # Docstrings - Django source doesn't follow our style
"E501", # Line length handled by config
"EM", # Exception strings inline are fine
"FBT", # Boolean params match Django's API
"PLR0913", # Too many args - Django's existing API
"PLR2004", # Magic values from Django source
"SLF001", # Private member access needed for Django internals
"TRY003", # Long exception messages are helpful for debugging
"TRY300", # return in try block is cleaner for some patterns
"SIM108", # Ternary not always clearer
]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
suppress-none-returning = true
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ANN", # Type annotations not required in tests
"ARG", # Unused arguments common in fixtures
"B905", # zip strict not needed in tests
"C901", # Complex functions okay in test helpers
"DTZ001", # Naive datetimes fine in tests
"E402", # Late imports for Django setup in conftest
"F811", # Redefined names from fixture reuse patterns
"F841", # Unused variables okay in tests
"FBT", # Boolean args fine in test fixtures and test calls
"N818", # Exception naming conventions relaxed
"PERF401", # Manual list comprehension okay in tests
"PLC0415", # Late imports for Django setup
"PLR0912", # Too many branches in test helpers
"PLR0911", # Too many return statements in test helpers
"PLR1714", # Repeated equality comparisons okay
"PT006", # Parametrize tuple style is preference
"PT009", # pytest-style assertions not enforced
"PT011", # Broad pytest.raises okay in some tests
"PT013", # pytest import style is preference
"PT018", # Compound assertions okay in tests
"PTH", # pathlib not required in tests
"S101", # assert in tests
"S105", # Hardcoded passwords in test settings
"S106", # Hardcoded passwords in test settings
"SIM102", # Collapsible if okay in tests
]
# Django source code - be lenient with linting for now
"django_templates_cythonized/*.py" = ["ALL"]
"django_templates_cythonized/loaders/*.py" = ["ALL"]
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "tests.settings"
addopts = "--cov=django_templates_cythonized/loaders --cov-report=term-missing --no-cov-on-fail"
pythonpath = ["."]
testpaths = ["tests"]
xfail_strict = true
[tool.coverage.run]
# Only loaders/ stay as pure Python; all other .py files compile to .so via
# Cython and can't be instrumented by coverage.
omit = ["tests/*"]
[tool.coverage.report]
precision = 2
skip_covered = true
[tool.cibuildwheel]
build = "cp312-* cp313-* cp314-*"
skip = "*-win32 *-manylinux_i686 *-musllinux*"
build-frontend = "build[uv]"
test-command = "python -c \"import django_templates_cythonized\""
[tool.cibuildwheel.linux]
archs = "x86_64"