Skip to content

Commit d99d75f

Browse files
committed
wreq: Add version 0.12.1
1 parent b028d45 commit d99d75f

2 files changed

Lines changed: 133 additions & 0 deletions

File tree

‎.github/workflows/build-wreq.yml‎

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# This workflow is based on the `manylinux` and `tests` jobs of
5+
# https://github.com/0x676e67/wreq-python/blob/v0.12.1/.github/workflows/ci.yml
6+
name: Build wreq wheels (riscv64)
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Version glob to (re)build; empty builds every version of docs/packages/wreq.yaml not released yet'
13+
required: false
14+
default: ''
15+
pull_request:
16+
branches: [main]
17+
paths:
18+
- '.github/workflows/build-wreq.yml'
19+
- 'docs/packages/wreq.yaml'
20+
push:
21+
branches: [main]
22+
paths:
23+
- '.github/workflows/build-wreq.yml'
24+
- 'docs/packages/wreq.yaml'
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
28+
cancel-in-progress: true
29+
30+
permissions:
31+
contents: read # to fetch code (actions/checkout)
32+
33+
env:
34+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
35+
# wreq-python gitignores Cargo.lock and requires `wreq = "6.0.0-rc"`, so a fresh
36+
# resolve floats to the newest rc; pin the one the 0.12.1 release sdist locks.
37+
WREQ_CRATE_VERSION: '6.0.0-rc.29'
38+
39+
jobs:
40+
setup:
41+
uses: $/.github/workflows/_setup.yml
42+
with:
43+
package: wreq
44+
version: ${{ inputs.version }}
45+
46+
build_wheels:
47+
needs: [setup]
48+
if: needs.setup.outputs.versions != '[]'
49+
name: Build wreq ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64
50+
runs-on: ubuntu-24.04-riscv
51+
timeout-minutes: 360
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
56+
include:
57+
- tag: cp311-abi3
58+
build: >-
59+
cp312-manylinux_riscv64 cp313-manylinux_riscv64
60+
cp314-manylinux_riscv64
61+
- tag: cp314t
62+
build: cp314t-manylinux_riscv64
63+
64+
env:
65+
WREQ_VERSION: ${{ matrix.version }}
66+
67+
steps:
68+
- name: Checkout wreq-python v${{ env.WREQ_VERSION }}
69+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
70+
with:
71+
repository: 0x676e67/wreq-python
72+
ref: v${{ env.WREQ_VERSION }}
73+
persist-credentials: false
74+
75+
- name: Build wheels
76+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
77+
with:
78+
output-dir: wheelhouse/
79+
env:
80+
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
81+
CIBW_BUILD: ${{ matrix.build }}
82+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
83+
# btls-sys runs bindgen (libclang) and `git apply`s its BoringSSL patches.
84+
CIBW_BEFORE_ALL_LINUX: >-
85+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y &&
86+
dnf install -y clang-devel git
87+
CIBW_BEFORE_BUILD_LINUX: >-
88+
cargo generate-lockfile &&
89+
cargo update -p wreq --precise ${{ env.WREQ_CRATE_VERSION }}
90+
CIBW_ENVIRONMENT_LINUX: >-
91+
PATH="$PATH:$HOME/.cargo/bin"
92+
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
93+
MATURIN_PEP517_ARGS="--features jemalloc"
94+
CARGO_BUILD_JOBS=2
95+
# Upstream's tests job serves httpbin on localhost:8080 as a service container.
96+
CIBW_TEST_REQUIRES: pytest pytest-asyncio pytest-rerunfailures httpbin
97+
CIBW_TEST_SOURCES: tests
98+
CIBW_TEST_COMMAND: >-
99+
python -m httpbin.core --port 8080 > httpbin.log 2>&1 & HTTPBIN_PID=$!;
100+
python -c "import wreq.wreq as m; assert m.__file__.endswith('.so'), m.__file__" &&
101+
for i in $(seq 60); do
102+
python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/get', timeout=2)" 2>/dev/null && break;
103+
sleep 1; done &&
104+
python -m pytest -v tests; rc=$?;
105+
kill $HTTPBIN_PID; [ $rc = 0 ] || tail -n 50 httpbin.log; exit $rc
106+
107+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
108+
with:
109+
name: wreq-${{ env.WREQ_VERSION }}-${{ matrix.tag }}-manylinux_riscv64
110+
path: wheelhouse/*.whl
111+
if-no-files-found: error
112+
113+
publish:
114+
name: Publish wreq ${{ matrix.version }}
115+
needs: [setup, build_wheels]
116+
if: needs.setup.outputs.versions != '[]'
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
121+
permissions:
122+
contents: write
123+
pull-requests: write
124+
uses: $/.github/workflows/_publish-wheel.yml
125+
secrets:
126+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
127+
with:
128+
artifact-pattern: wreq-${{ matrix.version }}-*-manylinux_riscv64

‎docs/packages/wreq.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package-name: wreq
2+
source-code: https://github.com/0x676e67/wreq-python
3+
license: Apache-2.0
4+
versions:
5+
- version: 0.12.1

0 commit comments

Comments
 (0)