From 9300113ff4f12ad47caf92e61aed122fbf3f04c4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 19:37:08 -0500 Subject: [PATCH 01/29] fewer maturin references --- .github/workflows/benchmark.yml | 12 +++--------- .github/workflows/build-riscv64.yml | 3 +-- .github/workflows/build-test.yml | 28 ++++++++++++---------------- 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ad409a315..c78e26822 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -46,15 +46,13 @@ jobs: - name: Install dependencies run: | - python -m pip install maturin rustup target add x86_64-unknown-linux-musl python -m pip install pytest python -m pip install mypy - 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 clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8 - name: python mypy run: | @@ -91,15 +89,11 @@ jobs: - uses: chia-network/actions/activate-venv@main - - name: Install dependencies + - name: Install run: | python -m pip install --upgrade pip - python -m pip install maturin 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 colorama clvm_tools ./wheel - name: test generators run: | diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 2f709c582..eecf7abff 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -81,8 +81,7 @@ jobs: 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 \ + pip install --extra-index-url https://pypi.chia.net/simple/ ./wheel \ ' - name: Upload artifacts diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a0d359fce..f9ad04fe1 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -142,20 +142,17 @@ jobs: - name: Set up rust uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - python -m pip install maturin - - - name: Build MacOs with maturin on Python ${{ matrix.python }} + - name: Build macOS on Python ${{ matrix.python }} if: matrix.os.matrix == 'macos' env: MACOSX_DEPLOYMENT_TARGET: '11.0' run: | python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate - maturin build -i python --release -m wheel/Cargo.toml + pip install build + python -m build ./wheel - - name: Build Linux with maturin on Python ${{ matrix.python }} + - name: Build Linux on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' run: | docker run --rm \ @@ -167,12 +164,11 @@ jobs: rustup target add ${{ matrix.python.by-arch[matrix.arch.matrix].rustup-target }} && \ python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ - pip install --upgrade pip && \ - pip install maturin && \ - CC=gcc maturin build --release --manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }} -m wheel/Cargo.toml \ + pip install --upgrade pip build && \ + MATURIN_PEP517_ARGS='--manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' python -m build ./wheel \ ' - - name: Build Windows with maturin on Python ${{ matrix.python }} + - name: Build Windows on Python ${{ matrix.python }} if: matrix.os.matrix == 'windows' env: CC: 'clang' @@ -180,7 +176,8 @@ jobs: run: | py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 - maturin build -i python --release -m wheel/Cargo.toml + pip install build + python -m build ./wheel - uses: Chia-Network/actions/create-venv@main id: create-venv @@ -267,8 +264,8 @@ jobs: - name: Build source distribution run: | - pip install maturin - maturin sdist -m wheel/Cargo.toml + pip install build + python -m build --sdist ./wheel - name: Upload artifacts uses: actions/upload-artifact@v3 @@ -387,8 +384,7 @@ jobs: source venv/bin/activate git clone https://github.com/Chia-Network/clvm_tools.git --branch=main --single-branch pip install ./clvm_tools - pip install colorama maturin pytest chia-blockchain==2.1.2 clvm==0.9.8 - maturin develop --release -m wheel/Cargo.toml + pip install ./wheel colorama pytest chia-blockchain==2.1.2 clvm==0.9.8 pytest tests grcov . --binary-path target -s . --branch --ignore-not-existing --ignore='*/.cargo/*' --ignore='tests/*' --ignore='venv/*' -o rust_cov.info python -c 'with open("rust_cov.info") as f: lines = [l for l in f if not (l.startswith("DA:") and int(l.split(",")[1].strip()) >= 2**63)]; open("lcov.info", "w").writelines(lines)' From 714e5fbffc12a2d83bd8b7dbdc84a19e26b0e356 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:02:11 -0500 Subject: [PATCH 02/29] cheat pip --- .github/workflows/benchmark.yml | 9 +++++++-- .github/workflows/build-test.yml | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c78e26822..0eb05bd74 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -52,7 +52,8 @@ jobs: - name: Build run: | - python -m pip install ./wheel clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8 + python -m pip install clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8 + python -m pip install ./wheel - name: python mypy run: | @@ -92,8 +93,12 @@ jobs: - name: Install run: | python -m pip install --upgrade pip + python -m pip install colorama clvm_tools rustup target add x86_64-unknown-linux-musl - python -m pip install colorama clvm_tools ./wheel + + - name: Build + run: | + python -m pip install ./wheel - name: test generators run: | diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f9ad04fe1..1f2b7072f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -384,7 +384,8 @@ jobs: source venv/bin/activate git clone https://github.com/Chia-Network/clvm_tools.git --branch=main --single-branch pip install ./clvm_tools - pip install ./wheel colorama pytest chia-blockchain==2.1.2 clvm==0.9.8 + pip install colorama pytest chia-blockchain==2.1.2 clvm==0.9.8 + pip install ./wheel pytest tests grcov . --binary-path target -s . --branch --ignore-not-existing --ignore='*/.cargo/*' --ignore='tests/*' --ignore='venv/*' -o rust_cov.info python -c 'with open("rust_cov.info") as f: lines = [l for l in f if not (l.startswith("DA:") and int(l.split(",")[1].strip()) >= 2**63)]; open("lcov.info", "w").writelines(lines)' From 48ecff7dacb46c9cac2fffeebaf8912515712deb Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:08:38 -0500 Subject: [PATCH 03/29] use dist/ --- .github/workflows/build-riscv64.yml | 14 +++++++------- .github/workflows/build-test.yml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index eecf7abff..89a1abcdc 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -80,15 +80,15 @@ jobs: 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/ ./wheel \ + pip install --upgrade build && \ + python -m build --extra-index-url https://pypi.chia.net/simple/ ./wheel \ ' - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: packages - path: ./target/wheels + path: dist/ if-no-files-found: error upload: name: Upload to Chia PyPI @@ -111,7 +111,7 @@ jobs: uses: actions/download-artifact@v3 with: name: packages - path: ./target/wheels + path: ./dist - name: Configure AWS credentials if: env.RELEASE == 'true' @@ -132,8 +132,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' @@ -146,4 +146,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/' diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1f2b7072f..b0aa021bb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -188,13 +188,13 @@ jobs: - name: Install chia_rs wheel run: | - pip install --no-index --find-links target/wheels/ chia_rs + pip install --no-index --find-links dist/ chia_rs - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: packages - path: ./target/wheels/ + path: dist/ check-typestubs: name: Check chia_rs.pyi @@ -271,7 +271,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: packages - path: ./target/wheels/ + path: dist/ fmt: runs-on: ubuntu-latest From 0eed8cf7decbf885b8d83a75e34af5d792ac792f Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:15:05 -0500 Subject: [PATCH 04/29] less quote nesting --- .github/workflows/build-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b0aa021bb..e65d53e26 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -157,6 +157,7 @@ jobs: run: | docker run --rm \ -v ${{ github.workspace }}:/ws --workdir=/ws \ + -e MATURIN_PEP517_ARGS='--manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' ${{ matrix.python.by-arch[matrix.arch.matrix].docker-url }} \ bash -exc '\ yum -y install openssl-devel && \ @@ -165,7 +166,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install --upgrade pip build && \ - MATURIN_PEP517_ARGS='--manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' python -m build ./wheel \ + python -m build ./wheel \ ' - name: Build Windows on Python ${{ matrix.python }} From 41e7c7493e8703c04cb97dca685dd783ba39c63e Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:20:45 -0500 Subject: [PATCH 05/29] \ --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e65d53e26..9565c07c1 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -157,7 +157,7 @@ jobs: run: | docker run --rm \ -v ${{ github.workspace }}:/ws --workdir=/ws \ - -e MATURIN_PEP517_ARGS='--manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' + -e MATURIN_PEP517_ARGS='--manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' \ ${{ matrix.python.by-arch[matrix.arch.matrix].docker-url }} \ bash -exc '\ yum -y install openssl-devel && \ From 3dc14cea6bd9dc1488bfa334d1a31a6851897a39 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:30:29 -0500 Subject: [PATCH 06/29] more --- .github/workflows/build-riscv64.yml | 3 ++- .github/workflows/build-test.yml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 89a1abcdc..e85d9d629 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -75,13 +75,14 @@ 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 build && \ - python -m build --extra-index-url https://pypi.chia.net/simple/ ./wheel \ + python -m build --wheel ./wheel \ ' - name: Upload artifacts diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9565c07c1..8d0235604 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -150,7 +150,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv venv . venv/bin/activate pip install build - python -m build ./wheel + python -m build --wheel ./wheel - name: Build Linux on Python ${{ matrix.python }} if: matrix.os.matrix == 'ubuntu' @@ -166,7 +166,7 @@ jobs: python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ pip install --upgrade pip build && \ - python -m build ./wheel \ + python -m build --wheel ./wheel \ ' - name: Build Windows on Python ${{ matrix.python }} @@ -177,8 +177,8 @@ jobs: run: | py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 - pip install build - python -m build ./wheel + pip install --upgrade pip build + python -m build --wheel ./wheel - uses: Chia-Network/actions/create-venv@main id: create-venv From 0c82fbd8351ac73130638d4703ec62baabdd182c Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:31:26 -0500 Subject: [PATCH 07/29] and --- .github/workflows/build-riscv64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index e85d9d629..65a281c49 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -75,7 +75,7 @@ jobs: run: | docker run --rm --platform linux/riscv64 \ -v ${{ github.workspace }}:/ws --workdir=/ws \ - -e PIP_EXTRA_INDEX_URL='https://pypi.chia.net/simple/ + -e PIP_EXTRA_INDEX_URL='https://pypi.chia.net/simple/ \ chianetwork/ubuntu-22.04-risc-builder:latest \ bash -exc '\ pyenv global ${{ matrix.python.matrix }} From e7f5cec47f143f285fb7b109ac4f77e8e1112aec Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:35:19 -0500 Subject: [PATCH 08/29] more --- .github/workflows/build-riscv64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 65a281c49..35bba67b1 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -75,7 +75,7 @@ jobs: run: | docker run --rm --platform linux/riscv64 \ -v ${{ github.workspace }}:/ws --workdir=/ws \ - -e PIP_EXTRA_INDEX_URL='https://pypi.chia.net/simple/ \ + -e PIP_EXTRA_INDEX_URL='https://pypi.chia.net/simple/' \ chianetwork/ubuntu-22.04-risc-builder:latest \ bash -exc '\ pyenv global ${{ matrix.python.matrix }} From 01f02c44f702252834f07ed426d8c8580b18dce4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:38:52 -0500 Subject: [PATCH 09/29] yup --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8d0235604..cbb07857a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -177,7 +177,7 @@ jobs: run: | py -${{ matrix.python.major-dot-minor }} -m venv venv . .\venv\Scripts\Activate.ps1 - pip install --upgrade pip build + python -m pip install --upgrade pip build python -m build --wheel ./wheel - uses: Chia-Network/actions/create-venv@main From 3567366de40a3f453b21a8b0feff833fe2e8c8cb Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:43:27 -0500 Subject: [PATCH 10/29] woo --- .github/workflows/build-riscv64.yml | 4 ++-- .github/workflows/build-test.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 35bba67b1..d04c89844 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -89,7 +89,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: packages - path: dist/ + path: wheel/dist/ if-no-files-found: error upload: name: Upload to Chia PyPI @@ -112,7 +112,7 @@ jobs: uses: actions/download-artifact@v3 with: name: packages - path: ./dist + path: wheel/dist/ - name: Configure AWS credentials if: env.RELEASE == 'true' diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index cbb07857a..023d61058 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -189,13 +189,13 @@ jobs: - name: Install chia_rs wheel run: | - pip install --no-index --find-links dist/ chia_rs + pip install --no-index --find-links wheel/dist/ chia_rs - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: packages - path: dist/ + path: wheel/dist/ check-typestubs: name: Check chia_rs.pyi @@ -272,7 +272,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: packages - path: dist/ + path: wheel/dist/ fmt: runs-on: ubuntu-latest From 119dbc853ef40f22b1451276046b6fdf04213a50 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 20:52:34 -0500 Subject: [PATCH 11/29] - --- wheel/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index a5045b692..0a152a76f 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -4,4 +4,4 @@ build-backend = "maturin" [tool.maturin] bindings = "pyo3" -features = ["pyo3/extension-module"] +features = ["extension-module"] From 82d361650b6addbb9da89ac140499a810ba0e56b Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:08:35 -0500 Subject: [PATCH 12/29] bump maturin version? --- wheel/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index 0a152a76f..2bbaa06e8 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.11.3,<0.12"] +requires = ["maturin>=1.3.2,<1.4.0"] build-backend = "maturin" [tool.maturin] From 6b0eb3ac3506b768cad760bcf5f5aa1016d0f83d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:10:33 -0500 Subject: [PATCH 13/29] hmm --- wheel/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index 2bbaa06e8..8781fd26c 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -5,3 +5,6 @@ build-backend = "maturin" [tool.maturin] bindings = "pyo3" features = ["extension-module"] + +[project] +name = "chia_rs" From 70e8f3b2c556903a4bec9d2b612c5dad71b9f898 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:12:50 -0500 Subject: [PATCH 14/29] blah --- wheel/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/Cargo.toml b/wheel/Cargo.toml index ff1e3af49..d33e55257 100644 --- a/wheel/Cargo.toml +++ b/wheel/Cargo.toml @@ -18,7 +18,7 @@ path = "src/lib.rs" clvmr = "0.6.0" hex = "0.4.3" sha2 = "0.10.8" -pyo3 = { version = "=0.19.0", features = ["multiple-pymethods"] } +pyo3 = { version = "=0.19.0", features = ["extension-module", "multiple-pymethods"] } chia-consensus = { version = "=0.5.2", path = "../crates/chia-consensus", features = ["py-bindings"] } chia-bls = { version = "=0.5.1", path = "../crates/chia-bls", features = ["py-bindings"] } chia-protocol = { version = "=0.5.1", path = "../crates/chia-protocol", features = ["py-bindings"] } From 0641d78a30883e5221e7abcc48a0279c5d71e2b3 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:15:46 -0500 Subject: [PATCH 15/29] stuff --- wheel/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index 8781fd26c..dde44c3b4 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=1.3.2,<1.4.0"] +requires = ["maturin~=1.4.0"] build-backend = "maturin" [tool.maturin] From e69f0a22b3cfe6b9487c8b621ab3a2a67e88b93f Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:17:06 -0500 Subject: [PATCH 16/29] blue --- wheel/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wheel/Cargo.toml b/wheel/Cargo.toml index d33e55257..7edd9f4eb 100644 --- a/wheel/Cargo.toml +++ b/wheel/Cargo.toml @@ -14,6 +14,10 @@ name = "chia_rs" crate-type = ["cdylib"] path = "src/lib.rs" +[features] +extension-module = ["dep:pyo3"] +default = [] + [dependencies] clvmr = "0.6.0" hex = "0.4.3" From cb6e1b657649c05529bcd53b8b7fc8203ad46dc4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:20:23 -0500 Subject: [PATCH 17/29] heh --- wheel/Cargo.toml | 6 +----- wheel/pyproject.toml | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/wheel/Cargo.toml b/wheel/Cargo.toml index 7edd9f4eb..e506ecc34 100644 --- a/wheel/Cargo.toml +++ b/wheel/Cargo.toml @@ -14,15 +14,11 @@ name = "chia_rs" crate-type = ["cdylib"] path = "src/lib.rs" -[features] -extension-module = ["dep:pyo3"] -default = [] - [dependencies] clvmr = "0.6.0" hex = "0.4.3" sha2 = "0.10.8" -pyo3 = { version = "=0.19.0", features = ["extension-module", "multiple-pymethods"] } +pyo3 = { version = "=0.20.2", features = ["extension-module", "multiple-pymethods"] } chia-consensus = { version = "=0.5.2", path = "../crates/chia-consensus", features = ["py-bindings"] } chia-bls = { version = "=0.5.1", path = "../crates/chia-bls", features = ["py-bindings"] } chia-protocol = { version = "=0.5.1", path = "../crates/chia-protocol", features = ["py-bindings"] } diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index dde44c3b4..3fa852a12 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -5,6 +5,3 @@ build-backend = "maturin" [tool.maturin] bindings = "pyo3" features = ["extension-module"] - -[project] -name = "chia_rs" From f3b423f4ef44c51efd0c2d4545964bbf5b166ba3 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 8 Mar 2024 22:25:38 -0500 Subject: [PATCH 18/29] back --- wheel/Cargo.toml | 2 +- wheel/pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wheel/Cargo.toml b/wheel/Cargo.toml index e506ecc34..ff1e3af49 100644 --- a/wheel/Cargo.toml +++ b/wheel/Cargo.toml @@ -18,7 +18,7 @@ path = "src/lib.rs" clvmr = "0.6.0" hex = "0.4.3" sha2 = "0.10.8" -pyo3 = { version = "=0.20.2", features = ["extension-module", "multiple-pymethods"] } +pyo3 = { version = "=0.19.0", features = ["multiple-pymethods"] } chia-consensus = { version = "=0.5.2", path = "../crates/chia-consensus", features = ["py-bindings"] } chia-bls = { version = "=0.5.1", path = "../crates/chia-bls", features = ["py-bindings"] } chia-protocol = { version = "=0.5.1", path = "../crates/chia-protocol", features = ["py-bindings"] } diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index 3fa852a12..a5045b692 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -1,7 +1,7 @@ [build-system] -requires = ["maturin~=1.4.0"] +requires = ["maturin>=0.11.3,<0.12"] build-backend = "maturin" [tool.maturin] bindings = "pyo3" -features = ["extension-module"] +features = ["pyo3/extension-module"] From 47c0bc3cbbf5c0c6579460608622afb3da97bf52 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sat, 9 Mar 2024 19:45:34 -0500 Subject: [PATCH 19/29] fail-fast: false --- .github/workflows/build-riscv64.yml | 2 ++ .github/workflows/build-test.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index d04c89844..695e375de 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -19,6 +19,7 @@ jobs: name: Build riscv64 crate and run tests runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest] @@ -47,6 +48,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: diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 023d61058..e2f63d8fa 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -350,6 +350,7 @@ jobs: unit_tests: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macos-latest, ubuntu-latest, windows-latest] name: Unit tests From aa4839d60f5ef777ba81db0a24038870a9a6b05a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sat, 9 Mar 2024 19:55:46 -0500 Subject: [PATCH 20/29] update pip more --- .github/workflows/benchmark.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 0eb05bd74..43a6de6b8 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,16 +31,13 @@ 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 - name: setup venv run: | python -m venv venv + python -m pip install --upgrade pip - uses: chia-network/actions/activate-venv@main From c70f7fb27dc42079bd29eed03daa77f68c3f4305 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sat, 9 Mar 2024 21:14:59 -0500 Subject: [PATCH 21/29] gee --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 43a6de6b8..d24f8acc3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -37,12 +37,12 @@ jobs: - name: setup venv run: | python -m venv venv - python -m pip install --upgrade pip - uses: chia-network/actions/activate-venv@main - name: Install dependencies run: | + python -m pip install --upgrade pip rustup target add x86_64-unknown-linux-musl python -m pip install pytest python -m pip install mypy From 1516b44042281a8fd7538c649cf03b100cc54bbb Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sat, 9 Mar 2024 21:40:23 -0500 Subject: [PATCH 22/29] more pip --- .github/workflows/build-riscv64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 695e375de..679bd4dea 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -83,7 +83,7 @@ jobs: pyenv global ${{ matrix.python.matrix }} python -m venv venv && \ source ./venv/bin/activate && \ - pip install --upgrade build && \ + pip install --upgrade pip build && \ python -m build --wheel ./wheel \ ' From 102c31db58bbbc79b31d12b7e4520303ae9c8664 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sat, 9 Mar 2024 22:12:34 -0500 Subject: [PATCH 23/29] llp --- .github/workflows/build-riscv64.yml | 1 + .github/workflows/build-test.yml | 1 + llp.sh | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 llp.sh diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 679bd4dea..e171799bd 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -83,6 +83,7 @@ jobs: pyenv global ${{ matrix.python.matrix }} python -m venv venv && \ source ./venv/bin/activate && \ + source ./llp.sh && \ pip install --upgrade pip build && \ python -m build --wheel ./wheel \ ' diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e2f63d8fa..f6d68c012 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -165,6 +165,7 @@ jobs: rustup target add ${{ matrix.python.by-arch[matrix.arch.matrix].rustup-target }} && \ python${{ matrix.python.major-dot-minor }} -m venv /venv && \ . /venv/bin/activate && \ + source ./llp.sh && \ pip install --upgrade pip build && \ python -m build --wheel ./wheel \ ' diff --git a/llp.sh b/llp.sh new file mode 100644 index 000000000..a43b18481 --- /dev/null +++ b/llp.sh @@ -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"))') From f244b74c2b39d55e3fa5d9e2e9a3b8ee1020ab03 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 13:47:52 -0400 Subject: [PATCH 24/29] `maturin~=1.2` in `pyproject.toml` --- wheel/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index a5045b692..e6e7e6b6f 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.11.3,<0.12"] +requires = ["maturin~=1.2"] build-backend = "maturin" [tool.maturin] From be56271a65ab8e57270489eb405592aa9cc66ae4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 13:52:59 -0400 Subject: [PATCH 25/29] fixup --- .github/workflows/build-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f6d68c012..434767955 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -142,7 +142,7 @@ jobs: - name: Set up rust uses: dtolnay/rust-toolchain@stable - - name: Build macOS on Python ${{ matrix.python }} + - name: Build macOS on Python ${{ matrix.python.major-dot-minor }} if: matrix.os.matrix == 'macos' env: MACOSX_DEPLOYMENT_TARGET: '11.0' @@ -152,7 +152,7 @@ jobs: pip install build python -m build --wheel ./wheel - - name: Build Linux on Python ${{ matrix.python }} + - name: Build Linux on Python ${{ matrix.python.major-dot-minor }} if: matrix.os.matrix == 'ubuntu' run: | docker run --rm \ @@ -170,7 +170,7 @@ jobs: python -m build --wheel ./wheel \ ' - - name: Build Windows on Python ${{ matrix.python }} + - name: Build Windows on Python ${{ matrix.python.major-dot-minor }} if: matrix.os.matrix == 'windows' env: CC: 'clang' From 886ff6e6dd9dfb431317d44ac531bcdf9661ba88 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 13:59:41 -0400 Subject: [PATCH 26/29] `--compatibility` --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 434767955..dbbed6b44 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -157,7 +157,7 @@ jobs: run: | docker run --rm \ -v ${{ github.workspace }}:/ws --workdir=/ws \ - -e MATURIN_PEP517_ARGS='--manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' \ + -e MATURIN_PEP517_ARGS='--compatibility ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }}' \ ${{ matrix.python.by-arch[matrix.arch.matrix].docker-url }} \ bash -exc '\ yum -y install openssl-devel && \ From 85f5b3ad7675b9a9a57bdb764b79df28a2f69c8d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 16:29:34 -0400 Subject: [PATCH 27/29] try with maturin pr --- wheel/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/pyproject.toml b/wheel/pyproject.toml index e6e7e6b6f..e384b325e 100644 --- a/wheel/pyproject.toml +++ b/wheel/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin~=1.2"] +requires = ["maturin @ git+https://github.com/altendky/maturin@patch-1"] build-backend = "maturin" [tool.maturin] From eea3f5aa156d99c6c9cf1d4841afc20180072406 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 1 Oct 2024 09:41:49 -0400 Subject: [PATCH 28/29] precommit --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcaf8c314..2a233ff81 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 From 3f94354dd715893be8791c12b045831f60e09dbd Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 1 Oct 2024 09:44:07 -0400 Subject: [PATCH 29/29] tweak --- .github/workflows/benchmark.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2339add3a..8753ca8ae 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -57,7 +57,7 @@ jobs: - name: Build run: | python -m pip install clvm_tools colorama blspy chia-blockchain==2.1.2 clvm==0.9.8 - python -m pip install ./wheel + python -m pip install wheel/ - name: python mypy run: | @@ -119,7 +119,7 @@ jobs: - uses: chia-network/actions/activate-venv@main - - name: Install + - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install colorama clvm_tools @@ -127,7 +127,7 @@ jobs: - name: Build run: | - python -m pip install ./wheel + python -m pip install wheel/ - name: test generators run: |