Skip to content

Reformatted all files with black and isort - #4224

Closed
srittau wants to merge 4 commits into
python:masterfrom
srittau:the-big-reformat
Closed

srittau wants to merge 4 commits into
python:masterfrom
srittau:the-big-reformat

Conversation

@srittau

@srittau srittau commented Jun 11, 2020 •

Copy link
Copy Markdown
Collaborator

A few comments between imports were removed or moved to the top of the
import block, due to behavioral differences between black and isort. See
psf/black#251 for details.

In two instances @overloads at the top of the file needed to be moved
due to psf/black#1490.

A few comments between imports were removed or moved to the top of the
import block, due to behavioral differences between black and isort. See
psf/black#251 for details.

In two instances @Overloads at the top of the file needed to be moved
due to psf/black#1490.
@srittau
srittau requested a review from JelleZijlstra June 11, 2020 11:59
@srittau

srittau commented Jun 11, 2020

Copy link
Copy Markdown
Collaborator Author

Now pytype fails. It was fine with the previous commit, but bails when moving the # type: ignore comments to the first line. Cc @rchen152

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

Feel free to merge this as soon as CI passes.

Were you able to figure out what exactly pytype is choking on? It seems to be reporting errors for files that import the broken file, since some of the files that it complains about in CI have only whitespace changes. The problem looks to be somewhere in asyncio but I haven't been able to find out which file exactly.

@srittau

srittau commented Jun 12, 2020

Copy link
Copy Markdown
Collaborator Author

The problem is only with the second commit, which only touches three files. I will see whether I can work around this later.

@rchen152

Copy link
Copy Markdown
Collaborator

Sorry, just saw this. At a glance, it looks like pytype doesn't expect a # type: ignore after the opening parenthesis in a function definition? I'll take a look.

rchen152 added a commit to google/pytype that referenced this pull request Jun 12, 2020
For python/typeshed#4224.

We really need a better pyi parser...

PiperOrigin-RevId: 316171517
@rchen152

Copy link
Copy Markdown
Collaborator

I pushed a pytype change to allow # type: ignore after the opening parenthesis in a function definition. (Sorry this issue keeps coming up! We've been wanting to fix our pyi parser for a long time, but there's always something more urgent to do...) If all goes well, a release containing this change should go out sometime next week.

@srittau

srittau commented Jun 14, 2020

Copy link
Copy Markdown
Collaborator Author

Closing. I will open a new PR when the new pytest version is released. In the meantime, #4228 contains a few changes from this PR to address black and isort incompatibilities that will ease the Big Reformat.

@srittau srittau closed this Jun 14, 2020
@JelleZijlstra

Copy link
Copy Markdown
Member

Looks like the pytype release hasn't gone out just yet.

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.

3 participants