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 python interpreter that executed atest/run.py instead of python #1798

Merged
merged 2 commits into from Mar 29, 2023

Conversation

emanlove
Copy link
Member

When running under a virtualenv, using python as the interpreter forgets the virtualenv python which executed atest.run.py. Instead using sys.executable which will execute with same interpreter used to execute atest/run.py. I also later check to make sure the interpreter is not None nor an empty string as doc states [1] it may be if "Python is unable to retrieve the interpreter".

Fixes #1796

[1] https://docs.python.org/3.10/library/sys.html#sys.executable

When running under a virtualenv, using `python` as the interpreter
forgets the virtualenv python which executed atest.run.py. Instead using
sys.executable which will execute with same interpreter used to execute
atest/run.py. I also later check to make sure the interpreter is not
None nor an empty string as doc states [1] it may be if "Python is unable
to retrieve the interpreter".

Fixes robotframework#1796

[1] https://docs.python.org/3.10/library/sys.html#sys.executable
This will ensure the usage of the same python environment for the http
server as the one that starts the atest runner.
@emanlove
Copy link
Member Author

emanlove commented Jan 1, 2023

As this stands it resolves the issue of the executor but does not emulate the same as a virtualenv does. That adds some additional env variables as well.

@emanlove emanlove merged commit 5010084 into robotframework:master Mar 29, 2023
@emanlove emanlove modified the milestone: v6.1.0 Apr 29, 2023
@emanlove emanlove deleted the atest-python-interpreter branch December 19, 2023 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

atest task loses python interpreter when running with virtualenv under Windows
2 participants