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

Fix overriding AppConfig.default_auto_field with string value #1596

Merged
merged 7 commits into from Jun 29, 2023

Conversation

GabDug
Copy link
Contributor

@GabDug GabDug commented Jun 28, 2023

I have made things!

Loosen the typing for AppConfig.default_auto_field to allow str or @property-like

Related issues

Format is:

Copy link
Contributor

@christianbundy christianbundy left a comment

Choose a reason for hiding this comment

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

I don't have approve perms, but this LGTM. Thanks for the fix!

@intgr
Copy link
Collaborator

intgr commented Jun 28, 2023

We should make a release with this fix. Unfortunately, I have issues with my computer and won't be able to release a fixed django-stubs until tomorrow evening. Anyone else up for it?

Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Thanks for contributing the fix so quickly!

I'll go ahead and do a quick release it to close the regression.

@intgr intgr changed the title fix: default_auto_field is str or @property-like Fix overriding AppConfig.default_auto_field with string value Jun 29, 2023
@intgr intgr merged commit 011b641 into typeddjango:master Jun 29, 2023
28 of 29 checks passed
@intgr intgr mentioned this pull request Jun 29, 2023
@intgr
Copy link
Collaborator

intgr commented Jun 29, 2023

This was fixed in django-stubs 4.2.3.

@WhyNotHugo
Copy link
Contributor

Thanks!

@GabDug GabDug deleted the issue-1593 branch June 30, 2023 08:32
descope bot added a commit to descope/django-descope that referenced this pull request Jul 20, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [django-stubs](https://togithub.com/typeddjango/django-stubs)
([changelog](https://togithub.com/typeddjango/django-stubs/releases)) |
dev | patch | `4.2.2` -> `4.2.3` |

---

### Release Notes

<details>
<summary>typeddjango/django-stubs (django-stubs)</summary>

###
[`v4.2.3`](https://togithub.com/typeddjango/django-stubs/releases/tag/4.2.3)

[Compare
Source](https://togithub.com/typeddjango/django-stubs/compare/4.2.2...4.2.3)

This version fixes two regressions in previons `django-stubs` release
and also a few other fixes and improvements. Special thanks to
[@&#8203;GabDug](https://togithub.com/GabDug) for contributing
regression fixes on a short order.

This time there is no corresponding release of `django-stubs-ext`.

##### Stubs fixes

- Fixed type error when subclassing `AppConfig` and assigning string to
`default_auto_field` by [@&#8203;GabDug](https://togithub.com/GabDug) in
[typeddjango/django-stubs#1596
- Fixed type error when subclassing `MiddlewareMixin.__call__()` and
using `return self.get_response()` by
[@&#8203;GabDug](https://togithub.com/GabDug) in
[typeddjango/django-stubs#1595
- Allow `None` as `redirect_field_name` value for `@user_passes_test`
and `@login_required` decorators by
[@&#8203;JoeHitchen](https://togithub.com/JoeHitchen) in
[typeddjango/django-stubs#1600

##### Plugin fixes

- Fixed long-standing issue with `Date(Time)Field` when using mypy
setting `disallow_any_explicit` by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1599

##### Stubs changes

- Added `BigIntegerField.MAX_BIGINT` attribute by
[@&#8203;asottile](https://togithub.com/asottile) in
[typeddjango/django-stubs#1598
- Improved Jinja2 types and updated `pytest-mypy-plugins` by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1601

##### CI/Testing

- Run tests in multiple shards and all Python versions by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1603

##### Housekeeping

- Converted `_typeshed.Self` usages to `typing_extensions.Self` (PEP
673) by [@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#1591
- Version 4.2.3 release (django-stubs only) by
[@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#1604

#### New Contributors

- [@&#8203;JoeHitchen](https://togithub.com/JoeHitchen) made their first
contribution in
[typeddjango/django-stubs#1600

**Full Changelog**:
typeddjango/django-stubs@4.2.2...4.2.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xLjExIiwidXBkYXRlZEluVmVyIjoiMzYuMS4xMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: descope[bot] <descope[bot]@users.noreply.github.com>
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.

AppConfig.default_auto_field -- Incompatible types in assignment
5 participants