-
Notifications
You must be signed in to change notification settings - Fork 33
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 module name (-m) to run pytest and pip #148
Conversation
And how does python3 know the right one to choose? |
The switch python script takes care of that, it updates the alternative. It is no problem to have multiple python versions as long as python -m is used. |
I can see how it works, but the result looks more like a space station to me than a container. |
This PR is not about changing the architecture or workflow of oci-env. It tries to provide a fix for an 'advertised' functionality, the possibility to use a different python version than 3.8. This functionality was broken an unnoticed. If you have general issues with this workflow or architecture this is out of scope for this PR. |
when using python version other than 3.8 pip and pytest were not using the correct python version
c5f6b95
to
affa038
Compare
I guess switch python is broken then. This line is supposed to do it. Line 17 in 3fd2c24
|
No, I disagree. The only way to have the correct python version for pip and pytest is using -m flag. |
I see it adding the alternative for pip3. Looks like it's missing to put one for pip too. |
So we have two possibilities:
I do not see any point in favor the first one. If it works we can additionally add pip to switch_python or change every occurrence of pip to pip3. |
It is ridiculous in the first place to have multiple versions of python in one container fighting over precedence. |
If it is 'ridiculous' to have multiple versions of python, the logical option would be to remove the broken switch_python script. |
@jctanner are you using the feature that lets you switch python versions? It doesn't seem to be working correctly. We are considering removing it all together. |
We use it all the time with no issue https://github.com/ansible/galaxy_ng/blob/master/profiles/base/Dockerfile |
That is because of the Are you invoking tests (unit/functional) with it? |
@dosas no we aren't using it for functional or unit testing. The functional and unit tests run in CI based on the ansible playbooks created by the pulp plugin template. It builds an image and runs a container via ansible to do all that work, including a matrix with s3/azure/fs backing filestores. The galaxy team does not tend to write functional tests in the galaxy_ng repo. Instead, in our CI we also have integration tests (not pulp native testing) that do use the oci profiles+image. |
We provide different base images with different python versions for this. Closing now.
This would still need multiple python versions to coexist in the same container. |
For reference pulp/pulp-oci-images#586 |
when using python version other than 3.8
pip and pytest were not using the correct python version