Skip to content

Conversation

@pietern
Copy link
Contributor

@pietern pietern commented Oct 3, 2019

Stack from ghstack:

Differential Revision: D17808207

Copy link
Collaborator

@xuhdev xuhdev left a comment

Choose a reason for hiding this comment

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

These shebangs might be used to indicate they must run on Python 3, not Python 2

@zhaojuanmao
Copy link
Contributor

right, they are used to indicate codes run on python3 only

@mrshenli
Copy link
Contributor

mrshenli commented Oct 4, 2019

rpc_test.py also has this shebang, which is not a runnable either. @pietern

@xuhdev @zhaojuanmao

These shebangs might be used to indicate they must run on Python 3, not Python 2

IIUC, this shebang won't print warning or error messages even if it is executed using PY2. If the shebang is only used for documentation purpose, shall we just use normal comments instead? I checked how jit handled this. Instead of adding a shebang, jit_test_py3.py explicitly added that in the name.

@pietern
Copy link
Contributor Author

pietern commented Oct 4, 2019

I agree -- the hash bang is an intent to make a file executable.

@mrshenli Can you stamp this one?

@xuhdev
Copy link
Collaborator

xuhdev commented Oct 4, 2019

@mrshenli A normal comment is fine. I'm just pointing out that using shebang is one kind of convention. You can also enable lint checks against such style in .flake8 by removing EXE001.

xuhdev added a commit to xuhdev/pytorch that referenced this pull request Oct 8, 2019
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.
@facebook-github-bot
Copy link
Contributor

@pietern merged this pull request in f597926.

facebook-github-bot pushed a commit that referenced this pull request Oct 9, 2019
Summary:
According to #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: #27560

Differential Revision: D17831782

Pulled By: ezyang

fbshipit-source-id: 6282fd3617b25676a6d959af0d318faf05c09b26
@facebook-github-bot facebook-github-bot deleted the gh/pietern/40/head branch October 28, 2019 22:18
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
Summary: Pull Request resolved: pytorch#27285

Test Plan: Imported from OSS

Differential Revision: D17808207

Pulled By: pietern

fbshipit-source-id: 6141c1783e3a6f448a298275120db1f254b42b2a
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: distributed Add this issue/PR to distributed oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants