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

Introduce usage of venv #88

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

miroslavpojer
Copy link
Collaborator

@miroslavpojer miroslavpojer commented Oct 10, 2024

  • Introduced usage of venv in action yml code.
  • See example output comment below.

Summary:

  • GH action setup-python is required when on runner is not up to date python version only.
  • Venv can fix the situation when on the runner, there is a strict strategy about a Python install and limited usage of pip.

Closes #90

Release notes:

  • Added code to workflows to run python in venv instead of master one installation.

@miroslavpojer
Copy link
Collaborator Author

See the output when no venv used and no python setup defined:

`Current Python version: 3.12.3
Minimal required Python version: 3.11.0
Python version meets the minimum requirement of 3.11.0
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error: Process completed with exit code 1.
`

@miroslavpojer
Copy link
Collaborator Author

miroslavpojer commented Oct 11, 2024

Here is ouput when no pyhton setup step and venv used:

Current Python version: 3.12.3
Minimal required Python version: 3.11.0
Python version meets the minimum requirement of 3.11.0
Collecting coverage==7.5.2 (from -r /home/runner/work/_actions/AbsaOSS/generate-release-notes/feature/introduce-venv-into-action-yaml/requirements.txt (line 1))
Downloading coverage-7.5.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.2 kB)
Collecting pytest==7.4.3 (from -r /home/runner/work/_actions/AbsaOSS/generate-release-notes/feature/introduce-venv-into-action-yaml/requirements.txt (line 2))
Downloading pytest-7.4.3-py3-none-any.whl.metadata (7.9 kB)

@miroslavpojer miroslavpojer self-assigned this Oct 11, 2024
@miroslavpojer miroslavpojer added the enhancement New feature or request label Oct 11, 2024
Copy link
Collaborator

@MobiTikula MobiTikula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@miroslavpojer miroslavpojer merged commit cde0868 into master Oct 16, 2024
7 of 8 checks passed
@miroslavpojer miroslavpojer deleted the feature/introduce-venv-into-action-yaml branch October 16, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce usage of virtual env
2 participants