diff --git a/.github/workflows/build-pyxdameraulevenshtein.yml b/.github/workflows/build-pyxdameraulevenshtein.yml index f8096312e19f..5aba0262af6f 100644 --- a/.github/workflows/build-pyxdameraulevenshtein.yml +++ b/.github/workflows/build-pyxdameraulevenshtein.yml @@ -56,11 +56,26 @@ jobs: PYXDAMERAULEVENSHTEIN_VERSION: ${{ matrix.version }} steps: + # Upstream tags older releases `vX.Y.Z` and newer ones plain `X.Y.Z`; use whichever exists. + - name: Resolve upstream tag + id: tag + run: | + for ref in "v$VERSION" "$VERSION"; do + if git ls-remote --exit-code --tags https://github.com/lanl/pyxDamerauLevenshtein "refs/tags/$ref" >/dev/null; then + echo "ref=$ref" >> "$GITHUB_OUTPUT" + exit 0 + fi + done + echo "no tag for $VERSION in lanl/pyxDamerauLevenshtein" >&2 + exit 1 + env: + VERSION: ${{ env.PYXDAMERAULEVENSHTEIN_VERSION }} + - name: Checkout pyxDamerauLevenshtein v${{ env.PYXDAMERAULEVENSHTEIN_VERSION }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: lanl/pyxDamerauLevenshtein - ref: v${{ env.PYXDAMERAULEVENSHTEIN_VERSION }} + ref: ${{ steps.tag.outputs.ref }} persist-credentials: false - name: Build wheels @@ -70,6 +85,15 @@ jobs: only: ${{ matrix.python }}-manylinux_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # Restates upstream's [tool.cibuildwheel] environment (an env var replaces it), + # minus -mtune=generic: GCC has no such CPU on riscv64 ("unknown cpu 'generic' + # for '-mtune'"), which fails the first C compile since 1.11.0. + CIBW_ENVIRONMENT: CFLAGS="-O3 -g0 -pipe -fPIC" LDFLAGS="-fPIC" + # The extension does not declare free-threading support, so importing it under + # cp314t re-enables the GIL with a RuntimeWarning that upstream's + # filterwarnings = ["error"] turns fatal at collection; asking for the GIL up + # front is the same outcome without the warning. Ignored on the GIL builds. + CIBW_TEST_ENVIRONMENT: PYTHON_GIL=1 CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: pytest {package}/tests diff --git a/docs/packages/pyxdameraulevenshtein.yaml b/docs/packages/pyxdameraulevenshtein.yaml index b962a883e372..c20c3eaa5f48 100644 --- a/docs/packages/pyxdameraulevenshtein.yaml +++ b/docs/packages/pyxdameraulevenshtein.yaml @@ -17,3 +17,4 @@ versions: - filename: pyxdameraulevenshtein-1.10.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl sha256: 79899e08458649850d5775aa464d6c585f41a12fef15276a37721d815d3b533c requires-python: '>=3.9' +- version: 1.11.0