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

Use PEP-585 standard generic collections #184

Merged
merged 1 commit into from
Aug 27, 2023
Merged

Conversation

hamdanal
Copy link

Ran ruff with "UP006" rule autofixes for PEP-585 upgrades and some other relevant rules.

Ruff runs now as part of the linters to make sure that the library stays up-to-date. When running ./s/lint locally, it autofixes the errors inplace. When run in CI, it just prints them to the terminal. This is similar to how black and isort are invoked.

Ran ruff with "UP006" rule autofixes for PEP-585 upgrades and some other relevant rules.

Ruff runs now as part of the linters to make sure that the library stays up-to-date.
When running `./s/lint` locally, it autofixes the errors inplace. When run in CI, it
just prints them to the terminal. This is similar to how black and isort are invoked.
@hamdanal
Copy link
Author

As discussed in #183 (comment). The commented out ruff rules in pyproject.toml will be activated in following PRs, otherwise it will be very difficult to review all the changes.

@@ -189,7 +192,7 @@ STATIC_ROOT: Optional[str] = ...
STATIC_URL: Optional[str] = ...
Copy link
Owner

Choose a reason for hiding this comment

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

surprised it didn't update Optional[str] to str | None

Copy link
Author

Choose a reason for hiding this comment

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

Yeah this will be updated in the next PR I prepared to use PEP-604 (A | B and A | None) syntax. The changes are huge I had to split them to multiple PRs.

Copy link
Owner

@sbdchd sbdchd left a comment

Choose a reason for hiding this comment

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

Looks great!!

@kodiakhq kodiakhq bot merged commit e74795b into sbdchd:main Aug 27, 2023
@hamdanal hamdanal deleted the pep-585 branch August 27, 2023 20:12
kodiakhq bot pushed a commit that referenced this pull request Aug 27, 2023
Activate the ruff lint rule "UP007" that updates `typing.Union` and `typing.Optional` to use the ` | ` syntax. I also made some manual fixups for the cases that were not updated by ruff.

This is a continuation of #184
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