Bugzilla Automation <[email protected]> has asked freebsd-python (Nobody)
<[email protected]> for maintainer-feedback:
Bug 300115: www/py-django-bitfield: Update to 2.4.0
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300115
--- Description ---
django-bitfield cannot be imported when Django uses psycopg 3, which
its postgresql backend prefers when it is installed, on any Python
version:
AttributeError: module 'psycopg' has no attribute 'extensions'
bitfield/types.py registers its PostgreSQL adapters through
Database.extensions, which only psycopg2 has. In addition, since Django
5.0 FieldListFilter.used_parameters holds lists, so the admin changelist
fails with TypeError in BitHandler as soon as the bitfield filter is
used. 2.4.0 still has both.
The patch keeps the psycopg2 path and registers int dumpers for Bit and
BitHandler with psycopg 3 otherwise, takes the last value of the filter
parameters, as Django's own filters do, and updates the port to 2.4.0
(2026-08-02):
- the sdist is now django_bitfield-<version>.tar.gz, so DISTNAME is set;
- six is dropped (2.4.0 no longer imports it);
- the admin patch is rebased and the types patch refreshed;
- concurrent is added to USE_PYTHON (the package does not change),
pkg-descr is expanded and the patches in files/ get a header saying
what each one does and its upstream status (Description, Issue ID,
Changeset, TODO).
Misc changes:
- the port switches to USE_PYTHON=pep517 (the package metadata becomes
dist-info)
Impact: no ports depend on it.
Tested: poudriere bulk -C -t on 14.5-RELEASE amd64, both with Python
3.12 and with DEFAULT_VERSIONS+=python=3.13: builds, all 7 modules
import from the built package, and BitHandler works with Django 5.2.18.
Earlier, with 2.2.0 and the same patches, the admin changelist with the
bitfield filter returned 200 on Django 5.2, and with psycopg 3.3.6 Bit
and BitHandler adapt to integer literals and binary int8.
After the switch to USE_PYTHON=pep517, the package installs its metadata
as .dist-info, and the modules still import from the built package.
Upstream: master has the same code; both fixes have been submitted
upstream: the psycopg 3 support
(https://github.com/disqus/django-bitfield/pull/139) and the admin filter
(https://github.com/disqus/django-bitfield/pull/140).