Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9", "pypy-3.10"]
# PyPy is omitted: the mainapp extra pulls gevent, which ships no PyPy
# wheels and fails to build from source on PyPy under Cython 3.
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-22.04, macOS-latest, windows-latest]
# Python 3.8 and 3.9 do not run on macOS-latest which
# is now using arm64 hardware.
Expand Down Expand Up @@ -50,7 +52,10 @@ jobs:
- name: Run tests
run: python -m pytest tests
- name: Store tested requirements.txt file as artifact
uses: actions/upload-artifact@v3
# Only upload from a single matrix job: upload-artifact@v4 errors on
# duplicate artifact names, and the docker job only needs one copy.
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10'
uses: actions/upload-artifact@v4
with:
name: requirements.txt
path: |
Expand All @@ -74,7 +79,7 @@ jobs:
echo "APP_VERSION=$(/tmp/tomlq/bin/tomlq -r .project.version pyproject.toml)" >> $GITHUB_ENV
echo "APP_DESC=$(/tmp/tomlq/bin/tomlq -r .project.description pyproject.toml)" >> $GITHUB_ENV
- name: Retrieve tested requirements file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: requirements.txt
- name: Ensure docker build is working
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
requirements.txt
Dockerfile
- name: Store tested requirements.txt file as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: requirements.txt
path: |
Expand All @@ -54,7 +54,7 @@ jobs:
echo "APP_VERSION=$(/tmp/tomlq/bin/tomlq -r .project.version pyproject.toml)" >> $GITHUB_ENV
echo "APP_DESC=$(/tmp/tomlq/bin/tomlq -r .project.description pyproject.toml)" >> $GITHUB_ENV
- name: Retrieve tested requirements file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: requirements.txt
- name: Check file contents
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ Releases are triggered on commits tagged with `release-` (for example


## Changelog
* 0.10.3:
- Fixed the /bytes endpoint to return bytes (not bytearray) for WSGI compliance with newer Werkzeug, thanks @swt2c
- Dropped support for Python 3.7
- Build and publish arm64 Docker images
* 0.10.2:
- Added support for Flask 3.0
* 0.10.1:
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Repository = "https://github.com/psf/httpbin"

[project]
name = "httpbin"
version = "0.10.2"
version = "0.10.3"
requires-python = ">=3.8"
description = "HTTP Request and Response Service"
readme = "README.md"
Expand All @@ -28,6 +28,8 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"brotlicffi",
Expand Down
13 changes: 13 additions & 0 deletions tests/test_httpbin.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,19 @@ def test_stream_bytes_with_seed(self):
response.data, b'\xc5\xd7\x14\x84\xf8\xcf\x9b\xf4\xb7o'
)

def test_bytes_endpoint_yields_bytes(self):
"""WSGI bodies must be bytes (not bytearray) so strict servers
(wsgiref / pytest-httpbin) don't 500. The test client coerces the
body, so we inspect the raw WSGI iterable. Regression for /bytes."""
from werkzeug.test import create_environ
env = create_environ('/bytes/64', 'http://localhost/')
chunks = list(httpbin.app(env, lambda *a, **k: None))
self.assertTrue(chunks, "no body produced")
self.assertTrue(
all(type(c) is bytes for c in chunks),
[type(c).__name__ for c in chunks]
)

def test_delete_endpoint_returns_body(self):
response = self.app.delete(
'/delete',
Expand Down
Loading