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

Add failing python-build-standalone alpine test #2382

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 52 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [main]
branches: [ main ]
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
name: "cargo clippy"
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ ubuntu-latest, windows-latest ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this madness formatting? :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pycharm

Copy link
Member

@zanieb zanieb Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretter (VSCode) conflicts with this. Can you turn off formatting for YAML? I've been wondering why these change all the time :p

Maybe we should consider codifying our YAML formatting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm not fixing this PR until the underlying bug it fixed)

fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -138,41 +138,20 @@ jobs:

- uses: rui314/setup-mold@v1

- uses: Swatinem/rust-cache@v2
- name: "Build"
run: cargo build

- name: "Upload binary"
uses: actions/upload-artifact@v4
with:
name: uv-linux-${{ github.sha }}
path: ./target/debug/uv
retention-days: 1

build-binary-debian:
runs-on:
labels: ubuntu-latest-large
container: debian:bullseye
name: "build binary | debian"
steps:
- uses: actions/checkout@v4

- name: "Install Rust toolchain"
- name: "Setup musl"
run: |
apt-get update
apt-get install -y curl build-essential cmake
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "PATH=$PATH:$HOME/.cargo/bin" >> "$GITHUB_ENV"
sudo apt-get install musl-tools
rustup target add x86_64-unknown-linux-musl

- uses: Swatinem/rust-cache@v2
- name: "Build"
run: cargo build
run: cargo build --target x86_64-unknown-linux-musl

- name: "Upload binary"
uses: actions/upload-artifact@v4
with:
name: uv-debian-${{ github.sha }}
path: ./target/debug/uv
name: uv-linux-${{ github.sha }}
path: ./target/x86_64-unknown-linux-musl/debug/uv
retention-days: 1

build-binary-macos-aarch64:
Expand Down Expand Up @@ -216,7 +195,7 @@ jobs:
retention-days: 1

system-test-debian:
needs: build-binary-debian
needs: build-binary-linux
name: "check system | python on debian"
runs-on: ubuntu-latest
container: debian:bullseye
Expand All @@ -229,7 +208,7 @@ jobs:
- name: "Download binary"
uses: actions/download-artifact@v4
with:
name: uv-debian-${{ github.sha }}
name: uv-linux-${{ github.sha }}

- name: "Prepare binary"
run: chmod +x ./uv
Expand Down Expand Up @@ -291,7 +270,7 @@ jobs:
run: pypy scripts/check_system_python.py --uv ./uv

system-test-pyston:
needs: build-binary-debian
needs: build-binary-linux
name: "check system | pyston"
runs-on: ubuntu-latest
container: pyston/pyston:2.3.5
Expand All @@ -301,7 +280,7 @@ jobs:
- name: "Download binary"
uses: actions/download-artifact@v4
with:
name: uv-debian-${{ github.sha }}
name: uv-linux-${{ github.sha }}

- name: "Prepare binary"
run: chmod +x ./uv
Expand All @@ -312,6 +291,43 @@ 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 pipx

- 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

- name: "Download Python build standalone"
run: pipx run /io/scripts/bootstrap/install.py python-build-standalone
env:
UV_BOOTSTRAP_DIR: python-build-standalone

- name: "Test Python build standalone"
run: |
python-build-standalone/versions/cpython@3.12.1/install/bin/python3 -m venv venv3.12
venv3.12/bin/python scripts/check_system_python.py --uv ./uv
python-build-standalone/versions/cpython@3.8.18/install/bin/python3 -m venv venv3.8
venv3.8/bin/python scripts/check_system_python.py --uv ./uv

system-test-macos:
needs: build-binary-macos-aarch64
name: "check system | python on macos"
Expand Down Expand Up @@ -431,14 +447,14 @@ jobs:

system-test-conda:
needs:
[build-binary-windows, build-binary-macos-aarch64, build-binary-linux]
[ build-binary-windows, build-binary-macos-aarch64, build-binary-linux ]
name: check system | conda${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: ["linux", "windows", "macos"]
python-version: ["3.8", "3.11"]
os: [ "linux", "windows", "macos" ]
python-version: [ "3.8", "3.11" ]
include:
- { os: "linux", target: "linux", runner: "ubuntu-latest" }
- { os: "windows", target: "windows", runner: "windows-latest" }
Expand Down
12 changes: 10 additions & 2 deletions scripts/check_system_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@

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:
Expand All @@ -32,7 +40,7 @@
# 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,
)
Expand All @@ -57,7 +65,7 @@
# 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,
)
Expand Down
Loading