sync rbufrp

This commit is contained in:
Tsuki 2026-01-08 17:05:03 +08:00
parent 32b0e9b8ed
commit 602b0b3964

View File

@ -70,10 +70,12 @@ jobs:
- name: Rust Tests - name: Rust Tests
if: matrix.conf.target == 'x86_64' && !startsWith(matrix.python-version, 'pypy') && matrix.python-version == '3.12' if: matrix.conf.target == 'x86_64' && !startsWith(matrix.python-version, 'pypy') && matrix.python-version == '3.12'
working-directory: rbufr
run: cargo test run: cargo test
- name: Build wheel (OSX - Linux) - name: Build wheel (OSX - Linux)
if: runner.os != 'Windows' if: runner.os != 'Windows'
working-directory: rbufrp
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
target: ${{ matrix.conf.target }} target: ${{ matrix.conf.target }}
@ -82,6 +84,7 @@ jobs:
- name: Build wheel (Windows) - name: Build wheel (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
working-directory: rbufrp
run: | run: |
python -m pip install maturin delvewheel python -m pip install maturin delvewheel
maturin build -i python --release --out wheels --target ${{ matrix.conf.target-triple }} maturin build -i python --release --out wheels --target ${{ matrix.conf.target-triple }}
@ -91,16 +94,12 @@ jobs:
- name: Install built wheel and Test (Native) - name: Install built wheel and Test (Native)
# TODO: I'm not sure but the actual collection of tests on windows using pypy3.10 takes forever and/or fails # TODO: I'm not sure but the actual collection of tests on windows using pypy3.10 takes forever and/or fails
if: | if: |
!startsWith(matrix.conf.manylinux, 'musl') && !startsWith(matrix.conf.manylinux, 'musl') &&
!( matrix.python-version == 'pypy3.10' && runner.os == 'Windows' ) && !( matrix.python-version == 'pypy3.10' && runner.os == 'Windows' ) &&
( matrix.conf.target == 'x86_64' || matrix.conf.target == 'universal2' ) ( matrix.conf.target == 'x86_64' || matrix.conf.target == 'universal2' )
run: | run: |
# Second install guarantees it's going to install from local dir w/ --no-index python -m pip install rbufrp --pre --find-links rbufrp/dist --force-reinstall
# use first to get in dev dependencies python -c "import rbufrp; print(rbufrp.__version__)"
python -m pip install cramjam[dev] --pre --find-links dist --force-reinstall
python -m pip install cramjam --pre --no-index --find-links dist --force-reinstall
python -m pytest -vs --benchmark-skip -n0 --dist no
# Could use 'distro: alpine_latest' in 'run-on-arch-action' but seems difficult to install a specific version of python # Could use 'distro: alpine_latest' in 'run-on-arch-action' but seems difficult to install a specific version of python
# so we'll just use existing python alpine images to test import and cli use w/o testing archs other than x86_64 # so we'll just use existing python alpine images to test import and cli use w/o testing archs other than x86_64
@ -109,9 +108,9 @@ jobs:
if: startsWith(matrix.conf.manylinux, 'musl') && matrix.conf.target == 'x86_64' && !startsWith(matrix.python-version, '3.14') if: startsWith(matrix.conf.manylinux, 'musl') && matrix.conf.target == 'x86_64' && !startsWith(matrix.python-version, '3.14')
run: | run: |
docker run \ docker run \
-v $(pwd)/dist:/wheels \ -v $(pwd)/rbufrp/dist:/wheels \
--rm python:${{ matrix.python-version }}-alpine sh \ --rm python:${{ matrix.python-version }}-alpine sh \
-c "pip install cramjam --no-index --find-links /wheels && python -c 'import cramjam'" -c "pip install rbufrp --no-index --find-links /wheels && python -c 'import rbufrp'"
# xref: https://github.com/milesgranger/cramjam/issues/194 # xref: https://github.com/milesgranger/cramjam/issues/194
# - name: Install built wheel and Test (Cross) # - name: Install built wheel and Test (Cross)
@ -140,15 +139,15 @@ jobs:
# PYTHON=python${{ matrix.python-version }} # PYTHON=python${{ matrix.python-version }}
# $PYTHON -m venv venv # $PYTHON -m venv venv
# venv/bin/pip install -U pip # venv/bin/pip install -U pip
# venv/bin/pip install cramjam --pre --no-index --find-links /artifacts --force-reinstall # venv/bin/pip install rbufrp --pre --no-index --find-links /artifacts --force-reinstall
# venv/bin/python -c 'import cramjam' # venv/bin/python -c 'import rbufrp'
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: ${{ ( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }} if: ${{ ( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }}
with: with:
name: ${{ matrix.conf.os }}-${{ matrix.python-version }}-${{ matrix.conf.target-triple }}-${{ matrix.conf.target }} name: ${{ matrix.conf.os }}-${{ matrix.python-version }}-${{ matrix.conf.target-triple }}-${{ matrix.conf.target }}
path: dist path: rbufrp/dist
build-sdist: build-sdist:
@ -159,15 +158,16 @@ jobs:
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.12 python-version: 3.12
- name: Build sdist cramjam - name: Build sdist rbufrp
working-directory: rbufrp
run: | run: |
python -m pip install build python -m pip install maturin
python -m build --sdist -o ./dist maturin sdist --out dist
- name: Upload sdists - name: Upload sdists
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: sdist name: sdist
path: dist path: rbufrp/dist
gh-publish: gh-publish:
name: Publish artifacts to GH name: Publish artifacts to GH