Skip to content

Commit

Permalink
Enable EXE001 flake8 check. (pytorch#27560)
Browse files Browse the repository at this point in the history
Summary:
According to pytorch#27285 , seems we do not intend to use shebang as an indication of Python version, thus
we enable EXE001 flake8 check.
For violations, we either remove shebang from non-executable Python scripts or grant them executable permission.
Pull Request resolved: pytorch#27560

Differential Revision: D17831782

Pulled By: ezyang

fbshipit-source-id: 6282fd3617b25676a6d959af0d318faf05c09b26
  • Loading branch information
xuhdev authored and facebook-github-bot committed Oct 9, 2019
1 parent 65cdc8d commit 987e37b
Show file tree
Hide file tree
Showing 24 changed files with 1 addition and 33 deletions.
2 changes: 0 additions & 2 deletions .circleci/cimodel/data/binary_build_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

"""
This module models the tree of configuration variants
for "smoketest" builds.
Expand Down
2 changes: 0 additions & 2 deletions .circleci/cimodel/data/binary_build_definitions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from collections import OrderedDict

import cimodel.data.binary_build_data as binary_build_data
Expand Down
2 changes: 0 additions & 2 deletions .circleci/cimodel/data/caffe2_build_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from cimodel.lib.conf_tree import ConfigNode, X, XImportant
from cimodel.lib.conf_tree import Ver

Expand Down
2 changes: 0 additions & 2 deletions .circleci/cimodel/data/caffe2_build_definitions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from collections import OrderedDict

import cimodel.data.dimensions as dimensions
Expand Down
3 changes: 0 additions & 3 deletions .circleci/cimodel/data/dimensions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3


PHASES = ["build", "test"]

CUDA_VERSIONS = [
Expand Down
2 changes: 0 additions & 2 deletions .circleci/cimodel/data/pytorch_build_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from cimodel.lib.conf_tree import ConfigNode, X, XImportant


Expand Down
2 changes: 0 additions & 2 deletions .circleci/cimodel/data/pytorch_build_definitions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from collections import OrderedDict

from cimodel.data.pytorch_build_data import TopLevelNode, CONFIG_TREE_DATA
Expand Down
3 changes: 0 additions & 3 deletions .circleci/cimodel/lib/conf_tree.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3


from dataclasses import dataclass, field
from typing import Optional, Dict

Expand Down
3 changes: 0 additions & 3 deletions .circleci/cimodel/lib/miniutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3


def quote(s):
return sandwich('"', s)

Expand Down
3 changes: 0 additions & 3 deletions .circleci/cimodel/lib/miniyaml.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3


from collections import OrderedDict


Expand Down
2 changes: 0 additions & 2 deletions .circleci/cimodel/lib/visualization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

"""
This module encapsulates dependencies on pygraphviz
"""
Expand Down
4 changes: 1 addition & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ max-line-length = 120
# E501 is not flexible enough, we're using B950 instead
ignore =
E203,E305,E402,E501,E721,E741,F403,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303,
# EXE001 is skipped for now because some files use shebang to determine Python version.
EXE001,
# these ignores are from flake8-bugbear; please fix!
B007,B008,
# these ignores are from flake8-comprehensions; please fix!
C400,C401,C402,C403,C404,C405,C407,C411,
exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,torch/lib/include,torch/lib/tmp_install,build,torch/include,*.pyi
exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,torch/lib/include,torch/lib/tmp_install,build,torch/include,*.pyi,.git
Empty file modified binaries/bench_gen/bench_gen.py
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion docs/cpp/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch documentation build configuration file, created by
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch documentation build configuration file, created by
Expand Down
1 change: 0 additions & 1 deletion test/rpc_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function, unicode_literals

import concurrent.futures
Expand Down
Empty file modified test/test_dist_autograd_fork.py
100644 → 100755
Empty file.
Empty file modified test/test_dist_autograd_spawn.py
100644 → 100755
Empty file.
Empty file modified test/test_rpc_fork.py
100644 → 100755
Empty file.
Empty file modified test/test_rpc_spawn.py
100644 → 100755
Empty file.
Empty file modified tools/amd_build/build_amd.py
100644 → 100755
Empty file.
Empty file modified tools/clang_format.py
100644 → 100755
Empty file.
Empty file modified tools/clang_tidy.py
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion torch/utils/hipify/cuda_to_hip_mappings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
import collections

from .constants import *
Expand Down

0 comments on commit 987e37b

Please sign in to comment.