Defining ASDF_PYTHON_VERSION for License Scanning job doesn't install the version
Summary
In a recent interaction with the customer in ticket #190317 (internal), following the subsequent docs MR: !57019 (merged) it was uncovered that the License Scanning job defined with ASDF_PYTHON_VERSION
variable doesn't work as expected. The license finder doesn't install the version defined in ASDF_PYTHON_VERSION
.
Steps to reproduce
- Create a test python project with some modules in reqirements.txt
- Setup the License Compliance job by including the job in your existing
.gitlab-ci.yml
file - Add
ASDF_PYTHON_VERSION
variable selecting the non-default Python version, for example3.7.2
, create.tool-versions
file withpython 3.7.2
in it. - Run the job.
Example Project
https://gitlab.com/gitlab-gold/kategrechishkinatestgroup/190317-license-scanning
What is the current bug behavior?
The license scan doesn't scan the project, instead it errors out with these warnings:
[v3.28.8] debconf: delaying package configuration, since apt-utils is not installed
python 3.8.5 is already installed
asdf: No preset version installed for command virtualenv
Please install the missing version by running one of the following:
asdf install python 3.7.2
or add one of the following in your .tool-versions file:
python 3.8.5
[v3.28.8] sh -c '. .venv/bin/activate && pip install -v -r requirements.txt'
[v3.28.8] sh: 1: .: Can't open .venv/bin/activate
[v3.28.8] /opt/asdf/bin/asdf exec python /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/license_finder-6.12.0/bin/license_finder_pip.py /builds/gitlab-gold/kategrechishkinatestgroup/190317-license-scanning/requirements.txt
[v3.28.8] asdf: No preset version installed for command python
Please install the missing version by running one of the following:
asdf install python 3.7.2
or add one of the following in your .tool-versions file:
python 3.8.5
What is the expected correct behavior?
The License Compliance doc mentions that setting ASDF_PYTHON_VERSION
should be enough to run the setup of custom not pre-installed Python version. But it doesn't seem to be happening right now.
Relevant logs and/or screenshots
https://gitlab.com/gitlab-gold/kategrechishkinatestgroup/190317-license-scanning/-/jobs/1118687443
Output of checks
This bug happens on GitLab.com