Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add django-stubs v1.10.0 compatibility #203

Merged

Conversation

henribru
Copy link
Contributor

@henribru henribru commented Mar 26, 2022

@henribru henribru force-pushed the django-stubs-1.10.0-compatibility branch 3 times, most recently from 884c04a to 27f32af Compare March 26, 2022 07:42
@henribru
Copy link
Contributor Author

Struggling a bit to get CI passing ...

setup.py Outdated Show resolved Hide resolved
@henribru henribru force-pushed the django-stubs-1.10.0-compatibility branch from 27f32af to 1acdb31 Compare March 26, 2022 17:37
@henribru henribru force-pushed the django-stubs-1.10.0-compatibility branch from 1acdb31 to 86feaa5 Compare March 26, 2022 17:41
@henribru
Copy link
Contributor Author

The remaining failure seems to be caused by django-stubs importing Literal from typing, which isn't supported in 3.7 🤔

@sobolevn
Copy link
Member

Yeah, it should be typing_extensions.

@@ -20,8 +20,8 @@ def find_stub_files(name):
readme = f.read()

dependencies = [
"mypy>=0.790",
"django-stubs>=1.7.0",
"mypy>=0.930,<0.950",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this upper bound on mypy necessary? (and does it relate to the purpose of this MR?)

This project releases rather infrequently. So as a user I'd prefer that it did not pin me to a mypy version that will soon become stale.

If and when mypy release a breaking change, I can always pin it myself - but the recent evidence (per the current requirement without an upper bound) is that that's probably not needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mypy can break its plugin API in new releases. We do the same in django-stubs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, well if I'd known that I'd have asked you not to do it there too!

Perhaps you know something that I don't about mypy versioning, it seems mysterious to me. Is there any reason to suspect that 0.950 would be breaking but 0.949 would not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this upper bound on mypy necessary? (and does it relate to the purpose of this MR?

I just set it to the same one as django-stubs as suggested in #203 (comment).

@henribru
Copy link
Contributor Author

The remaining failure seems to be caused by django-stubs importing Literal from typing, which isn't supported in 3.7 🤔

I've opened a PR against django-stubs to fix this

@henribru
Copy link
Contributor Author

henribru commented Mar 30, 2022

The PR against django-stubs has been merged, so I guess we're mostly waiting for a new release there

Edit: Ah wait, there's a new release on pypi already, I was looking at the Github releases. I'll update this PR

@henribru
Copy link
Contributor Author

Passing now, after fixing another unrelated failure 😅

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@henribru henribru force-pushed the django-stubs-1.10.0-compatibility branch from 56faa31 to 18400fa Compare March 31, 2022 20:36
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thank you!

@sobolevn sobolevn merged commit 946c7d6 into typeddjango:master Mar 31, 2022
@henribru henribru deleted the django-stubs-1.10.0-compatibility branch March 31, 2022 20:39
ir4y added a commit to beda-software/drf-writable-nested that referenced this pull request Apr 3, 2022
ir4y added a commit to beda-software/drf-writable-nested that referenced this pull request Apr 3, 2022
XF-FW pushed a commit to XF-FW/djangorestframework-stubs that referenced this pull request Apr 7, 2022
* Add django-stubs v1.10.0 compatibility

* Bump django-stubs to v1.10.1

* Pin click for black

* Bump Black to 22.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError for extract_django_settings_module when combined with newest django-stubs
3 participants