mirror of https://github.com/astral-sh/uv
Add system install test for alpine (#2371)
This commit is contained in:
parent
28bf493709
commit
659f412964
|
|
@ -291,6 +291,31 @@ jobs:
|
||||||
- name: "Validate global Python install"
|
- name: "Validate global Python install"
|
||||||
run: pyston scripts/check_system_python.py --uv ./uv
|
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:
|
system-test-macos:
|
||||||
needs: build-binary-macos-aarch64
|
needs: build-binary-macos-aarch64
|
||||||
name: "check system | python on macos"
|
name: "check system | python on macos"
|
||||||
|
|
@ -383,7 +408,7 @@ jobs:
|
||||||
run: py -3.9 ./scripts/check_system_python.py --uv ./uv.exe
|
run: py -3.9 ./scripts/check_system_python.py --uv ./uv.exe
|
||||||
|
|
||||||
system-test-pyenv:
|
system-test-pyenv:
|
||||||
needs: build-binary-windows
|
needs: build-binary-linux
|
||||||
name: "check system | python via pyenv"
|
name: "check system | python via pyenv"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,17 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Check a Python interpreter.")
|
parser = argparse.ArgumentParser(description="Check a Python interpreter.")
|
||||||
parser.add_argument("--uv", help="Path to a uv binary.")
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
uv: str = os.path.abspath(args.uv) if args.uv else "uv"
|
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.
|
# Create a temporary directory.
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
|
|
@ -32,7 +40,7 @@ if __name__ == "__main__":
|
||||||
# Install the package (`pylint`).
|
# Install the package (`pylint`).
|
||||||
logging.info("Installing the package `pylint`.")
|
logging.info("Installing the package `pylint`.")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[uv, "pip", "install", "pylint", "--system"],
|
[uv, "pip", "install", "pylint", "--system"] + allow_externally_managed,
|
||||||
cwd=temp_dir,
|
cwd=temp_dir,
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
|
@ -57,7 +65,7 @@ if __name__ == "__main__":
|
||||||
# Uninstall the package (`pylint`).
|
# Uninstall the package (`pylint`).
|
||||||
logging.info("Uninstalling the package `pylint`.")
|
logging.info("Uninstalling the package `pylint`.")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[uv, "pip", "uninstall", "pylint", "--system"],
|
[uv, "pip", "uninstall", "pylint", "--system"] + allow_externally_managed,
|
||||||
cwd=temp_dir,
|
cwd=temp_dir,
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue