-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Code cleanups from pyupgrade #20642
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
Code cleanups from pyupgrade #20642
Conversation
Git shortstat: +2,725 −3,534 |
-0 - this change breaks the ability of older Galaxy instances to apply changes we make to their branches and is going to conflict big, open PRs while fixing no bugs and delivering no features. Breaking compat with the little switches in the setting file that say what versions we support might make sense because CI things disappear or we need to bring in modern versions of dependencies but what is the purpose of this? It was fine - use the new syntax in new files if you want. I know the new syntax is better and I'm excited to use it someday and for new features, but at this point this seems like breaking things for the sake of breaking things. |
Thanks for looking at this! I understand this could be a concern, in fact I already experimented with this when working on #19685 but decided at the time to keep it out of that PR to make things smoother.
|
6b99545
to
7ce31c1
Compare
cafc811
to
101ddcc
Compare
Test failures unrelated. |
A core tenant of this project is accessibility - I will applaud every "Add support for Python XX" PR and resist every "Drop support Python XX" PR. I feel like you sit in the same admin roundtables as me - non-usegalaxy.* galaxies are becoming less common and those that exist are many years out of date. We should be struggling to support them, not throwing them under the bus with this march toward making the code break on their Pythons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a -0 approve since you requested my re-review - feel free to merge it I've stated my objections and I will do so with other PRs like this but I recognize I'm in the minority and frankly an old fart.
…list` as a method
Found by running: ``` make pyupgrade ruff check --fix . ruff check --preview --unsafe-fixes --select=F401 --fix . make format make update-client-api-schema ``` The bulk of the changes are replacements of typing deprecated aliases such as `Dict` and `List` with the standard library classes. These aliases became redundant in Python 3.9 when the corresponding pre-existing classes were enhanced to support `[]`, see https://docs.python.org/3/library/typing.html#deprecated-aliases Also: - Update the `pyupgrade` Makefile target to use `--py38-plus` for the packages needed by Pulsar, including the new galaxy-tool-util-models package.
101ddcc
to
7f89e0e
Compare
I don't think admins are the targets for accessibility, but even if we include them, I don't think that supporting an EOL Python version improves it.
We do provide instructions on how to use a supported Python version, and it is pretty easy to install a new Python version nowadays. What would make small Galaxy admins' life easier is keeping old Galaxy releases supported forever, but I'm sure no one wants to do that! Thanks anyway for taking the time for looking at this and commenting, appreciated! |
Found by running:
The bulk of the changes are replacements of typing deprecated aliases such as
Dict
andList
with the standard library classes. These aliases became redundant in Python 3.9 when the corresponding pre-existing classes were enhanced to support[]
, see https://docs.python.org/3/library/typing.html#deprecated-aliasesAlso:
pyupgrade
Makefile target to use--py38-plus
for the packages needed by Pulsar, including the newgalaxy-tool-util-models
package.builtins.list
in method return types inside classes that havelist
as a method.How to test the changes?
(Select all options that apply)
License