actions / setup-python

Set up your GitHub Actions workflow with a specific version of Python
MIT License
1.59k stars 505 forks source link

Associate .py with python on Windows #900

Open Wovchena opened 4 days ago

Wovchena commented 4 days ago

Description: Associate .py with python on Windows when running actions/setup-python@v4

Justification: I want to test that my .py have executable permission set relying on shebang line. That passes on Ubuntu. Windows doesn't care about file permissions set by git, but it has a different mechanism: https://docs.python.org/3/faq/windows.html#how-do-i-make-python-scripts-executable

On Windows, the standard Python installer already associates the .py extension with a file type (Python.File) and gives that file type an open command that runs the interpreter (D:\Program Files\Python\python.exe "%1" %*).

and https://docs.python.org/3/using/windows.html#from-file-associations:

The launcher should have been associated with Python files (i.e. .py, .pyw, .pyc files) when it was installed.

Apparently that doesn't happen when using actions/setup-python@v4

Are you willing to submit a PR? No

aparnajyothi-y commented 4 days ago

Hello @Wovchena, Thank you for creating the issue and we will get back to you once we have some feedback on this :)