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

Version 5.1.2 release #2478

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Version 5.1.2 release #2478

merged 2 commits into from
Jan 14, 2025

Conversation

vitosamson
Copy link
Contributor

Bumps version to 5.1.2 to prepare for a new release

Related issues

@vitosamson vitosamson marked this pull request as ready for review January 10, 2025 19:43
README.md Outdated
@@ -49,6 +49,7 @@ We rely on different `django` and `mypy` versions:

| django-stubs | Mypy version | Django version | Django partial support | Python version |
|----------------|--------------|----------------|------------------------|----------------|
| 5.1.2 | 1.13.x | 5.1 | 4.2 | 3.8 - 3.12 |
Copy link
Member

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 Jan 10, 2025

Choose a reason for hiding this comment

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

We also support 3.9 - 3.13 now

@sobolevn
Copy link
Member

I would also wait for #2476 to land first :)

@thinkwelltwd
Copy link

thinkwelltwd commented Jan 13, 2025

Is there anything that could be done on #2461 before releasing? That bug bit extremely hard on a large project. Is there anything I can do to assist in resolving it? (I'm a greenhorn, but would be glad to assist if someone with expertise asked for more details, etc.)

@sobolevn
Copy link
Member

I would really appreciate a PR for that problem!

@vitosamson
Copy link
Contributor Author

@sobolevn I updated the version compatibility table. I wonder if it would be possible to do a more frequent release cadence than every couple months to help prevent fixes from piling up?

@thinkwelltwd a minimal reproducible example of that bug would probably help move it forward. It looks like there is at least a test case that covers custom user models:

- case: test_objects_using_auth_user_model_picks_up_configured_type
main: |
from typing import Union
from django.contrib.auth import authenticate, aauthenticate, get_user, get_user_model, login
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth.models import AnonymousUser
from django.http import HttpRequest, HttpResponse
from myapp.models import MyUser
reveal_type(authenticate()) # N: Revealed type is "Union[myapp.models.MyUser, None]"
async def f() -> None:
reveal_type(await aauthenticate()) # N: Revealed type is "Union[myapp.models.MyUser, None]"
reveal_type(get_user_model()) # N: Revealed type is "Type[myapp.models.MyUser]"
reveal_type(login) # N: Revealed type is "def (request: django.http.request.HttpRequest, user: Union[myapp.models.MyUser, None], backend: Union[Type[django.contrib.auth.backends.BaseBackend], builtins.str, None] =)"
reveal_type(get_user) # N: Revealed type is "def (request: Union[django.http.request.HttpRequest, django.test.client.Client]) -> Union[myapp.models.MyUser, django.contrib.auth.models.AnonymousUser]"
reveal_type(ModelBackend().authenticate(None)) # N: Revealed type is "Union[myapp.models.MyUser, None]"
def check_user(user: Union[MyUser, AnonymousUser]) -> bool: return True
@user_passes_test(check_user)
def view(request: HttpRequest) -> HttpResponse: ...
custom_settings: |
INSTALLED_APPS = ("django.contrib.contenttypes", "django.contrib.auth", "myapp")
AUTH_USER_MODEL = "myapp.MyUser"
files:
- path: myapp/__init__.py
- path: myapp/models.py
content: |
from django.db import models
class MyUser(models.Model):
...

@sobolevn
Copy link
Member

I wonder if it would be possible to do a more frequent release cadence than every couple months to help prevent fixes from piling up?

Sure. The only problem is maintainers' time :)

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.

Ok, I am going to make a release now, because I need [email protected] on my project.

@sobolevn sobolevn merged commit 2de9932 into typeddjango:master Jan 14, 2025
40 checks passed
@sobolevn
Copy link
Member

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.

3 participants