Skip to content

Commit

Permalink
Add Cargo.lock and bump patch version (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger authored Dec 12, 2024
1 parent a23b9ea commit b7e5b77
Show file tree
Hide file tree
Showing 5 changed files with 984 additions and 82 deletions.
147 changes: 74 additions & 73 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ jobs:
- name: Setup (Windows)
if: runner.os == 'Windows'
run: |
choco install ninja cmake
uses: lukka/get-cmake@latest

- name: Setup (Linux)
if: runner.os == 'Linux'
Expand Down Expand Up @@ -211,33 +210,35 @@ jobs:
--rm python:${{ matrix.python-version }}-alpine sh \
-c "pip install cramjam --no-index --find-links /wheels && python -c 'import cramjam'"
- name: Install built wheel and Test (Cross)
if: |
!startsWith(matrix.conf.manylinux, 'musl') &&
runner.os == 'Linux' &&
!startsWith(matrix.python-version, 'pypy') &&
contains(fromJson('["armv6", "armv7", "aarch64", "riscv64", "s390x", "ppc64le"]'), matrix.conf.target)
uses: uraimo/[email protected]
with:
arch: ${{ matrix.conf.target }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
# Mount the dist directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/dist:/artifacts"
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-venv software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y curl python${{ matrix.python-version }}-venv
run: |
ls -lrth /artifacts
PYTHON=python${{ matrix.python-version }}
$PYTHON -m venv venv
venv/bin/pip install -U pip
venv/bin/pip install cramjam --pre --no-index --find-links /artifacts --force-reinstall
venv/bin/python -c 'import cramjam'
# xref: https://github.com/milesgranger/cramjam/issues/194
# - name: Install built wheel and Test (Cross)
# if: |
# !startsWith(matrix.conf.manylinux, 'musl') &&
# runner.os == 'Linux' &&
# contains(fromJson('["3.9", "3.11", "3.13"]'), matrix.python-version ) &&
# !startsWith(matrix.python-version, 'pypy') &&
# contains(fromJson('["armv6", "armv7", "aarch64", "riscv64", "s390x", "ppc64le"]'), matrix.conf.target)
# uses: uraimo/run-on-arch-action@v2
# with:
# arch: ${{ matrix.conf.target }}
# distro: ubuntu22.04
# githubToken: ${{ github.token }}
# # Mount the dist directory as /artifacts in the container
# dockerRunArgs: |
# --volume "${PWD}/dist:/artifacts"
# install: |
# apt-get update
# apt-get install -y --no-install-recommends python3 python3-venv software-properties-common
# add-apt-repository ppa:deadsnakes/ppa
# apt-get update
# apt-get install -y curl python${{ matrix.python-version }}-venv
# run: |
# ls -lrth /artifacts
# PYTHON=python${{ matrix.python-version }}
# $PYTHON -m venv venv
# venv/bin/pip install -U pip
# venv/bin/pip install cramjam --pre --no-index --find-links /artifacts --force-reinstall
# venv/bin/python -c 'import cramjam'

- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -246,50 +247,50 @@ jobs:
name: ${{ matrix.conf.os }}-${{ matrix.python-version }}-${{ matrix.conf.target-triple }}-${{ matrix.conf.target }}
path: dist

build-wasm32-emscripten-pyodide:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
target: wasm32-unknown-emscripten

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
# This needs to match the exact expected version pyodide expects...seems a bit brittle TBH, maybe I'm missing something.
# Discover by updating pyodide in package.json and re-running 'npm run test'; it'll spit out the error of
# the expected vs actual versions.
version: '3.1.58'

- name: Build
run: |
pip install maturin
maturin build --release -i python${{ matrix.python }} --features wasm32-compat --target wasm32-unknown-emscripten -o ./dist
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- run: npm run test

- name: Upload wheels
uses: actions/upload-artifact@v4
if: ${{ ( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }}
with:
name: wasm32-unknown-emscripten-python${{ matrix.python }}
path: dist
# build-wasm32-emscripten-pyodide:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python:
# - "3.12"
# steps:
# - uses: actions/checkout@v4

# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# with:
# toolchain: nightly
# target: wasm32-unknown-emscripten

# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}

# - name: Install Emscripten
# uses: mymindstorm/setup-emsdk@v14
# with:
# # This needs to match the exact expected version pyodide expects...seems a bit brittle TBH, maybe I'm missing something.
# # Discover by updating pyodide in package.json and re-running 'npm run test'; it'll spit out the error of
# # the expected vs actual versions.
# version: '3.1.58'

# - name: Build
# run: |
# pip install maturin
# maturin build --release -i python${{ matrix.python }} --features wasm32-compat --target wasm32-unknown-emscripten -o ./dist

# - uses: actions/setup-node@v3
# with:
# node-version: '18'
# - run: npm install
# - run: npm run test

# - name: Upload wheels
# uses: actions/upload-artifact@v4
# if: ${{ ( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }}
# with:
# name: wasm32-unknown-emscripten-python${{ matrix.python }}
# path: dist

build-sdist:
name: Build sdists
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ __pycache__/
benchenv/
cramjam-python/_build

Cargo.lock


# Distribution / packaging
.Python
build/
Expand Down
Loading

0 comments on commit b7e5b77

Please sign in to comment.