Skip to content

Run pyupgrade in CI - #5327

Merged
crusaderky merged 7 commits into
dask:mainfrom
crusaderky:pyupgrade
Sep 22, 2021
Merged

crusaderky merged 7 commits into
dask:mainfrom
crusaderky:pyupgrade

Conversation

@crusaderky

Copy link
Copy Markdown
Collaborator

Related to #2803

@fjetter

fjetter commented Sep 17, 2021

Copy link
Copy Markdown
Member

You changed your mind, it seems #4741 (comment) ;)

FYI There is an issue with cythonization for things like sum(<gen expression>) #4741 (comment) I resolved that by pinning the version back then

@crusaderky

Copy link
Copy Markdown
Collaborator Author

I had forgotten about the cython issue. 😠

What mostly made me change my mind re pyupgrade is #2803 - if we're adding mypy, it becomes pretty much necessary to ask the users to run the pre-commit instead of the individual list of linters, at which point the attrition involved in adding one more becomes negligible (as long as the linter itself always does what's desirable, obviously).

All test failures are unrelated. (see #5329 for partial remediation).

Comment thread versioneer.py
@@ -1,4 +1,3 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #4741 (comment) a short discussion about the versioneer file.

I don't have a strong opinion

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 I would prefer to not touch our versioneer-related files. Does pyupgrade have an option to exclude a specified set of files?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It exposes a whitelist of files, but not a blacklist. So I could exclude distributed/versioneer.py but I can't exclude distributed/distributed/_version.py.

@fjetter fjetter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

cc @jrbourbeau any objections to us requiring users to use pre-commit?

Is there "developer docs" page we should also update?

@crusaderky

Copy link
Copy Markdown
Collaborator Author

@fjetter good call. I added to the docs.

- [ ] Closes #xxxx
- [ ] Tests added / passed
- [ ] Passes `black distributed` / `flake8 distributed` / `isort distributed`
- [ ] Passes `pre-commit run --all-files`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cc @jakirkham @jacobtomlinson. This PR is proposing we switch to using pre-commit to run all code style checks instead of enumerating the individual checks that are made and documenting pre-commit as optional. I'm okay with this, but wanted to flag this for your thoughts as well

@jacobtomlinson jacobtomlinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using pre-commit to run linting is my preferred route these days. So I'm +1 on this.

@crusaderky

Copy link
Copy Markdown
Collaborator Author

Seems like we have a consensus, merging

@crusaderky
crusaderky merged commit 2321090 into dask:main Sep 22, 2021
@crusaderky
crusaderky deleted the pyupgrade branch September 22, 2021 13:08
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.

4 participants