djangorestframework-stubs icon indicating copy to clipboard operation
djangorestframework-stubs copied to clipboard

Missing Release for latest mypy release (1.11.0)

Open leandrodesouzadev opened this issue 1 year ago • 6 comments

Bug report

What's wrong

The latest version available (3.15.0) requires a different mypy version from what the latest django-stubs latest version (5.0.4) requires. Here's a traceback when trying to use the latest version from each package

31.98 INFO: pip is looking at multiple versions of djangorestframework-stubs[compatible-mypy] to determine which version is compatible with other requirements. This could take a while.       
32.00 ERROR: Cannot install django-stubs[compatible-mypy]==5.0.4, djangorestframework-stubs[compatible-mypy]==3.15.0 and mypy==1.11.1 because these package versions have conflicting dependencies.
32.00
32.00 The conflict is caused by:
32.00     The user requested mypy==1.11.1
32.00     django-stubs[compatible-mypy] 5.0.4 depends on mypy~=1.11.0; extra == "compatible-mypy"
32.00     djangorestframework-stubs[compatible-mypy] 3.15.0 depends on mypy~=1.10.0; extra == "compatible-mypy"
32.00
32.00 To fix this you could try to:
32.00 1. loosen the range of package versions you've specified
32.00 2. remove package versions to allow pip to attempt to solve the dependency conflict
32.00
32.26 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

How is that should be

It looks like that the breaking change can be fixed by releasing the current main branch

System information

  • OS: Windows 11
  • python version: 3.12.5
  • django version: 4.2.11
  • mypy version: 1.11.1
  • django-stubs version: 5.0.4

leandrodesouzadev avatar Aug 15 '24 13:08 leandrodesouzadev

@intgr @flaeppe we should make a new release of drf-stubs to fix this

sobolevn avatar Aug 15 '24 14:08 sobolevn

Yeah sure, that sounds reasonable

flaeppe avatar Aug 15 '24 18:08 flaeppe

In the meantime, is there a way to install djangorestframework-stubs, or do I just wait for the new release?

akhayyat avatar Aug 18 '24 09:08 akhayyat

@akhayyat you can use the latest git commit from main branch 👍

sobolevn avatar Aug 18 '24 10:08 sobolevn

Confirming the issue.

I have django-stubs[compatible-mypy]==5.0.4 and mypy==1.11.1

When I run pip install "djangorestframework-stubs[compatible-mypy]==3.15.0"

I got:

Installing collected packages: mypy, django-stubs
  Attempting uninstall: mypy
    Found existing installation: mypy 1.11.1
    Uninstalling mypy-1.11.1:
      Successfully uninstalled mypy-1.11.1
  Attempting uninstall: django-stubs
    Found existing installation: django-stubs 5.0.4
    Uninstalling django-stubs-5.0.4:
      Successfully uninstalled django-stubs-5.0.4
Successfully installed django-stubs-5.0.2 mypy-1.10.1

ivan-klass avatar Aug 21 '24 19:08 ivan-klass

Is there any timeline to issue this release?

leandrodesouzadev avatar Aug 27 '24 18:08 leandrodesouzadev

@flaeppe I would really like to upgrade to the latest version of mypy and django-stubs. It seems that what's missing is just this GH/pypi release.

leandrodesouzadev avatar Sep 02 '24 10:09 leandrodesouzadev

Any updates on this? It's literally the only thing that blocks us from smooth usage of new 3.12 syntax such as type keyword and generic definitions which was added to mypy 1.11 with -enable-incomplete-feature=NewGenericSyntax

If the problem is to align new stub version with the same DRF version, maybe consider versioning approach like they do in requests typing?

ivan-klass avatar Sep 06 '24 06:09 ivan-klass

Version 3.15.1 is out!

  • PyPI https://pypi.org/project/djangorestframework-stubs/3.15.1/
  • Release notes https://github.com/typeddjango/djangorestframework-stubs/releases/tag/3.15.1

intgr avatar Sep 11 '24 20:09 intgr

Also to facilitate more frequent releases in the future, I've opened PRs:

  • #660
  • #661

intgr avatar Sep 11 '24 21:09 intgr