Package: python3-djangorestframework-spectacular
Version: 0.13.1-1
Severity: grave
Tags: patch
Justification: renders package unusable

Hello,

This package does not work at all, it attemps to import unavailable
dj_rest_auth module at runtime and this module is supposed to be an optional
dependency (which is not available in Debian archive).

I had a talk with upstream on Github:
https://github.com/tfranzel/drf-spectacular/issues/411

And it turned out upstream did some work to render optional modules really
optional in recent versions.

The import bug can actually be seen while building the package from a clean
chroot, Sphinx doc is not getting generated correctly (but does not crash build
for some reason):

WARNING: autodoc: failed to import module 'openapi' from module
'drf_spectacular'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line
67, in import_module
    return importlib.import_module(modname)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/tmp/python-drf-spectacular-0.13.1/drf_spectacular/openapi.py", line
21, in <module>
    from drf_spectacular.contrib import *  # noqa: F403, F401
  File "/tmp/python-drf-
spectacular-0.13.1/drf_spectacular/contrib/rest_auth.py", line 3, in <module>
    pytest.importorskip("dj_rest_auth")
  File "/usr/lib/python3/dist-packages/_pytest/outcomes.py", line 212, in
importorskip
    raise Skipped(reason, allow_module_level=True) from None
Skipped: could not import 'dj_rest_auth': No module named 'dj_rest_auth'

My django application crashes with the same error message, it cannot start.

I updated the package on SALSA to latest upstream version:
https://salsa.debian.org/python-team/packages/python-drf-spectacular

And this one is building fine, unittests run successfully and my Django app is
working again.

I'm not sure if it's too late to be included in Debian 11, but imho, it's
better not to have it than having it in current state.

Best regards, Adam.

-- System Information:
Debian Release: 11.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-6-amd64 (SMP w/32 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply via email to