| 1 |
[build-system] |
| 2 |
requires = ["hatchling"] |
| 3 |
build-backend = "hatchling.build" |
| 4 |
|
| 5 |
[project] |
| 6 |
name = "django-polymorphic" |
| 7 |
version = "4.11.7" |
| 8 |
description = "Seamless polymorphic inheritance for Django models." |
| 9 |
readme = "README.md" |
| 10 |
license = "BSD-3-Clause" |
| 11 |
license-files = [ |
| 12 |
"LICENSE", |
| 13 |
"src/polymorphic/contrib/drf/LICENSE" |
| 14 |
] |
| 15 |
requires-python = ">=3.10,<4.0" |
| 16 |
repository = "https://github.com/django-commons/django-polymorphic" |
| 17 |
homepage = "https://django-polymorphic.rtfd.io" |
| 18 |
authors = [ |
| 19 |
{name = "Bert Constantin", email = "[email protected]"}, |
| 20 |
{name = "Diederik van der Boor", email = "[email protected]"}, |
| 21 |
{name = "Christopher Glass", email = "[email protected]"}, |
| 22 |
] |
| 23 |
maintainers = [ |
| 24 |
{name = "Brian Kohan", email = "[email protected]"} |
| 25 |
] |
| 26 |
keywords = [ |
| 27 |
"django", "polymorphic", "polymorphism", "django-admin", "django-orm", "django-formsets", "model" |
| 28 |
] |
| 29 |
classifiers = [ |
| 30 |
"Development Status :: 5 - Production/Stable", |
| 31 |
"Environment :: Web Environment", |
| 32 |
"Framework :: Django", |
| 33 |
"Framework :: Django :: 4.2", |
| 34 |
"Framework :: Django :: 5.2", |
| 35 |
"Framework :: Django :: 6.0", |
| 36 |
"Framework :: Django :: 6.1", |
| 37 |
"Intended Audience :: Developers", |
| 38 |
"License :: OSI Approved :: BSD License", |
| 39 |
"Natural Language :: English", |
| 40 |
"Operating System :: OS Independent", |
| 41 |
"Programming Language :: Python :: 3", |
| 42 |
"Programming Language :: Python :: 3 :: Only", |
| 43 |
"Programming Language :: Python :: 3.10", |
| 44 |
"Programming Language :: Python :: 3.11", |
| 45 |
"Programming Language :: Python :: 3.12", |
| 46 |
"Programming Language :: Python :: 3.13", |
| 47 |
"Programming Language :: Python :: 3.14", |
| 48 |
"Topic :: Database", |
| 49 |
"Topic :: Internet :: WWW/HTTP", |
| 50 |
"Topic :: Internet :: WWW/HTTP :: Site Management", |
| 51 |
"Topic :: Software Development :: Libraries", |
| 52 |
"Topic :: Software Development :: Libraries :: Python Modules", |
| 53 |
"Typing :: Typed" |
| 54 |
] |
| 55 |
dependencies = [ |
| 56 |
"Django >= 4.2", |
| 57 |
"typing_extensions >= 4.12.0", |
| 58 |
] |
| 59 |
|
| 60 |
[project.urls] |
| 61 |
"Download" = "https://github.com/django-commons/django-polymorphic/tarball/main" |
| 62 |
"Documentation" = "https://django-polymorphic.readthedocs.io" |
| 63 |
"Homepage" = "https://github.com/django-commons/django-polymorphic" |
| 64 |
"Repository" = "https://github.com/django-commons/django-polymorphic" |
| 65 |
"Issues" = "https://github.com/django-commons/django-polymorphic/issues" |
| 66 |
"Changelog" = "https://django-polymorphic.readthedocs.io/en/stable/changelog/index.html" |
| 67 |
"Code_of_Conduct" = "https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md" |
| 68 |
|
| 69 |
[tool.uv] |
| 70 |
package = true |
| 71 |
conflicts = [ |
| 72 |
[{ group = "dj42" }, { group = "dj52" }, { group = "dj61" }], |
| 73 |
[{ group = "mysqlclient14" }, { group = "mysqlclient2x" }], |
| 74 |
[{ group = "psycopg2" }, { group = "psycopg3" }], |
| 75 |
[{ group = "cx_oracle" }, { group = "oracledb" }], |
| 76 |
] |
| 77 |
|
| 78 |
[tool.uv.sources] |
| 79 |
# DRF's latest release (3.17.1) is incompatible with Django 6.1 (it imports the |
| 80 |
# removed django.utils.cache.cc_delim_re) - use master until a fixed release ships |
| 81 |
djangorestframework = [ |
| 82 |
{ git = "https://github.com/encode/django-rest-framework", group = "dj61" }, |
| 83 |
] |
| 84 |
|
| 85 |
[tool.hatch.version] |
| 86 |
path = "src/polymorphic/__init__.py" |
| 87 |
|
| 88 |
[tool.hatch.build.targets.sdist] |
| 89 |
include = ["src/polymorphic"] |
| 90 |
exclude = ["src/polymorphic/tests"] |
| 91 |
|
| 92 |
[tool.hatch.build.targets.wheel] |
| 93 |
packages = ["src/polymorphic"] |
| 94 |
artifacts = ["*.mo", "py.typed"] |
| 95 |
|
| 96 |
[tool.doc8] |
| 97 |
max-line-length = 100 |
| 98 |
sphinx = true |
| 99 |
|
| 100 |
[tool.ruff] |
| 101 |
line-length = 99 |
| 102 |
target-version = "py310" |
| 103 |
|
| 104 |
exclude = [ |
| 105 |
"**/migrations/*.py", |
| 106 |
"**/migrations/**", |
| 107 |
"src/polymorphic/tests/examples", |
| 108 |
] |
| 109 |
|
| 110 |
[tool.ruff.lint] |
| 111 |
extend-ignore = [ |
| 112 |
"E501", |
| 113 |
] |
| 114 |
select = [ |
| 115 |
"E", |
| 116 |
"F", |
| 117 |
"I", |
| 118 |
"W", |
| 119 |
] |
| 120 |
|
| 121 |
[tool.ruff.lint.per-file-ignores] |
| 122 |
"example/**" = [ |
| 123 |
"F401", |
| 124 |
"F403", |
| 125 |
"F405", |
| 126 |
"F841", |
| 127 |
"I", |
| 128 |
] |
| 129 |
"src/polymorphic/tests/**" = [ |
| 130 |
"F401", |
| 131 |
"F403", |
| 132 |
"F405", |
| 133 |
"F841", |
| 134 |
"I", |
| 135 |
] |
| 136 |
|
| 137 |
[tool.pytest.ini_options] |
| 138 |
DJANGO_SETTINGS_MODULE = "polymorphic.tests.settings" |
| 139 |
pythonpath = ["src"] |
| 140 |
django_find_project = false |
| 141 |
testpaths = ["src/polymorphic/tests"] |
| 142 |
python_files = "test*.py" |
| 143 |
python_classes = "Test*" |
| 144 |
python_functions = "test_*" |
| 145 |
norecursedirs = "*.egg .eggs dist build docs .tox .git __pycache__" |
| 146 |
markers = [ |
| 147 |
"integration: tests under examples/integrations (opt-in)", |
| 148 |
"ui: browser-based tests", |
| 149 |
] |
| 150 |
addopts = [ |
| 151 |
"--strict-markers", |
| 152 |
"-m", "not integration", |
| 153 |
] |
| 154 |
|
| 155 |
[tool.coverage.run] |
| 156 |
source = [ |
| 157 |
"src" |
| 158 |
] |
| 159 |
omit = ["*/migrations/*", "*/tests/*", "src/polymorphic/tests/*"] |
| 160 |
branch = true |
| 161 |
relative_files = true |
| 162 |
|
| 163 |
[tool.coverage.report] |
| 164 |
show_missing = true |
| 165 |
|
| 166 |
[tool.mypy] |
| 167 |
strict = false |
| 168 |
warn_return_any = true |
| 169 |
warn_unused_configs = true |
| 170 |
disallow_untyped_defs = false |
| 171 |
disallow_incomplete_defs = false |
| 172 |
check_untyped_defs = true |
| 173 |
disallow_untyped_decorators = false |
| 174 |
no_implicit_optional = true |
| 175 |
warn_redundant_casts = true |
| 176 |
warn_unused_ignores = true |
| 177 |
warn_no_return = true |
| 178 |
warn_unreachable = true |
| 179 |
strict_equality = true |
| 180 |
plugins = ["mypy_django_plugin.main"] |
| 181 |
|
| 182 |
[[tool.mypy.overrides]] |
| 183 |
module = "polymorphic.tests.*" |
| 184 |
ignore_errors = true |
| 185 |
|
| 186 |
[[tool.mypy.overrides]] |
| 187 |
module = "polymorphic.tests.examples.type_hints.*" |
| 188 |
ignore_errors = false |
| 189 |
|
| 190 |
[tool.django-stubs] |
| 191 |
django_settings_module = "polymorphic.tests.settings" |
| 192 |
|
| 193 |
[tool.pyright] |
| 194 |
pythonVersion = "3.10" |
| 195 |
typeCheckingMode = "basic" |
| 196 |
include = ["src/polymorphic"] |
| 197 |
exclude = [ |
| 198 |
"**/migrations", |
| 199 |
"example", |
| 200 |
"src/polymorphic/**/tests/**", |
| 201 |
] |
| 202 |
reportMissingImports = true |
| 203 |
reportMissingTypeStubs = false |
| 204 |
reportUnusedImport = true |
| 205 |
reportUnusedClass = false |
| 206 |
reportUnusedFunction = false |
| 207 |
reportUnusedVariable = true |
| 208 |
reportDuplicateImport = true |
| 209 |
reportOptionalMemberAccess = false |
| 210 |
reportGeneralTypeIssues = false |
| 211 |
reportOptionalSubscript = false |
| 212 |
reportPrivateImportUsage = false |
| 213 |
|
| 214 |
|
| 215 |
[tool.bandit] |
| 216 |
targets = ["src"] |
| 217 |
exclude_dirs = [ |
| 218 |
"./src/polymorphic/tests", |
| 219 |
"./src/polymorphic/migrations", |
| 220 |
"./example", |
| 221 |
"./.venv", |
| 222 |
"./docs", |
| 223 |
] |
| 224 |
|
| 225 |
skips = [ |
| 226 |
"B101", # assert_used - assertions are fine in tests and Django code |
| 227 |
] |
| 228 |
|
| 229 |
# Severity level threshold |
| 230 |
# Options: LOW, MEDIUM, HIGH |
| 231 |
severity = "MEDIUM" |
| 232 |
|
| 233 |
# Confidence level threshold |
| 234 |
# Options: LOW, MEDIUM, HIGH |
| 235 |
confidence = "MEDIUM" |
| 236 |
|
| 237 |
|
| 238 |
[dependency-groups] |
| 239 |
typing = [ |
| 240 |
"django-stubs>=5.1.1", |
| 241 |
"django-stubs-ext>=5.1.1", |
| 242 |
"djangorestframework-stubs>=3.16.1", |
| 243 |
"pyright>=1.1.390", |
| 244 |
"mypy>=1.19.1", |
| 245 |
] |
| 246 |
lint = [ |
| 247 |
"ruff>=0.15.0", |
| 248 |
"readme-renderer[md]>=43.0", |
| 249 |
"doc8>=1.1.2", |
| 250 |
"bandit[toml,sarif]>=1.7.10" |
| 251 |
] |
| 252 |
coverage = ["coverage>=7.6.1"] |
| 253 |
test = [ |
| 254 |
{ include-group = "coverage" }, |
| 255 |
"django-test-migrations>=1.5.0", |
| 256 |
"pytest>=8.3.4", |
| 257 |
"pytest-cov>=5.0.0", |
| 258 |
"pytest-django>=4.10.0", |
| 259 |
"pytest-mock>=3.15.1", |
| 260 |
"pytest-playwright>=0.7.2" |
| 261 |
] |
| 262 |
docs = [ |
| 263 |
"django-extra-views>=0.16.0", |
| 264 |
"furo>=2025.7.19", |
| 265 |
"sphinx>=7.1.2", |
| 266 |
"sphinx-autobuild>=2024.10.3", |
| 267 |
"sphinxcontrib-django>=2.5", |
| 268 |
] |
| 269 |
psycopg2 = [ |
| 270 |
"psycopg2>=2.9.10", |
| 271 |
] |
| 272 |
psycopg3 = [ |
| 273 |
"psycopg>=3.3.2", |
| 274 |
] |
| 275 |
mysql = [ |
| 276 |
"mysqlclient>=1.4.0", |
| 277 |
] |
| 278 |
mysqlclient14 = [ |
| 279 |
"mysqlclient==1.4.3", |
| 280 |
] |
| 281 |
mysqlclient2x = [ |
| 282 |
"mysqlclient>=2.2.8", |
| 283 |
] |
| 284 |
cx_oracle = [ |
| 285 |
"cx-oracle>=8.3.0" |
| 286 |
] |
| 287 |
|
| 288 |
oracledb = [ |
| 289 |
"oracledb>=2.3.0", |
| 290 |
] |
| 291 |
reversion = [ |
| 292 |
"django-reversion>=6.1.0", |
| 293 |
] |
| 294 |
extra-views = [ |
| 295 |
"django-extra-views>=0.16.0", |
| 296 |
] |
| 297 |
drf = [ |
| 298 |
"django-filter>=24.0", |
| 299 |
"djangorestframework>=3.16.1", |
| 300 |
] |
| 301 |
guardian = [ |
| •302 |
"django-guardian", |
| 303 |
] |
| 304 |
integrations = [ |
| 305 |
{ include-group = "extra-views" }, |
| 306 |
{ include-group = "drf" }, |
| 307 |
] |
| 308 |
precommit = [ |
| 309 |
"pre-commit>=3.5.0", |
| 310 |
] |
| 311 |
# for CI and testing |
| 312 |
dj42 = [ |
| 313 |
"Django>=4.2,<5.0; python_version < '3.13'", |
| 314 |
] |
| 315 |
dj52 = [ |
| 316 |
"Django>=5.2,<6.0" |
| 317 |
] |
| 318 |
dj61 = [ |
| 319 |
"Django>=6.1rc1,<6.2; python_version >= '3.12'", |
| 320 |
"djangorestframework; python_version >= '3.12'", |
| 321 |
] |
| 322 |
|
| 323 |
dev = [ |
| 324 |
{ include-group = "typing" }, |
| 325 |
{ include-group = "test" }, |
| 326 |
{ include-group = "docs" }, |
| 327 |
{ include-group = "drf" }, |
| 328 |
{ include-group = "lint" }, |
| 329 |
{ include-group = "precommit" }, |
| 330 |
"packaging>=24.2", |
| 331 |
"tomlkit>=0.13.3", |
| 332 |
"ipdb>=0.13.13", |
| 333 |
"ipython>=8.18.1", |
| 334 |
] |