Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcl committed Feb 7, 2025
1 parent 916b5fc commit d3828ca
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
strategy:
matrix:
# We mainly care about hardware rather than OS
# macos-13 is x86. This one doesn't work for some reason.
# macos-13 is x86
# macos-latest is arm64
# ubuntu-latest is x64
os: [macos-latest, ubuntu-latest]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -44,9 +44,13 @@ jobs:
pytest
- name: Make a wheel
# https://github.com/pypa/cibuildwheel
# Hit this: https://github.com/pypa/cibuildwheel/discussions/1926
env:
CIBW_BUILD_VERBOSITY: 1
run: |
pip install cibuildwheel
bin/make-wheel
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
Expand Down
3 changes: 2 additions & 1 deletion bin/make-wheel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cp -R $ROOT/interop/nki $WHEEL_DIR/klr/nki
cp -R $ROOT/interop/klr $WHEEL_DIR/klr/klr
cp $ROOT/LICENSE $WHEEL_DIR
cp $ROOT/interop/README.md $WHEEL_DIR
cp $ROOT/interop/noop.c $WHEEL_DIR
cp $ROOT/interop/pyproject.toml $WHEEL_DIR
cp $ROOT/interop/MANIFEST.in $WHEEL_DIR

Expand All @@ -23,7 +24,7 @@ if [ -z "${GITHUB_RUN_ID+x}" ]; then
else
# https://github.com/pypa/cibuildwheel
echo "Building wheel via GitHub Actions"
python -m cibuildwheel --output-dir $WHEEL_DIR/wheelhouse
python -m cibuildwheel --output-dir $ROOT/wheelhouse
fi

# To upload the wheel, with the proper token in ~/.pypirc, run
Expand Down
6 changes: 6 additions & 0 deletions interop/noop.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

int main() {
printf("Hello, World!\n");
return 0;
}
15 changes: 11 additions & 4 deletions interop/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ testpaths = [
# NB: All this setuptools stuff took about 1000 hours to figure out so never delete this.
[tool.setuptools]
# This makes it ok for there to be both klr and wheelhouse (where we generates wheels on github actions) in the same directory
packages = ["klr"]
#packages = ["klr"]
# This tricks setuptools into knowing this is a binary wheel
ext-modules = [
{name = "klr", sources = []}
]
# The output says this is experimental and likely to change in future releases, but
# we will keep our fingers crossed. Pretty sure we can make a setup.py file that does
# this and it won't be that different.
#ext-modules = [
# {name = "klr.noop", sources = ["noop.c"]}
#]

[[tool.setuptools.ext-modules]]
name = "noop"
sources = ["noop.c"]

[tool.setuptools.package-data]
# This part is essential to get the binary bin/klr included in the wheel
Expand Down

0 comments on commit d3828ca

Please sign in to comment.