Skip to content

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

nsoranzo
Copy link
Member

Found by running:

make pyupgrade

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.
  • Use builtins.list in method return types inside classes that have list as a method.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

Found by running:

```
make pyupgrade
```

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.
- Use `builtins.list` in method return types inside classes that have
  `list` as a method.
@nsoranzo
Copy link
Member Author

Git shortstat: +2,647 −3,442

@nsoranzo
Copy link
Member Author

Test failures unrelated.

@jmchilton
Copy link
Member

-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants