Skip to content

Commit 18892d7

Browse files
authored
wreq: Add version 0.12.1 (#2546)
1 parent 3574a3e commit 18892d7

2 files changed

Lines changed: 141 additions & 0 deletions

File tree

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

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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+
# `tag` has to be a real axis: two `include` entries that only add new
57+
# keys would both extend the one `version` combination, and the second
58+
# would overwrite the first instead of creating a second leg.
59+
tag: [cp311-abi3, cp314t]
60+
include:
61+
- tag: cp311-abi3
62+
build: >-
63+
cp312-manylinux_riscv64 cp313-manylinux_riscv64
64+
cp314-manylinux_riscv64
65+
- tag: cp314t
66+
build: cp314t-manylinux_riscv64
67+
68+
env:
69+
WREQ_VERSION: ${{ matrix.version }}
70+
71+
steps:
72+
- name: Checkout wreq-python v${{ env.WREQ_VERSION }}
73+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
74+
with:
75+
repository: 0x676e67/wreq-python
76+
ref: v${{ env.WREQ_VERSION }}
77+
persist-credentials: false
78+
79+
- name: Build wheels
80+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
81+
with:
82+
output-dir: wheelhouse/
83+
env:
84+
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
85+
CIBW_BUILD: ${{ matrix.build }}
86+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
87+
# btls-sys runs bindgen (libclang) and `git apply`s its BoringSSL patches.
88+
CIBW_BEFORE_ALL_LINUX: >-
89+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y &&
90+
dnf install -y clang-devel git
91+
CIBW_BEFORE_BUILD_LINUX: >-
92+
cargo generate-lockfile &&
93+
cargo update -p wreq --precise ${{ env.WREQ_CRATE_VERSION }}
94+
CIBW_ENVIRONMENT_LINUX: >-
95+
PATH="$PATH:$HOME/.cargo/bin"
96+
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
97+
MATURIN_PEP517_ARGS="--features jemalloc"
98+
CARGO_BUILD_JOBS=2
99+
# Upstream's tests job serves httpbin on localhost:8080 from the kennethreitz/httpbin
100+
# container, i.e. under gunicorn: httpbin answers every chunked (streamed-body)
101+
# request with a 501 unless SERVER_SOFTWARE is gunicorn, so the Werkzeug dev
102+
# server behind `python -m httpbin.core` fails the body-stream tests.
103+
CIBW_TEST_REQUIRES: pytest pytest-asyncio pytest-rerunfailures httpbin gunicorn
104+
# The body-stream and multipart tests open these by a repo-root-relative path.
105+
CIBW_TEST_SOURCES: tests README.md Cargo.toml LICENSE
106+
CIBW_TEST_COMMAND: >-
107+
python -m gunicorn -b 127.0.0.1:8080 -k gthread --threads 8 httpbin:app > httpbin.log 2>&1 & HTTPBIN_PID=$!;
108+
python -c "import wreq.wreq as m; assert m.__file__.endswith('.so'), m.__file__" &&
109+
for i in $(seq 60); do
110+
python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/get', timeout=2)" 2>/dev/null && break;
111+
sleep 1; done &&
112+
python -m pytest -v tests; rc=$?;
113+
kill $HTTPBIN_PID; [ $rc = 0 ] || tail -n 50 httpbin.log; exit $rc
114+
115+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
116+
with:
117+
name: wreq-${{ env.WREQ_VERSION }}-${{ matrix.tag }}-manylinux_riscv64
118+
path: wheelhouse/*.whl
119+
if-no-files-found: error
120+
121+
publish:
122+
name: Publish wreq ${{ matrix.version }}
123+
needs: [setup, build_wheels]
124+
if: needs.setup.outputs.versions != '[]'
125+
strategy:
126+
fail-fast: false
127+
matrix:
128+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
129+
permissions:
130+
contents: write
131+
pull-requests: write
132+
uses: $/.github/workflows/_publish-wheel.yml
133+
secrets:
134+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
135+
with:
136+
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)