-
Notifications
You must be signed in to change notification settings - Fork 22
Create Python virtual environment #110
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
Conversation
Activating a venv already adds the python exe path to the env var |
OK will try |
It works https://github.com/cpp-linter/test-cpp-linter-action/actions/runs/3270648589/jobs/5379521124 Just the code does not look good. Maybe we can remove some |
It looks like that did the trick! Now time to polish it up.
|
Windows will failed if not specified https://github.com/cpp-linter/test-cpp-linter-action/actions/runs/3270593867/jobs/5379399304 |
That's because the activate command is located differently on Windows: ./venv/Scripts/activate where as on Linux & macOS: source ./venv/bin/activate It might be better to have the venv creation/activation in a .sh script file, so we could just call it from any steps that use the venv. |
You can use |
I see that you're using the |
Hmm. The venv executable path doesn't seem to be getting used after the venv.sh script completes. I'm looking at a similar approach that was done in arduino/compile-sketches composite action in which they directly invoke the executable located in the venv that they create with a bash script. |
nope 😠 . It starting to seem easier to just manage the venv in actions.yml as we had before. |
I like it hides details in action-setup.sh, if we rewrite like https://github.com/arduino/compile-sketches/blob/main/action-setup.sh, it may be work |
That will only work on Linux because they use the deadsnake PPA to install a certain build of python. |
And remember that the |
We can probably combine the "create venv" step with the "install deps" step. |
Now it seems to be having problems with the Windows path delimiters in a bash prompt on Windows:
is executed in bash like escape chars:
|
OMG! Why is this one of those things that is easier said than done?! Sorry, but I'm going to sleep now. I'll try to pick this up tomorrow (& hopefully try resolve cpp-linter/clang-tools-pip#15 in a more platform independent way). |
Haha.. Devils in the details. have a good night~ |
I've started trying to use The problem, as I see it, is that the python executable path is not guaranteed to be in the env var |
closing in favor of #113 |
Not sure if this is correct (maybe needs to have if else conditions to check different paltform because of different commands), please help to review it.