[build-system] requires = ["hatchling"] build-backend = "hatchling.build" [project] name = "django-polymorphic" version = "4.11.7" description = "Seamless polymorphic inheritance for Django models." readme = "README.md" license = "BSD-3-Clause" license-files = [ "LICENSE", "src/polymorphic/contrib/drf/LICENSE" ] requires-python = ">=3.10,<4.0" repository = "https://github.com/django-commons/django-polymorphic" homepage = "https://django-polymorphic.rtfd.io" authors = [ {name = "Bert Constantin", email = "bert.constantin@gmx.de"}, {name = "Diederik van der Boor", email = "vdboor@edoburu.nl"}, {name = "Christopher Glass", email = "tribaal@ubuntu.com"}, ] maintainers = [ {name = "Brian Kohan", email = "bckohan@gmail.com"} ] keywords = [ "django", "polymorphic", "polymorphism", "django-admin", "django-orm", "django-formsets", "model" ] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 4.2", "Framework :: Django :: 5.2", "Framework :: Django :: 6.0", "Framework :: Django :: 6.1", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Topic :: Database", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed" ] dependencies = [ "Django >= 4.2", "typing_extensions >= 4.12.0", ] [project.urls] "Download" = "https://github.com/django-commons/django-polymorphic/tarball/main" "Documentation" = "https://django-polymorphic.readthedocs.io" "Homepage" = "https://github.com/django-commons/django-polymorphic" "Repository" = "https://github.com/django-commons/django-polymorphic" "Issues" = "https://github.com/django-commons/django-polymorphic/issues" "Changelog" = "https://django-polymorphic.readthedocs.io/en/stable/changelog/index.html" "Code_of_Conduct" = "https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md" [tool.uv] package = true conflicts = [ [{ group = "dj42" }, { group = "dj52" }, { group = "dj61" }], [{ group = "mysqlclient14" }, { group = "mysqlclient2x" }], [{ group = "psycopg2" }, { group = "psycopg3" }], [{ group = "cx_oracle" }, { group = "oracledb" }], ] [tool.uv.sources] # DRF's latest release (3.17.1) is incompatible with Django 6.1 (it imports the # removed django.utils.cache.cc_delim_re) - use master until a fixed release ships djangorestframework = [ { git = "https://github.com/encode/django-rest-framework", group = "dj61" }, ] [tool.hatch.version] path = "src/polymorphic/__init__.py" [tool.hatch.build.targets.sdist] include = ["src/polymorphic"] exclude = ["src/polymorphic/tests"] [tool.hatch.build.targets.wheel] packages = ["src/polymorphic"] artifacts = ["*.mo", "py.typed"] [tool.doc8] max-line-length = 100 sphinx = true [tool.ruff] line-length = 99 target-version = "py310" exclude = [ "**/migrations/*.py", "**/migrations/**", "src/polymorphic/tests/examples", ] [tool.ruff.lint] extend-ignore = [ "E501", ] select = [ "E", "F", "I", "W", ] [tool.ruff.lint.per-file-ignores] "example/**" = [ "F401", "F403", "F405", "F841", "I", ] "src/polymorphic/tests/**" = [ "F401", "F403", "F405", "F841", "I", ] [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "polymorphic.tests.settings" pythonpath = ["src"] django_find_project = false testpaths = ["src/polymorphic/tests"] python_files = "test*.py" python_classes = "Test*" python_functions = "test_*" norecursedirs = "*.egg .eggs dist build docs .tox .git __pycache__" markers = [ "integration: tests under examples/integrations (opt-in)", "ui: browser-based tests", ] addopts = [ "--strict-markers", "-m", "not integration", ] [tool.coverage.run] source = [ "src" ] omit = ["*/migrations/*", "*/tests/*", "src/polymorphic/tests/*"] branch = true relative_files = true [tool.coverage.report] show_missing = true [tool.mypy] strict = false warn_return_any = true warn_unused_configs = true disallow_untyped_defs = false disallow_incomplete_defs = false check_untyped_defs = true disallow_untyped_decorators = false no_implicit_optional = true warn_redundant_casts = true warn_unused_ignores = true warn_no_return = true warn_unreachable = true strict_equality = true plugins = ["mypy_django_plugin.main"] [[tool.mypy.overrides]] module = "polymorphic.tests.*" ignore_errors = true [[tool.mypy.overrides]] module = "polymorphic.tests.examples.type_hints.*" ignore_errors = false [tool.django-stubs] django_settings_module = "polymorphic.tests.settings" [tool.pyright] pythonVersion = "3.10" typeCheckingMode = "basic" include = ["src/polymorphic"] exclude = [ "**/migrations", "example", "src/polymorphic/**/tests/**", ] reportMissingImports = true reportMissingTypeStubs = false reportUnusedImport = true reportUnusedClass = false reportUnusedFunction = false reportUnusedVariable = true reportDuplicateImport = true reportOptionalMemberAccess = false reportGeneralTypeIssues = false reportOptionalSubscript = false reportPrivateImportUsage = false [tool.bandit] targets = ["src"] exclude_dirs = [ "./src/polymorphic/tests", "./src/polymorphic/migrations", "./example", "./.venv", "./docs", ] skips = [ "B101", # assert_used - assertions are fine in tests and Django code ] # Severity level threshold # Options: LOW, MEDIUM, HIGH severity = "MEDIUM" # Confidence level threshold # Options: LOW, MEDIUM, HIGH confidence = "MEDIUM" [dependency-groups] typing = [ "django-stubs>=5.1.1", "django-stubs-ext>=5.1.1", "djangorestframework-stubs>=3.16.1", "pyright>=1.1.390", "mypy>=1.19.1", ] lint = [ "ruff>=0.15.0", "readme-renderer[md]>=43.0", "doc8>=1.1.2", "bandit[toml,sarif]>=1.7.10" ] coverage = ["coverage>=7.6.1"] test = [ { include-group = "coverage" }, "django-test-migrations>=1.5.0", "pytest>=8.3.4", "pytest-cov>=5.0.0", "pytest-django>=4.10.0", "pytest-mock>=3.15.1", "pytest-playwright>=0.7.2" ] docs = [ "django-extra-views>=0.16.0", "furo>=2025.7.19", "sphinx>=7.1.2", "sphinx-autobuild>=2024.10.3", "sphinxcontrib-django>=2.5", ] psycopg2 = [ "psycopg2>=2.9.10", ] psycopg3 = [ "psycopg>=3.3.2", ] mysql = [ "mysqlclient>=1.4.0", ] mysqlclient14 = [ "mysqlclient==1.4.3", ] mysqlclient2x = [ "mysqlclient>=2.2.8", ] cx_oracle = [ "cx-oracle>=8.3.0" ] oracledb = [ "oracledb>=2.3.0", ] reversion = [ "django-reversion>=6.1.0", ] extra-views = [ "django-extra-views>=0.16.0", ] drf = [ "django-filter>=24.0", "djangorestframework>=3.16.1", ] guardian = [ "django-guardian", ] integrations = [ { include-group = "extra-views" }, { include-group = "drf" }, ] precommit = [ "pre-commit>=3.5.0", ] # for CI and testing dj42 = [ "Django>=4.2,<5.0; python_version < '3.13'", ] dj52 = [ "Django>=5.2,<6.0" ] dj61 = [ "Django>=6.1rc1,<6.2; python_version >= '3.12'", "djangorestframework; python_version >= '3.12'", ] dev = [ { include-group = "typing" }, { include-group = "test" }, { include-group = "docs" }, { include-group = "drf" }, { include-group = "lint" }, { include-group = "precommit" }, "packaging>=24.2", "tomlkit>=0.13.3", "ipdb>=0.13.13", "ipython>=8.18.1", ]