Repository navigation
Conversation
I've excepted the CLI and test suite from this, because they have good reasons for print statements.
The UP ruleset upgrades old code to do things like `Optional[int]` -> `int | None` and so on. This required a bunch of code changes, none of which should have any effect.
rwb27
marked this pull request as draft
November 3, 2026 10:03
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the
UPruleset toruffwhich updates old code to take advantage of new features. It made a bunch of code changes, which I've checked - mostly importing things from the canonical place (e.g.Callablecomes fromcollections.abcand nottypingnow), and also changes likeOptional[T]->T | None.I think it does a few things that are useful, and also makes the code more self-consistent.
I notice it's removed a bunch of quotation marks from some type hints. This does not seem to displease either the test suite or
mypyso I assume I was just being overly cautious by quoting them.this is not ready for merge
This touches a lot of code. My process was:
UPrulesetmypyandpyteststill passThat means all the automated changes have had one human review already. However, it's going to be a rebase nightmare. I suggest that, when we reach a point where we've got minimal open PRs, we re-do this PR and merge it quickly. I guess in principle one could apply the auto-fixes to every commit in one of the branches before rebasing, to minimise conflicts: I've not done that and feel like it will be painful even with automation, so it's probably best to minimise the number of times it happens...