Repository navigation
fix: allow installer to work on PEP 668 externally managed Python - #19
Closed
limingyaoo wants to merge 1 commit into
Closed
limingyaoo wants to merge 1 commit into
limingyaoo wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Same bug as aws-greengrass/aws-greengrass-cloudwatch-metrics#13; same fix as aws-greengrass/aws-greengrass-cloudwatch-metrics#19.
Description of changes:
installer.py: run bothpip installcalls withPIP_BREAK_SYSTEM_PACKAGES=1set in the subprocess env. Existing env vars such asALL_PROXYare still passed through.tests/test_installer.py: unit tests for the default, HTTP-proxy and HTTPS-proxy paths..github/workflows/python.yml: newinstaller-on-os-pythonjob that runsinstaller.pyas root on each distro's own Python. The workflow'sGITHUB_TOKENis now read-only.Why is this change necessary:
With
UseInstaller: true, the install step fails on PEP 668 distros (Debian 12+, Ubuntu 23.04+) witherror: externally-managed-environment. Running as root doesn't help. The--break-system-packagesflag isn't an option because pip < 23.0.1 rejects it (Ubuntu 20.04/22.04). The env var lifts the check on newer pip, and older pip ignores it.How was this change tested:
flake8andpyteston Python 3.7 and 3.10: 4 tests pass. The 3 new tests fail against the current code.externally-managed-environment).Any additional information or context required to review the change:
UseInstaller: true. The default is unchanged.release_3.1.x, so this needs a cherry-pick after merge. The files are identical on both branches.Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.