Skip to content

Modernise code syntax - #237

Merged
jfhbrook merged 1 commit into
jfhbrook:mainfrom
FrancescoPezzella:type-parameter-modernisation
Nov 14, 2026
Merged

jfhbrook merged 1 commit into
jfhbrook:mainfrom
FrancescoPezzella:type-parameter-modernisation

Conversation

@FrancescoPezzella

@FrancescoPezzella FrancescoPezzella commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Is This?

Fixes #234

Applied two commands to modernise the codebase:

  • python src/rejuvenation/migration_type_recipes.py ../TestProjects/pyee --py 3.12 --report ../MDsImportantes/pyee-1.md --second-pass from https://github.com/TNO/Renaissance.Py
  • ruff check --select UP,F401 --fix

Why Is This?

It follows Python best standards.

Anything We Need To Know?

(Add any additional flavor that will help with review.)

Questions

No new functionality was added, so tests do not have to be changed. No AI was used.

  • Has the developer read DEVELOPMENT.md?
  • Is the developer's name in the CONTRIBUTORS.md file?

@FrancescoPezzella FrancescoPezzella changed the title Convert type parameters to PEP 695 Modernise code syntax Nov 12, 2026
@FrancescoPezzella
FrancescoPezzella marked this pull request as ready for review November 12, 2026 10:30
@jfhbrook

Copy link
Copy Markdown
Owner

A new ticket that might be relevant to this conversation: #239

@jfhbrook

Copy link
Copy Markdown
Owner

Just a note, I had to go back and run black and flake8 - ruff has different formatting/linting opinions than both tools. But otherwise, if this passes the tests, I'm OK with it.

@jfhbrook

Copy link
Copy Markdown
Owner

@FrancescoPezzella type checking fails on this MR, even after upgrading mypy to latest. Can you take a look? If you can get mypy passing but pyright still fails, I'd be happy to consider dropping pyright support.

@jfhbrook jfhbrook mentioned this pull request Nov 12, 2026
6 tasks done
@FrancescoPezzella

FrancescoPezzella commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

yes i found an issue, will fix

edit: should be fixed, try running the tests again

@jfhbrook

Copy link
Copy Markdown
Owner

@FrancescoPezzella looks like it's still failing. That class is a little tough to make type-safe - I'd be ok with some judicious use of Any if it helps.

@FrancescoPezzella

Copy link
Copy Markdown
Contributor Author

yeah ii have to look into it, i am not sure why it is failing yet

@FrancescoPezzella

Copy link
Copy Markdown
Contributor Author

@FrancescoPezzella looks like it's still failing. That class is a little tough to make type-safe - I'd be ok with some judicious use of Any if it helps.

ok you were right it was an issue with Mypy treating the modernised syntax for Type differently, i added a 1 line fix

@jfhbrook

jfhbrook commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Looks like pipelines pass, good deal.

Add an entry to the CHANGELOG. As presented, this MR changes the API by removing the Handler export (it's there so people can use it as a type). So you'll need to both justify its removal to me and document it as a breaking change.

Edit: I see why it was removed. I'll update the CHANGELOG.

NOTE: Removes Handler from exports - this was a now unneeded TypeVar
@jfhbrook
jfhbrook force-pushed the type-parameter-modernisation branch from f98ff6a to 848e0a7 Compare November 14, 2026 17:07
@jfhbrook
jfhbrook merged commit 208b223 into jfhbrook:main Nov 14, 2026
6 checks passed
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.

Convert remaining instances of old syntax to follow PEP 695

2 participants