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

Upgrade to Django 5.0 and Python 3.12 #338

Merged
merged 22 commits into from
Feb 29, 2024
Merged

Upgrade to Django 5.0 and Python 3.12 #338

merged 22 commits into from
Feb 29, 2024

Conversation

silviogutierrez
Copy link
Owner

  • Check in
  • Working
  • Fixes

@silviogutierrez silviogutierrez added the snapshot Triggers a snapshot release to NPM and PyPI label Feb 25, 2024
@github-actions github-actions bot removed the snapshot Triggers a snapshot release to NPM and PyPI label Feb 25, 2024
@silviogutierrez silviogutierrez added the snapshot Triggers a snapshot release to NPM and PyPI label Feb 25, 2024
@github-actions github-actions bot removed the snapshot Triggers a snapshot release to NPM and PyPI label Feb 25, 2024
@silviogutierrez silviogutierrez added the snapshot Triggers a snapshot release to NPM and PyPI label Feb 26, 2024
@github-actions github-actions bot removed the snapshot Triggers a snapshot release to NPM and PyPI label Feb 26, 2024
@silviogutierrez silviogutierrez added the snapshot Triggers a snapshot release to NPM and PyPI label Feb 27, 2024
@github-actions github-actions bot removed the snapshot Triggers a snapshot release to NPM and PyPI label Feb 27, 2024
@silviogutierrez silviogutierrez changed the title upgrade/django 5.0 Upgrade to Django 5.0 and Python 3.12 Feb 27, 2024
@silviogutierrez
Copy link
Owner Author

@crgwbr heads up, this is ready to go and already used in production.

Snapshot: [email protected] and reactivated==0.38.2a2263 if you want to test it out.

@crgwbr
Copy link
Contributor

crgwbr commented Feb 27, 2024

@silviogutierrez Tangential to this since your Mypy plugin changes are already merged, but I'm getting a mypy error after updating it to 1.8.0:

error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.8.0
Traceback (most recent call last):
  File "mypy/semanal.py", line 6539, in accept
  File "mypy/nodes.py", line 1142, in accept
  File "mypy/semanal.py", line 1612, in visit_class_def
  File "mypy/semanal.py", line 1679, in analyze_class
  File "mypy/semanal.py", line 1785, in analyze_namedtuple_classdef
  File "mypy/semanal.py", line 1731, in analyze_class_body_common
  File "mypy/semanal.py", line 1802, in apply_class_plugin_hooks
  File "/Users/crgwbr/Library/Caches/pypoetry/virtualenvs/thelabui-jrO8iOca-py3.11/lib/python3.11/site-packages/reactivated/plugin.py", line 72, in analyze_template
    return_type=Instance(
                ^^^^^^^^^
  File "mypy/types.py", line 1363, in __init__
TypeError: mypy.nodes.TypeInfo object expected; got mypy.nodes.PlaceholderNode

Any idea what's up there?

@silviogutierrez
Copy link
Owner Author

Nothing comes to mind other than the plugin being super brittle. I'm hoping to be able to get rid of it or sponsor someone on the mypy/django-stubs team to make it more reliable.

Anecdotally, on my codebases, I had a ton of errors like that till I fixed other mypy issues. The biggest change is that now Pick[] requires Literal around it. Docs reflect this.

Once I updated all my other mypy issues, the crashes went away.

If I manually edit plugin.py and add print(template_response.node) right above, I get TypeInfo, not a placeholder node. On every codebase I've edited. Make sure to update django-stubs as well, see development/requirements.txt for versions.

@crgwbr
Copy link
Contributor

crgwbr commented Feb 28, 2024

Ok. For now I've just disabled the reactivated plugin in our mypy config. Apart from that, these changes LGTM.

@kodiakhq kodiakhq bot merged commit 1224b2c into main Feb 29, 2024
13 checks passed
@kodiakhq kodiakhq bot deleted the upgrade/django-5.0 branch February 29, 2024 06:51
@github-actions github-actions bot locked and limited conversation to collaborators Feb 29, 2024
@silviogutierrez
Copy link
Owner Author

@crgwbr : thanks, keep me posted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants