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

fewer maturin references #428

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
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
12 changes: 4 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Update pip
run: |
python -m pip install --upgrade pip

- name: Set up rust
uses: dtolnay/rust-toolchain@stable

Expand All @@ -52,7 +48,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install maturin
python -m pip install --upgrade pip
rustup target add x86_64-unknown-linux-musl
python -m pip install pytest pytest-xdist
python -m pip install mypy
Expand All @@ -61,7 +57,7 @@ jobs:
- name: Build
run: |
python -m pip install clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8
maturin develop --release -m wheel/Cargo.toml
python -m pip install wheel/

- name: python mypy
run: |
Expand Down Expand Up @@ -126,12 +122,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install maturin colorama clvm_tools
python -m pip install colorama clvm_tools
rustup target add x86_64-unknown-linux-musl

- name: Build
run: |
maturin develop --release -m wheel/Cargo.toml
python -m pip install wheel/

- name: test generators
run: |
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/build-riscv64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
name: Build riscv64 crate and run tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

Expand Down Expand Up @@ -51,6 +52,7 @@ jobs:
name: ${{ matrix.os }} 📦 Build Wheel ${{ matrix.python.major-dot-minor }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python:
Expand Down Expand Up @@ -79,21 +81,22 @@ jobs:
run: |
docker run --rm --platform linux/riscv64 \
-v ${{ github.workspace }}:/ws --workdir=/ws \
-e PIP_EXTRA_INDEX_URL='https://pypi.chia.net/simple/' \
chianetwork/ubuntu-22.04-risc-builder:latest \
bash -exc '\
pyenv global ${{ matrix.python.matrix }}
python -m venv venv && \
source ./venv/bin/activate && \
pip install --upgrade pip && \
pip install --extra-index-url https://pypi.chia.net/simple/ maturin==1.2.3 && \
maturin build -i python --release -m wheel/Cargo.toml \
source ./llp.sh && \
pip install --upgrade pip build && \
python -m build --wheel ./wheel \
'

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.os }}-${{ matrix.python.major-dot-minor }}
path: ./target/wheels
path: wheel/dist/
if-no-files-found: error
upload:
name: Upload to Chia PyPI
Expand All @@ -117,7 +120,7 @@ jobs:
with:
merge-multiple: true
pattern: packages-*
path: ./target/wheels
path: wheel/dist/

- name: Configure AWS credentials
if: env.RELEASE == 'true'
Expand All @@ -138,8 +141,8 @@ jobs:
if: env.RELEASE == 'true'
shell: sh
run: |
(cd target/wheels/; ls chia_rs-*.whl) > new_wheel_list
cat new_wheel_list | xargs -I % sh -c 'ls -l target/wheels/%'
(cd dist/; ls chia_rs-*.whl) > new_wheel_list
cat new_wheel_list | xargs -I % sh -c 'ls -l dist/%'

- name: Choose wheels to upload
if: env.RELEASE == 'true'
Expand All @@ -152,4 +155,4 @@ jobs:
if: env.RELEASE == 'true'
shell: sh
run: |
cat upload_wheel_list | xargs -I % sh -c 'aws s3 cp target/wheels/% s3://download.chia.net/simple/chia-rs/'
cat upload_wheel_list | xargs -I % sh -c 'aws s3 cp dist/% s3://download.chia.net/simple/chia-rs/'
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ repos:
pass_filenames: false
- id: wheel
name: build wheel
description: run maturin develop on the wheel
description: build python wheel
stages: [pre-push]
entry: sh -c "cd wheel && maturin develop"
entry: python -m build --wheel wheel/
language: system
pass_filenames: false
3 changes: 3 additions & 0 deletions llp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TODO: avoid needing this

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(python -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))')