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

Python 3.11 #22

Merged
merged 2 commits into from
Aug 3, 2024
Merged

Python 3.11 #22

merged 2 commits into from
Aug 3, 2024

Conversation

JasonGrace2282
Copy link
Member

@JasonGrace2282 JasonGrace2282 commented May 15, 2024

Django 5 (Removed from PR)

Took a look through the changelog of Django 5, didn't seem that bad so went ahead and updated it.
Only change was the removal of USE_L10N (the default value became True, and the setting was deprecated).

Based off the changelog, the only breaking change that could happen is the following

Passing unsaved model instances to related filters is deprecated. In Django 5.0, the exception will be raised.

But I find this unlikely, as we are already on 4.2 and don't have any warnings.

Python

I looked through the changelog for Python 3.9, 3.10, and 3.11. None of the changes should cause problems, at least based off the porting guides for the versions.
3.11
3.10
3.9

Why not Python 3.12?
To put it simply, python 3.12 is only recently getting "accepted" into the python and linux ecosystems (it's in bugfix stage), so I figured it would be better to wait on that one. Besides, Python 3.11 goes EOL in 2027, which is long enough that it shouldn't be a big deal (however, NEP 29 recommends that Python 3.11 support should end in April 2025).

Motivation

  • Python 3.8 is going to reach EOL by the start of the 2024-25 school year (bad)
  • Django says that 4.2 is basically compatible with 5.0, after fixing deprecation warnings
  • As a grading software, Tin should always try to keep up with security fixes and bug patches.

@JasonGrace2282 JasonGrace2282 requested a review from a team as a code owner May 15, 2024 22:06
@JasonGrace2282 JasonGrace2282 changed the title Django 5 Django 5 and Python 3.11 May 15, 2024
@krishnans2006
Copy link
Member

Nice PR - thanks for doing this. Obviously, such a change requires a production server upgrade (both an Ubuntu version upgrade and a Python version upgrade), and the best time for this would probably be early summer. So, holding off on merging this PR until then.

@etnguyen03
Copy link

Django says that 4.2 is basically compatible with 5.0, after fixing deprecation warnings

Generally with CSL stuff, we've held off on upgrading Django versions until an LTS version comes out (i.e. 5.2, 6.2, etc.). Not sure if that's what you want to do

@JasonGrace2282
Copy link
Member Author

JasonGrace2282 commented May 16, 2024

Sure, I don't mind, there's no features I'm particularly excited about in django 5. I'll just remove the changes regarding django and make this PR about Python 3.11.

the best time for this would probably be early summer.

Yup, I would've recommended the very same thing.

@JasonGrace2282 JasonGrace2282 changed the title Django 5 and Python 3.11 Python 3.11 May 16, 2024
Copy link
Member

@krishnans2006 krishnans2006 left a comment

Choose a reason for hiding this comment

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

A minor suggestion before we get to testing/migration:

Pipfile Outdated Show resolved Hide resolved
@JasonGrace2282
Copy link
Member Author

JasonGrace2282 commented May 30, 2024

After #21 we would also have to update the ruff target-version option from py38 to py311, and remove the tomli dependency from pre-commit. However, this would cause pre-commit ci to auto-push updates (mostly regarding deprecations in the typing module), so I'll update that in a follow-up PR.

Copy link
Member

@krishnans2006 krishnans2006 left a comment

Choose a reason for hiding this comment

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

🤞

@krishnans2006 krishnans2006 merged commit 08016d3 into tjcsl:master Aug 3, 2024
6 checks passed
@JasonGrace2282 JasonGrace2282 deleted the dj5 branch August 4, 2024 13:40
@JasonGrace2282 JasonGrace2282 mentioned this pull request Aug 4, 2024
krishnans2006 pushed a commit that referenced this pull request Aug 5, 2024
Followup to #22 - change ruff to use python 3.11 as the base version to
get more up-to-date changes (from e.g. `pyupgrade`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Dependencies, deprecation warnings, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants