Skip to content
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

use a python venv #173

Merged
merged 4 commits into from
Dec 11, 2023
Merged

use a python venv #173

merged 4 commits into from
Dec 11, 2023

Conversation

2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Dec 7, 2023

adheres to PEP668 and addresses #171

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Dec 7, 2023

I'm going to convert some steps to powershell syntax to fix support for windows runners. Basically, we can't use the actions/setup-python output variable python-path in bash because, on Windows runners, the python-path value uses "C:\path\to\python.exe" form and bash doesn't support that. Powershell supports both windows style paths and unix style paths.

See this test repo's workflow output. Notice that ubuntu-latest and macos-latest are working fine with the bash syntax.

Tip

You can install powershell in Ubuntu and play around with it locally.

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Dec 7, 2023

Success! 🎉

I still don't know a lot about powershell syntax... But I got the python venv to work on all OS runners using powershell syntax. 💯 See test-repo workflow run.

@2bndy5 2bndy5 marked this pull request as ready for review December 7, 2023 19:06
adheres to PEP668 and addresses #171
still learning powershell...

use Invoke-Expression

use nested quotes

use string concatenation
@shenxianpeng
Copy link
Collaborator

I am surprised Powershell works on Windows, macOS, and Linux.

@shenxianpeng
Copy link
Collaborator

If it solves #171, it can be merged, I still need to understand #171 when I have time

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Dec 8, 2023

I'm going to keep this open while we try to find an acceptable approach to using non-default docker images, specifically those that don't have powershell installed (see #171 discussion).

@shenxianpeng
Copy link
Collaborator

yeah, that would be great!

should support thee OS's native shell
@2bndy5
Copy link
Collaborator Author

2bndy5 commented Dec 8, 2023

I should also add a notice to the README saying we can only support Debian-based Linux runner images (no Fedora or Arch docker images will work with sudo apt calls).

@shenxianpeng
Copy link
Collaborator

Your change looks great! It makes sense to add a notice in the README.

@2bndy5 2bndy5 linked an issue Dec 11, 2023 that may be closed by this pull request
@2bndy5 2bndy5 merged commit 10b0f10 into main Dec 11, 2023
29 checks passed
@2bndy5 2bndy5 deleted the use-py-venv branch December 11, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python error: externally-managed-environment during installation
2 participants