browniebroke / django-codemod

A tool to automatically fix Django deprecations.

Home Page:https://django-codemod.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django 4 django.dispatch.Signal unexpected keyword argument providing_args

jayvdb opened this issue · comments

SUSE Tumbleweed has updated django to 4.0, and while fixing django packages I've noticed a lot of packages are failing with this.
e.g. https://build.opensuse.org/package/show/home:jayvdb:branches:devel:languages:python:django/python-django-avatar

https://docs.djangoproject.com/en/dev/releases/4.0/

See Features deprecated in 3.1 for details on these changes, including how to remove usage of these features.
..
The providing_args argument for django.dispatch.Signal is removed.

Deprecation timeline

  • Deprecated in: 3.1
  • Removed in: 4.0

This is handled by django-upgrade, see https://github.com/adamchainz/django-upgrade#signal, have you tried it? Django Upgrade took a different approach and is much faster as a result. I need to update the readme here to point to that project. Is there a reason why you cannot use it?

not going to be very reliable as it isn't a CST

AFAIK, a lot of tools aren't using CST and I rely on them everyday, they are extremely reliable: black, pyupgrade. Django-upgrade takes a similar approach and it worked fine on a project I tried it on.

I'm not familiar with build.opensuse.org, I'm not sure what I'm supposed to see in them. Can we see the logs of the problem somewhere? Can you make a summary here of what's wrong?

Yea, django-upgrade worked on most of the projects I mentioned earlier.

I think you need to create an account in order to see the build logs on OBS. The logs are under a clickable red link "failed". The .spec files in each project show where I have added django-upgrade, and the logs show it doesn't work for two of them.

If you don't want to create an OBS account, the same commands can be run on the github repos for each project.

I've done a PR for django-mailman3; the rest had other additional Django 4 problems, often the middleware get_response problem.