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

Remove Python 3.9 #356

Merged
merged 7 commits into from
Jan 9, 2024
Merged

Remove Python 3.9 #356

merged 7 commits into from
Jan 9, 2024

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Jan 3, 2024

Description

This PR is intended to remove Python 3.9. It adds pyupgrade to the pre-commit hooks with a minimum Python version of 3.10 and that then made a bunch of changes automatically. These are mostly:

  • Replacing e.g. set([1,2,3]) with the set literal {1,2,3}
  • Replacing e.g. Optional[int] with int | None

The PR also:

  • Updates pyproject.toml to python = ">=3.10,<3.12", removing 3.9
  • Updates the poetry doc dependencies, specifically to use myst-nb = ^1.0.0 and sphinx = ^7.0.0. This relates to Keep an eye on myst-parser and myst-nb updates #238 - we should now review that issue and update our Myst usage.
  • Updates poetry.lock to update any packages that were being pinned at earlier versions by requiring 3.9.

There are some minor doc updates to pass - including another ugly addition to sphinx's nitpick-ignoreto tackle problems in the documentation of vr.core.grid.GRID_STRUCTURE_SIG. I've updated the way that type alias is created, but sphinx is throwing errors. I think it believes the type alias (tuple[list[int], list[Polygon]] is an actual tuple and is trying to document the __repr__, count and index methods? Those don't exist, so these have been added to nitpick ignore.

Fixes #324

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@davidorme davidorme linked an issue Jan 3, 2024 that may be closed by this pull request
Copy link
Collaborator

@jacobcook1995 jacobcook1995 left a comment

Choose a reason for hiding this comment

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

LGTM!

Does it make sense to update the poetry.lock as part of this PR? The minimum supported python version has changed, which means quite a lot of dependancies should now be less version constrained.

I've also found intersphinx to be really annoying, and have no guess for the problem in this case.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d02b93b) 95.94% compared to head (344d547) 96.30%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #356      +/-   ##
===========================================
+ Coverage    95.94%   96.30%   +0.35%     
===========================================
  Files           52       52              
  Lines         2614     2866     +252     
===========================================
+ Hits          2508     2760     +252     
  Misses         106      106              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidorme davidorme marked this pull request as ready for review January 4, 2024 10:05
@davidorme
Copy link
Collaborator Author

Does it make sense to update the poetry.lock as part of this PR? The minimum supported python version has changed, which means quite a lot of dependancies should now be less version constrained.

Yes it really does. Good catch. I've updated pyproject.toml and then specifically updated the minimum version on couple of packages (sphinx and myst-nb) that were also holding us back from more recent packages.

@davidorme davidorme merged commit 4d912ce into develop Jan 9, 2024
@davidorme davidorme deleted the 324-consider-dropping-python-39 branch January 9, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider dropping Python 3.9
3 participants