#32128 closed Cleanup/optimization (fixed)
Issue with asgiref dependency installing Django 3.1.x
| Reported by: | Carlton Gibson | Owned by: | Carlton Gibson |
|---|---|---|---|
| Component: | Core (Other) | Version: | 3.1 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Andrew Godwin, David Smith, Mariusz Felisiak | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
It looks like we've misspecified the asgiref dependency in Django 3.1.x.
Specifically, I think we wanted latest asgiref that wasn't 4 (i.e. a break) but installing we're not picking up the latest asgiref 3.3, which we want (because it makes the thread_sensitive parameter default True).
This came up on https://github.com/django/channels/pull/1522.
An example with a fresh venv:
(tmp-472bce83ec89b59) ~/ve/tmp-472bce83ec89b59 $ pip install asgiref
Collecting asgiref
Using cached asgiref-3.3.0-py3-none-any.whl (19 kB)
Installing collected packages: asgiref
Successfully installed asgiref-3.3.0
(tmp-472bce83ec89b59) ~/ve/tmp-472bce83ec89b59 $ pip install Django
Collecting Django
Using cached Django-3.1.2-py3-none-any.whl (7.8 MB)
Collecting asgiref~=3.2.10
Using cached asgiref-3.2.10-py3-none-any.whl (19 kB)
Collecting pytz
Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Collecting sqlparse>=0.2.2
Using cached sqlparse-0.4.1-py3-none-any.whl (42 kB)
Installing collected packages: asgiref, pytz, sqlparse, Django
Attempting uninstall: asgiref
Found existing installation: asgiref 3.3.0
Uninstalling asgiref-3.3.0:
Successfully uninstalled asgiref-3.3.0
Successfully installed Django-3.1.2 asgiref-3.2.10 pytz-2020.1 sqlparse-0.4.1
(tmp-472bce83ec89b59) ~/ve/tmp-472bce83ec89b59 $ pip install -U asgiref
Collecting asgiref
Using cached asgiref-3.3.0-py3-none-any.whl (19 kB)
Installing collected packages: asgiref
Attempting uninstall: asgiref
Found existing installation: asgiref 3.2.10
Uninstalling asgiref-3.2.10:
Successfully uninstalled asgiref-3.2.10
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.
We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.
django 3.1.2 requires asgiref~=3.2.10, but you'll have asgiref 3.3.0 which is incompatible.
Successfully installed asgiref-3.3.0
- This is using the old resolver but the new one will pick asgiref 3.2.10 too.
- I installed asgiref first here just for demonstration. A straight
pip install Djangoequally picks 3.2.10.
I think this is a RB as when I pip install Django 3.1 I want (need) the latest asgiref, but hoping for opinions on that.
Change History (9)
comment:1 by , 5 years ago
| Type: | Bug → Cleanup/optimization |
|---|
comment:2 by , 5 years ago
I think we made a mistake. As the settings are users can't opt-in to the version they really should be on, without knowing that they really do want to ignore the scary warnings from pip. We've made the ~= too tight. Let's not back-and-forth on trac flags, but I think we need to fix this. 😬
comment:3 by , 5 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Tentatively accepted 😉, I would like to see docs changes (e.g. docs/topics/async.txt) as a part of this patch.
comment:4 by , 5 years ago
I did partially introduce the version bump in asgiref because I didn't want existing Django installs to just pull it in; I think incrementing the dependency in a patch release and updating the docs would be a good move here.
comment:5 by , 5 years ago
Thanks both. We should be able to adjust the requirement so it:
- Will already be satisfied if you have asgiref installed, but
- will let you update (without the scary warnings) if you
$ pip install -U asgiref
Time to have a play and see what works 😀
comment:6 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Replying to Carlton Gibson:
I don't agree, we did this on purpose to avoid any breaking changes in supported versions of
asgiref, from IRC (June 2020):As far as I'm aware
asgiref 3.3is a breaking release because it changed the default value ofthread_sensitive. We can of course change the requirements, but IMO that's a new feature (or cleanup) but not a bug. It will probably require some docs changes.