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

Update obsoleted 'virtualenv_path' CfgContext entry handling in proc.py #134

Open
heevasti opened this issue Feb 20, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@heevasti
Copy link
Collaborator

heevasti commented Feb 20, 2025

Describe the bug
In qmi.core.config_defs configstruct CfgContext it is possible to define virtualenv_path value. This is meant to point to the location of the possible virtual Python environment to be used in the context. Currently it is used in QMI only in qmi.tools.proc here. But the implementation is
a) obsoleted as new 'venvs' do not usually set separately 'python3' anymore, but simply 'python';
b) the subdir 'bin' is used in Unix-like environments only. In Windows, it is 'Scripts'. Probably need to define it with '.exe' as well.

When running this on more recent Python and venv versions, or on a Windows PC, this will fail.

To Reproduce
Make a script to run a QMI context where the script module and 'virtualenv_path' are defined in qmi.conf (or other QMI configuration file). Run the script with qmi_proc or modern Python on Unix and Windows PC.

Expected behavior
The script will fail when trying to do os.path.join(venv_path, "bin", "python3") on L287 of qmi_proc.py.

Operating System (please complete the following information):

  • OS: Linux, Windows

Additional context

  • Python: 3.11 or newer
  • virtual environment must be present or be created (and destroyed) when running the test script.
@heevasti heevasti added the bug Something isn't working label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant