mirror of
https://github.com/openai/harmony.git
synced 2025-08-23 01:17:09 -04:00
Merge pull request #11 from openai/dev/scl/fix-builds
Fix builds for ubuntu aarch64, fix missing feature flags on some platforms
This commit is contained in:
commit
6f4325b4fb
6 changed files with 16 additions and 14 deletions
18
.github/workflows/CI.yml
vendored
18
.github/workflows/CI.yml
vendored
|
@ -28,14 +28,10 @@ jobs:
|
||||||
target: x86_64
|
target: x86_64
|
||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
target: x86
|
target: x86
|
||||||
# - runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
# target: aarch64
|
target: aarch64
|
||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
target: armv7
|
target: armv7
|
||||||
# - runner: ubuntu-22.04
|
|
||||||
# target: s390x
|
|
||||||
# - runner: ubuntu-22.04
|
|
||||||
# target: ppc64le
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
|
@ -43,6 +39,9 @@ jobs:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
|
env:
|
||||||
|
# Ensure ring's ARM assembly sees an explicit architecture on aarch64 (glibc)
|
||||||
|
CFLAGS_aarch64_unknown_linux_gnu: -D__ARM_ARCH=8
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.platform.target }}
|
target: ${{ matrix.platform.target }}
|
||||||
args: --release --out dist --find-interpreter
|
args: --release --out dist --find-interpreter
|
||||||
|
@ -74,6 +73,9 @@ jobs:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
|
env:
|
||||||
|
# Ensure ring's ARM assembly sees an explicit architecture on aarch64 (musl)
|
||||||
|
CFLAGS_aarch64_unknown_linux_musl: -D__ARM_ARCH=8
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.platform.target }}
|
target: ${{ matrix.platform.target }}
|
||||||
args: --release --out dist --find-interpreter
|
args: --release --out dist --find-interpreter
|
||||||
|
@ -104,7 +106,7 @@ jobs:
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.platform.target }}
|
target: ${{ matrix.platform.target }}
|
||||||
args: -F python-binding --release --out dist --find-interpreter
|
args: --release --out dist --find-interpreter
|
||||||
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||||
- name: Upload wheels
|
- name: Upload wheels
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@ -130,7 +132,7 @@ jobs:
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.platform.target }}
|
target: ${{ matrix.platform.target }}
|
||||||
args: -F python-binding --release --out dist --find-interpreter
|
args: --release --out dist --find-interpreter
|
||||||
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||||
- name: Upload wheels
|
- name: Upload wheels
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1317,7 +1317,7 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openai-harmony"
|
name = "openai-harmony"
|
||||||
version = "0.0.2"
|
version = "0.0.2-alpha.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64",
|
"base64",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "openai-harmony"
|
name = "openai-harmony"
|
||||||
version = "0.0.2"
|
version = "0.0.2-alpha.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
repository = "https://github.com/openai/harmony"
|
repository = "https://github.com/openai/harmony"
|
||||||
|
|
|
@ -177,10 +177,10 @@ source .venv/bin/activate
|
||||||
# Install maturin and test dependencies
|
# Install maturin and test dependencies
|
||||||
pip install maturin pytest mypy ruff # tailor to your workflow
|
pip install maturin pytest mypy ruff # tailor to your workflow
|
||||||
# Compile the Rust crate *and* install the Python package in editable mode
|
# Compile the Rust crate *and* install the Python package in editable mode
|
||||||
maturin develop -F python-binding --release
|
maturin develop --release
|
||||||
```
|
```
|
||||||
|
|
||||||
`maturin develop -F python-binding` builds _harmony_ with Cargo, produces a native extension
|
`maturin develop` builds _harmony_ with Cargo, produces a native extension
|
||||||
(`openai_harmony.<abi>.so`) and places it in your virtualenv next to the pure-
|
(`openai_harmony.<abi>.so`) and places it in your virtualenv next to the pure-
|
||||||
Python wrapper – similar to `pip install -e .` for pure Python projects.
|
Python wrapper – similar to `pip install -e .` for pure Python projects.
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ readme = "README.md"
|
||||||
demo = ["uvicorn", "fastapi"]
|
demo = ["uvicorn", "fastapi"]
|
||||||
|
|
||||||
[tool.maturin]
|
[tool.maturin]
|
||||||
features = ["pyo3/extension-module"]
|
features = ["python-binding", "pyo3/extension-module"]
|
||||||
module-name = "openai_harmony"
|
module-name = "openai_harmony"
|
||||||
python-source = "python"
|
python-source = "python"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
maturin develop -F python-binding --release
|
maturin develop --release
|
||||||
pytest "$@"
|
pytest "$@"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue