Source: django-tastypie
Version: 0.14.3-1
Severity: grave
Justification: renders package unusable
X-Debbugs-Cc: [email protected]

Hello there, dear maintainers,

Since the release of Django 4, many breaking changes are affecting 
django-tastypie, making it pretty much unusable.
See the following session in an up-to-date `sid` container:

root@sid:/tmp# dpkg-query -W python3-django
python3-django  3:4.2.26-1
root@sid:/tmp# dpkg-query -W python3-django-tastypie
python3-django-tastypie 0.14.3-1
root@sid:/tmp# django-admin startproject tastytest
root@sid:/tmp# cd tastytest/
root@sid:/tmp/tastytest# cat - >tastytest/urls.py <<EOF
from django.urls.conf import re_path, include
from tastypie.api import Api
from myapp.api import EntryResource

v1_api = Api(api_name='v1')
v1_api.register(EntryResource())

urlpatterns = [
    # The normal jazz here then...
    re_path(r'^api/', include(v1_api.urls)),
]
EOF
root@sid:/tmp/tastytest# ./manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/lib/python3.13/threading.py", line 1044, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/lib/python3.13/threading.py", line 995, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 64, in 
wrapper
    fn(*args, **kwargs)
    ~~^^^^^^^^^^^^^^^^^
  File 
"/usr/lib/python3/dist-packages/django/core/management/commands/runserver.py", 
line 133, in inner_run
    self.check(display_num_errors=True)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 
485, in check
    all_issues = checks.run_checks(
        app_configs=app_configs,
    ...<2 lines>...
        databases=databases,
    )
  File "/usr/lib/python3/dist-packages/django/core/checks/registry.py", line 
88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/usr/lib/python3/dist-packages/django/core/checks/urls.py", line 14, in 
check_url_config
    return check_resolver(resolver)
  File "/usr/lib/python3/dist-packages/django/core/checks/urls.py", line 24, in 
check_resolver
    return check_method()
  File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 494, in 
check
    for pattern in self.url_patterns:
                   ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 57, in 
__get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 715, in 
url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 57, in 
__get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 708, in 
urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1023, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/tmp/tastytest/tastytest/urls.py", line 2, in <module>
    from tastypie.api import Api
  File "/usr/lib/python3/dist-packages/tastypie/api.py", line 3, in <module>
    from django.conf.urls import url, include
ImportError: cannot import name 'url' from 'django.conf.urls' 
(/usr/lib/python3/dist-packages/django/conf/urls/__init__.py). Did you mean: 
'urls'?
^Croot@sid:/tmp/tastytest#

This can be fixed by simply packaging a newer upstream release, as they support 
Django up to 5.2.

A branch fixing this can be found here: 
https://salsa.debian.org/python-team/packages/django-tastypie/-/merge_requests/2

Thanks
Skia

-- System Information:
Debian Release: forky/sid
  APT prefers resolute
  APT policy: (500, 'resolute'), (500, 'questing-updates'), (500, 'questing'), 
(200, 'noble-updates'), (200, 'noble-backports'), (200, 'noble'), (100, 
'resolute-proposed'), (100, 'questing-proposed')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.17.0-7-generic (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Reply via email to