-
Notifications
You must be signed in to change notification settings - Fork 137
chore(python,example): exampleにshebangを付けてexecutableにする #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(python,example): exampleにshebangを付けてexecutableにする #1077
Conversation
error: could not compile `proc-macro2` (lib) due to 3 previous errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あーーーどうだろう。
これ逆に初学者が見たら混乱する気がしなくもないですねぇ…
付けないといけないのか、みたいに感じそう。
他のリポジトリでもつけてないし、特に理由なければつけない方が良い気がしました。
別にコアでだけつけるとかでも良いと思いますが、つけない方が一般的な気もしました!
|
個人的には一般的な気がしています。Bashと同じような感覚。ONNX Runtimeなんかでも結構あったはず。 逆に付けないことによるデメリットとして、MSYS環境(e.g. Git Bash)にてシェルスクリプトとして実行されうるというのもあるはずかなと。 ❯ echo 'print("hi")' > ./a.py
❯ # MSYSだと、Git側のfilemodeに関わらずそのまま実行可能になってしまう
❯ ./a.py
./a.py: line 1: syntax error near unexpected token `"hi"'
./a.py: line 1: `print("hi")' |
|
|
9c859b1 to
1e4316c
Compare
1e4316c to
a2e2f3d
Compare
|
うーーーん! あとシバンつけることに対してちょっとセカンドオピニオンが欲しい。 |
This reverts commit a2e2f3d.
|
あ、そっか |
|
あ、いやcmdやPowerShellだったら |
sevenc-nanashi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shebang追加だけなら大丈夫だと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
(メモ)
個人的には1行目にshebangを書くのは相当珍しいと思っているので、VOICEVOX Org全体としてこちらに揃えたいという気持ちはないです。
けどコアはこういう運用というのは別にそれでも良さそう!
#1077 の続き。 このリポジトリ内のすべてのファイルに対し、以下のチェックを義務付ける。 ```bash if has_shebang && ! is_executable; then echo 'A shebanged file must be executable (note: if you are using Windows, please change the filemode with `git update-index --chmod+x`)' exit 1 fi if is_shellscript && ! is_executable; then echo 'A shell script file must be executable (note: if you are using Windows, please change the filemode with `git update-index --chmod+x`)' exit 1 fi if is_executable && ! has_shebang; then echo 'An executable blob must have a shebang' exit 1 fi ```
|
|
|
いや、Python exampleは |
内容
run{,-asyncio}.pyにshebangを付け、filemodeも
100755(GIT_FILEMODE_BLOB_EXECUTABLE)にする。shebangを
python3ではなくpythonにしているのは、仮想環境を前提にしたいから。関連 Issue
その他