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

FIX: Fix pre-commit CI #282

Merged
merged 1 commit into from
Oct 11, 2024
Merged

FIX: Fix pre-commit CI #282

merged 1 commit into from
Oct 11, 2024

Conversation

kurlov
Copy link
Member

@kurlov kurlov commented Oct 11, 2024

pre-commit CI step fails with:

Run pre-commit/[email protected]
Run python -m pip install pre-commit
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.

GH actions uses ubuntu-latest and GH recently started to migrate ubuntu version. The new ubuntu version comes with new python and pip. The new pip fails to install system wide packages by default to follow PEP-668. Technically it should not be an issue because this repo CI setups a dedicated python so it should be used to install pre-commit instead of default ubuntu python. The problem is that this setup python step do not do anything by default. Here are the logs:

Run actions/setup-python@v5
Warning: Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '.python-version' file.
Warning: .python-version doesn't exist.
Warning: The `python-version` input is not set.  The version of Python currently in `PATH` will be used.

This PR fixes it and make setup-python step prepare env for the pre-commit installation

@kurlov kurlov merged commit eea3683 into master Oct 11, 2024
2 checks passed
@kurlov kurlov deleted the fix-pre-commit-ci branch October 11, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants