-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve pip package manager tests (#256)
Whilst writing the tests for the upcoming Poetry support, I made a few changes to the overall package manager testing strategy (such as using a testing buildpack to verify that at build time the tools and env vars are configured correctly) - which I've split out of the later PRs for easier review. In particular, the new testing buildpack added here is what helped me debug and locate this upstream lifecycle build time env vars bug (which would have broken apps when we switch to venvs shortly): buildpacks/lifecycle#1393 GUS-W-16617242.
- Loading branch information
Showing
7 changed files
with
198 additions
and
147 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# This package has been picked since it has no dependencies and is small/fast to install. | ||
typing-extensions==4.7.1 | ||
typing-extensions==4.12.2 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Check that: | ||
# - The correct env vars are set for later buildpacks. | ||
# - Python's sys.path is correct. | ||
# - The correct version of pip was installed. | ||
# - Both the package manager and Python can find the typing-extensions package. | ||
# - The system site-packages directory is protected against running 'pip install' | ||
# without having passed '--user'. | ||
# - The typing-extensions package was installed into a separate dependencies layer. | ||
|
||
set -euo pipefail | ||
|
||
echo | ||
echo "## Testing buildpack ##" | ||
|
||
printenv | sort | grep -vE '^(_|CNB_.+|HOME|HOSTNAME|OLDPWD|PWD|SHLVL)=' | ||
echo | ||
python -c 'import pprint, sys; pprint.pp(sys.path)' | ||
echo | ||
pip --version | ||
pip list | ||
pip install --dry-run typing-extensions | ||
python -c 'import typing_extensions; print(typing_extensions)' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
exit 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
api = "0.11" | ||
|
||
[buildpack] | ||
id = "testing-buildpack" | ||
version = "0.0.0" | ||
clear-env = true |
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.