diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 70bc8c5..0e7238f 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -9,6 +9,10 @@ jobs: pypi_publish: name: Publish (pypi.org) runs-on: ubuntu-latest + env: + CARGO_HOME: ${{ github.workspace }}/.cargo + RUSTUP_HOME: ${{ github.workspace }}/.rustup + RUSTUP_TOOLCHAIN: stable steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v5 @@ -23,7 +27,7 @@ jobs: ~/.cache/pip-wheel ~/.cache/sccache ~/.cache/cargo-xwin - ~/.cargo + ${{ env.CARGO_HOME }} ~/.osxcross key: cache-ubuntu-maturin-cross-compile @@ -45,20 +49,21 @@ jobs: - name: Install Rust run: | - export PATH="$HOME/.cargo/bin:$PATH" + export PATH="$CARGO_HOME/bin:$PATH" if ! command -v rustc >/dev/null 2>&1; then curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y else rustup update fi rustup default stable + echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" shell: bash - name: Install sccache and maturin run: | - export PATH="$HOME/.cargo/bin:$PATH" - python -m pip install --upgrade pip - pip install maturin ziglang + export PATH="$CARGO_HOME/bin:$PATH" + python -m pip install --upgrade pip maturin ziglang cargo-zigbuild + rm -f "${CARGO_HOME:?}/bin/cargo-zigbuild" || true if ! command -v sccache >/dev/null 2>&1; then cargo install sccache || pip install sccache fi @@ -66,7 +71,7 @@ jobs: - name: Install xwin run: | - export PATH="$HOME/.cargo/bin:$PATH" + export PATH="$CARGO_HOME/bin:$PATH" if ! command -v cargo-xwin >/dev/null 2>&1; then cargo install cargo-xwin || pip install cargo-xwin cargo xwin cache xwin @@ -84,7 +89,7 @@ jobs: - name: Build wheels run: | - export PATH="$HOME/.cargo/bin:$HOME/.osxcross/bin:$PATH" + export PATH="$CARGO_HOME/bin:$HOME/.osxcross/bin:$PATH" rm -rf dist maturin sdist --out dist @@ -115,7 +120,7 @@ jobs: ~/.cache/pip-wheel ~/.cache/sccache ~/.cache/cargo-xwin - ~/.cargo + ${{ env.CARGO_HOME }} ~/.osxcross key: cache-ubuntu-maturin-cross-compile diff --git a/pyproject.toml b/pyproject.toml index 49e2e0c..bae92a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ ] [project.optional-dependencies] -test = ["pytest", "tifffile", "imagecodecs"] +test = ["pytest"] [project.scripts] smoll_generate_stub = "smoll:smoll_generate_stub"