Migrating to Karni 0.3¶
Both changes are recorded in Karni's machine-readable changelog
(packages/karni/karni/changelog/0.3.0.toml). Neither needs a code rewrite,
so karni upgrade reports them with a link here and changes no files.
Upgrading¶
pipx upgrade karni-cli # the CLI carries the changelog
karni upgrade --dry-run # lists the two notes below; writes nothing
# then: pin karni to 0.3 in pyproject.toml, reinstall, run `karni check` and the tests
Modules move with core: karni-payments, karni-approvals and
karni-impersonation 0.3 require karni>=0.3,<0.4, and the module UIs peer
on @karni/ui ^0.3.0.
Breaking in 0.3¶
Django 5.2 LTS¶
Karni 0.3 requires Django>=5.2.8,<5.3 and django-unfold 0.110. Django 5.1
went out of support with security advisories that have no 5.1 fix, and on
Python 3.14 every admin page failed under it. 5.2.8 is the first release
that supports Python 3.14.
The stability promise announces a dropped Django version one minor release ahead. This one was not: it is a security fix, which the promise lets ship at once.
What to do. Upgrade Django together with Karni. EventHub, the Social
Stats rebuild and the three modules needed no code changes. If your project
pins Django itself, raise that pin to >=5.2.8,<5.3, then run your tests.
Django's own 5.2 release notes
list what changed for project code.
Role scope paths are checked at startup¶
Every path a role's grants filter on is now resolved when Django starts:
own owner paths (class Karni: owner_field), related:<key> scope paths
(class Karni: scope_paths) and whatever a custom: scope builds. A path
that does not resolve on its model is system check error karni.E214, so
runserver, migrate and karni check stop with the role, the permission
and the model named.
In 0.2 the same mistake answered 500 on the first request that used the grant, and generated tests could stay green.
What to do. Run karni check. If it reports E214, give the model the
path the role expects (karni explain E214 prints the fix), or grant
that model through a different scope.