Skip to content

[v1.8] Catch Flake8 error codes with multiple letters#52801

Merged
malfet merged 1 commit intopytorch:release/1.8from
walterddr:cherry_pick_52750
Feb 26, 2021
Merged

[v1.8] Catch Flake8 error codes with multiple letters#52801
malfet merged 1 commit intopytorch:release/1.8from
walterddr:cherry_pick_52750

Conversation

@walterddr
Copy link
Copy Markdown
Contributor

Cherry-picking #52750 to release 1.8 because it alters several files execute permission.

Summary:
The Flake8 job has been passing on `master` despite giving warnings for [over a month](https://github.com/pytorch/pytorch/runs/1716124347). This is because it has been using a regex that doesn't recognize error codes starting with multiple letters, such as those used by [flake8-executable](https://pypi.org/project/flake8-executable/). This PR corrects the regex, and also adds another step at the end of the job which asserts that Flake8 actually gave no error output, in case similar regex issues appear in the future.

Tagging the following people to ask what to do to fix these `EXE002` warnings:

- pytorch#50629 authored by jaglinux, approved by rohan-varma
  - `test/distributed/test_c10d.py`
- pytorch#51262 authored by glaringlee, approved by ejguan
  - `torch/utils/data/datapipes/__init__.py`
  - `torch/utils/data/datapipes/iter/loadfilesfromdisk.py`
  - `torch/utils/data/datapipes/iter/listdirfiles.py`
  - `torch/utils/data/datapipes/iter/__init__.py`
  - `torch/utils/data/datapipes/utils/__init__.py`
  - `torch/utils/data/datapipes/utils/common.py`
- pytorch#51398 authored by glaringlee, approved by ejguan
  - `torch/utils/data/datapipes/iter/readfilesfromtar.py`
- pytorch#51599 authored by glaringlee, approved by ejguan
  - `torch/utils/data/datapipes/iter/readfilesfromzip.py`
- pytorch#51704 authored by glaringlee, approved by ejguan
  - `torch/utils/data/datapipes/iter/routeddecoder.py`
  - `torch/utils/data/datapipes/utils/decoder.py`
- pytorch#51709 authored by glaringlee, approved by ejguan
  - `torch/utils/data/datapipes/iter/groupbykey.py`

Specifically, the question is: for each of those files, should we remove the execute permissions, or should we add a shebang? And if the latter, which shebang?

Pull Request resolved: pytorch#52750

Test Plan:
The **Lint / flake8-py3** job in GitHub Actions:

- [this run](https://github.com/pytorch/pytorch/runs/1972039886) failed, showing that the new regex catches these warnings properly
- [this run](https://github.com/pytorch/pytorch/runs/1972393293) succeeded and gave no output in the "Run flake8" step, showing that this PR fixed all Flake8 warnings
- [this run](https://github.com/pytorch/pytorch/pull/52755/checks?check_run_id=1972414849) (in pytorch#52755) failed, showing that the new last step of the job successfully catches Flake8 warnings even without the regex fix

Reviewed By: walterddr, janeyx99

Differential Revision: D26637307

Pulled By: samestep

fbshipit-source-id: 572af6a3bbe57f5e9bd47f19f37c39db90f7b804
@facebook-github-bot facebook-github-bot added cla signed oncall: distributed Add this issue/PR to distributed oncall triage queue labels Feb 25, 2021
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Feb 25, 2021

💊 CI failures summary and remediations

As of commit 31d28d4 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-scanned failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 25, 2021

Codecov Report

Merging #52801 (31d28d4) into release/1.8 (d6943ea) will increase coverage by 0.33%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           release/1.8   #52801      +/-   ##
===============================================
+ Coverage        80.48%   80.82%   +0.33%     
===============================================
  Files             1948     1948              
  Lines           213265   213265              
===============================================
+ Hits            171641   172365     +724     
+ Misses           41624    40900     -724     

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

Labels

cla signed oncall: distributed Add this issue/PR to distributed oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants