mirror of
https://github.com/astral-sh/uv.git
synced 2025-12-04 00:54:42 +00:00
Add system install test for alpine (#2371)
This commit is contained in:
parent
28bf493709
commit
659f412964
2 changed files with 36 additions and 3 deletions
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
|
|
@ -291,6 +291,31 @@ jobs:
|
|||
- name: "Validate global Python install"
|
||||
run: pyston scripts/check_system_python.py --uv ./uv
|
||||
|
||||
system-test-alpine:
|
||||
needs: build-binary-linux
|
||||
name: "check system | alpine"
|
||||
runs-on: ubuntu-latest
|
||||
container: alpine:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: "Install Python"
|
||||
run: apk add --update --no-cache python3 py3-pip
|
||||
|
||||
- name: "Download binary"
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: uv-linux-${{ github.sha }}
|
||||
|
||||
- name: "Prepare binary"
|
||||
run: chmod +x ./uv
|
||||
|
||||
- name: "Print Python path"
|
||||
run: echo $(which python3)
|
||||
|
||||
- name: "Validate global Python install"
|
||||
run: python3 scripts/check_system_python.py --uv ./uv --externally-managed
|
||||
|
||||
system-test-macos:
|
||||
needs: build-binary-macos-aarch64
|
||||
name: "check system | python on macos"
|
||||
|
|
@ -383,7 +408,7 @@ jobs:
|
|||
run: py -3.9 ./scripts/check_system_python.py --uv ./uv.exe
|
||||
|
||||
system-test-pyenv:
|
||||
needs: build-binary-windows
|
||||
needs: build-binary-linux
|
||||
name: "check system | python via pyenv"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -14,9 +14,17 @@ if __name__ == "__main__":
|
|||
|
||||
parser = argparse.ArgumentParser(description="Check a Python interpreter.")
|
||||
parser.add_argument("--uv", help="Path to a uv binary.")
|
||||
parser.add_argument(
|
||||
"--externally-managed",
|
||||
action="store_true",
|
||||
help="Set if the Python installation has an EXTERNALLY-MANAGED marker.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
uv: str = os.path.abspath(args.uv) if args.uv else "uv"
|
||||
allow_externally_managed = (
|
||||
["--break-system-packages"] if args.externally_managed else []
|
||||
)
|
||||
|
||||
# Create a temporary directory.
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
|
|
@ -32,7 +40,7 @@ if __name__ == "__main__":
|
|||
# Install the package (`pylint`).
|
||||
logging.info("Installing the package `pylint`.")
|
||||
subprocess.run(
|
||||
[uv, "pip", "install", "pylint", "--system"],
|
||||
[uv, "pip", "install", "pylint", "--system"] + allow_externally_managed,
|
||||
cwd=temp_dir,
|
||||
check=True,
|
||||
)
|
||||
|
|
@ -57,7 +65,7 @@ if __name__ == "__main__":
|
|||
# Uninstall the package (`pylint`).
|
||||
logging.info("Uninstalling the package `pylint`.")
|
||||
subprocess.run(
|
||||
[uv, "pip", "uninstall", "pylint", "--system"],
|
||||
[uv, "pip", "uninstall", "pylint", "--system"] + allow_externally_managed,
|
||||
cwd=temp_dir,
|
||||
check=True,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue