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

Refactor code to use Python 3.9 and 3.10 syntax #598

Merged
merged 6 commits into from
Feb 26, 2023

Conversation

ddabble
Copy link
Member

@ddabble ddabble commented Feb 26, 2023

Proposed changes

  • Set minimum required Python version to 3.10 (a11b457)
    • It's time to bump the minimum required Python version now that 3.11 has been released
    • Also made it so that we only officially support the two latest versions (determined by the README and the versions tested in python.yml), as it reduces the time necessary (by roughly a year by average - looking at the release dates of the last minor versions of Python 3) before being able to use the newest language features - which is determined by the minimum required version, naturally
  • Refactored to use Python 3.9 and 3.10 syntax (5c58503, 12a63db, f73da0b)
  • Fixed the removed python-dev apt package (82cd546)

Areas to review closely

That the refactored code retains the previous functionality.

Checklist

(If any of the points are not relevant, mark them as checked)

  • Created tests that fail without the changes, if relevant/possible
  • Made sure that your code conforms to the code style guides and that any common code smells have been addressed
    • (It's not intended that you read through this whole document, but that you get yourself an overview over its contents, and that you keep it in mind while taking a second look at your code before opening a pull request)
  • Added sufficient documentation - e.g. as docstrings or in the README, if suitable
  • Added your changes to the "Unreleased" section of the changelog - mainly the changes that are of particular interest to users and/or developers, if any
  • Added a "Deployment notes" section above, if anything out of the ordinary should be done when deploying these changes to the server

It's time to bump the minimum required Python version now that 3.11 was recently released.
Also made it so that we only officially support the two latest versions (determined by the README and the versions tested in `python.yml`),
as it reduces the time necessary (by roughly a year by average - looking at the release dates of the last minor versions of Python 3)
before being able to use the newest language features - which is determined by the minimum required version, naturally.
...now that 3.10 is the minimum required Python version.
This fixes the recent failed tests and CodeQL workflow runs, like https://github.com/MAKENTNU/web/actions/runs/4273207612.
@codecov
Copy link

codecov bot commented Feb 26, 2023

Codecov Report

Merging #598 (9c7f85f) into dev (8473975) will decrease coverage by 0.06%.
The diff coverage is 77.58%.

@@            Coverage Diff             @@
##              dev     #598      +/-   ##
==========================================
- Coverage   87.76%   87.70%   -0.06%     
==========================================
  Files         133      133              
  Lines        5572     5578       +6     
==========================================
+ Hits         4890     4892       +2     
- Misses        682      686       +4     
Impacted Files Coverage Δ
internal/signals.py 40.00% <0.00%> (-2.86%) ⬇️
util/formfields.py 30.43% <13.33%> (-2.90%) ⬇️
internal/forms.py 87.15% <80.00%> (+0.24%) ⬆️
web/widgets.py 95.17% <84.61%> (+0.10%) ⬆️
make_queue/models/machine.py 88.15% <86.66%> (-0.59%) ⬇️
card/modelfields.py 100.00% <100.00%> (ø)
checkin/views.py 44.57% <100.00%> (ø)
dataporten/ldap_utils.py 66.66% <100.00%> (-0.78%) ⬇️
internal/validators.py 85.71% <100.00%> (ø)
make_queue/models/reservation.py 94.73% <100.00%> (+0.01%) ⬆️
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ddabble
Copy link
Member Author

ddabble commented Feb 26, 2023

Merging without explicit approval, as the Dev committee agreed to merge these changes and assume they're relatively bug-free, simply to get things done quicker.

@ddabble ddabble merged commit a70723a into dev Feb 26, 2023
@ddabble ddabble deleted the cleanup/python-3.9-and-3.10-syntax branch February 26, 2023 23:27
@ddabble ddabble mentioned this pull request Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant