-
Notifications
You must be signed in to change notification settings - Fork 47
Fix last one hardcoded unversioned python command #98
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
I'd like to debug the issue but I don't have an access to a machine with windows. But it seems that it cannot handle the full path to executable. It might make sense to omit the call to which if the first part of the command is an absolute path. |
This sounds reasonable 👍 |
I might try to implement it but I don't have a windows machine to test it. |
Implemented in the last commit. |
It looks like the path fix needs to be on diff --git a/tests/test_utility_functions.py b/tests/test_utility_functions.py
index 334c085..ea8127e 100644
--- a/tests/test_utility_functions.py
+++ b/tests/test_utility_functions.py
@@ -1,4 +1,5 @@
-
+import os
+import sys
from unittest.mock import patch
import pytest
@@ -28,7 +29,8 @@ def test_combine_commands():
def test_run():
- assert pkg.run('python --version') == 0
+ python = sys.executable.replace(os.sep, '/')
+ assert pkg.run(f'{python} --version') == 0
with pytest.raises(ValueError):
pkg.run('foobarbaz') |
But I still don't know why should I change the path separators from Windows to Linux. I'd say that windows paths should work on windows. |
In this case the limitation is |
👋 I added a commit to the PR to resolve the issue: It was using shlex.split which seems to need a NB: Another solution would have been to pass |
Thanks @frenzymadness and @vidartf! |
I'm sorry, it seems that I missed this one. I've prepared this PR in a browser so please test it before merging.