Skip to content

Run checks against Django 4.1 and Python 3.11 #1223

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

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

michael-k
Copy link
Contributor

  • Run the mypy-self-check and typecheck jobs on GitHub Actions against Python 3.11
  • Run the typecheck job on GitHub Actions against Django 4.1
  • Fix compatibility of enums with Python 3.11
  • Add stubs for PY310 and PY311
  • Add trove classifiers (django-stubs already has one for Django 4.1 from Update mypy to 0.981 #1167)

Related issues

n/a

@@ -15,6 +15,7 @@
"2.2": "44e7cca62382f2535ed0f5d2842b433f0bd23a57",
"3.2": "0153a63a674937e4a56d9d5e4ca2d629b011fbde",
"4.0": "67d0c4644acfd7707be4a31e8976f865509b09ac",
"4.1": "7dfd29b84e5a27d61ae62cb5ed9122d5a99ee1be",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

4.1.3 because it's the first release that supports Python 3.11. I can point that to 4.0 if required.
django/django@7dfd29b

@sobolevn
Copy link
Member

sobolevn commented Nov 3, 2022

Technically 3.11 is not fully supported by the current mypy.
But, I think we are not going to use except* anytime soon.

@@ -34,5 +40,5 @@ class _TextChoicesMeta(ChoicesMeta):
values: List[str] = ...

class TextChoices(str, Choices, metaclass=_TextChoicesMeta):
@property
@enum_property
Copy link
Member

Choose a reason for hiding this comment

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

This won't be supported by mypy.

Copy link
Contributor Author

@michael-k michael-k Nov 3, 2022

Choose a reason for hiding this comment

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

Without it the mypy-self-check job failed with

> Run mypy --cache-dir=/dev/null --no-incremental django-stubs
django-stubs/db/models/enums.pyi:16: error: Signature of "value" incompatible with supertype "Enum"
django-stubs/db/models/enums.pyi:27: error: Signature of "value" incompatible with supertype "Enum"
django-stubs/db/models/enums.pyi:38: error: Signature of "value" incompatible with supertype "Enum"
Found 3 errors in 1 file (checked 675 source files)
Error: Process completed with exit code 1.

See https://github.com/michael-k/django-stubs/actions/runs/3385444913/jobs/5623591875

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes I think this is necessary. The same errors also appear in #1223

Maybe add a test with reveal_type() on the value property just in case?

Copy link
Contributor

Choose a reason for hiding this comment

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

The same errors also appear in #1223

That is this PR, did you mean to link to a different one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

Thanks, let's try it!

@sobolevn sobolevn merged commit a0e98a2 into typeddjango:master Nov 11, 2022
@michael-k michael-k deleted the python3.11-django4.1 branch November 14, 2022 11:15
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.

4 participants