Skip to content
Closed
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
42 changes: 21 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
Expand All @@ -37,16 +37,16 @@ jobs:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v7
- name: Cache Rust build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand All @@ -67,12 +67,12 @@ jobs:
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')))
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
- name: Cache Rust build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
# - runner: ubuntu-22.04
# target: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
Expand All @@ -178,7 +178,7 @@ jobs:
sccache: true
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
# - runner: ubuntu-22.04
# target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
Expand All @@ -233,7 +233,7 @@ jobs:
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
Expand Down Expand Up @@ -263,8 +263,8 @@ jobs:
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: ${{ matrix.platform.target }}
Expand All @@ -288,7 +288,7 @@ jobs:
args: --release --out dist -i python3.14t
sccache: true
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
Expand All @@ -338,7 +338,7 @@ jobs:
args: --release --out dist -i python3.14t
sccache: true
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
Expand All @@ -355,7 +355,7 @@ jobs:
needs: [test, e2e]
if: ${{ always() && (startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch') && (needs.test.result == 'success' || needs.test.result == 'skipped') && (needs.e2e.result == 'success' || needs.e2e.result == 'skipped') }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
Expand All @@ -369,7 +369,7 @@ jobs:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheels-sdist
path: dist
Expand All @@ -389,9 +389,9 @@ jobs:
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
uses: actions/attest-build-provenance@v3
with:
subject-path: "wheels-*/*"
- name: Publish to PyPI
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"

- name: Cache Rust build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v5

- name: Cache Rust build artifacts
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
Expand All @@ -46,12 +46,12 @@ jobs:
components: rustfmt, clippy

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Configure Git Credentials
Expand All @@ -22,7 +22,7 @@ jobs:
python-version: "3.12"
enable-cache: false
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crate-type = ["cdylib"]
[dependencies]
pyo3 = { version = "0.29.0", features = [
"extension-module",
"abi3-py39",
"abi3-py310",
"indexmap",
"anyhow",
"generate-import-lib",
Expand Down
6 changes: 3 additions & 3 deletions benchmark/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# /// script
# requires-python = ">=3.9"
# requires-python = ">=3.10"
# dependencies = [
# "aiohttp",
# "curl_cffi",
Expand All @@ -16,14 +16,14 @@
The httpr dependency resolves from the local working tree when invoked through
`maturin develop`; CI installs the freshly-built wheel via `--with`.
"""

import argparse
import asyncio
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from importlib.metadata import version
from io import BytesIO
from typing import Optional

import aiohttp
import curl_cffi.requests
Expand Down Expand Up @@ -89,7 +89,7 @@ def aiohttp_session_factory():
]

# Optional override for httpr version (set via --httpr-version CLI arg)
_httpr_version_override: Optional[str] = None
_httpr_version_override: str | None = None


def add_package_version(packages):
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark_cbor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# /// script
# requires-python = ">=3.9"
# requires-python = ">=3.10"
# dependencies = ["httpr"]
# ///
"""CBOR vs JSON benchmark for httpr.
Expand Down
3 changes: 2 additions & 1 deletion benchmark/server.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# /// script
# requires-python = ">=3.9"
# requires-python = ">=3.10"
# dependencies = [
# "cbor2",
# "starlette",
# "uvicorn",
# ]
# ///
"""Benchmark target server. Run with: uv run --script benchmark/server.py"""

import base64
import gzip
import json
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ build-backend = "maturin"
name = "httpr"
description = "Fast HTTP client for Python"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = [ "python", "request",]
classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules",]
classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "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", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules",]
# Version is set dynamically by CI from git tags (e.g., v1.2.3 -> 1.2.3).
# Do not edit manually. See .github/actions/set-version/ for details.
version = "0.0.0.dev0"
Expand All @@ -20,7 +20,7 @@ name = "thomasht86"
text = "MIT License"

[project.optional-dependencies]
dev = [ "certifi", "pytest>=8.1.1; python_version < '3.10'", "pytest>=9.0.3; python_version >= '3.10'", "pytest-asyncio>=0.25.3", "pytest-benchmark>=5.1.0", "pytest-httpbin>=2.1.0", "typing_extensions; python_version <= '3.11'", "mypy>=1.14.1", "ruff>=0.9.2", "maturin", "trustme", "cbor2<6", "go-task-bin", "pre-commit",]
dev = [ "certifi", "pytest>=9.0.3", "pytest-asyncio>=0.25.3", "pytest-benchmark>=5.1.0", "pytest-httpbin>=2.1.0", "typing_extensions; python_version <= '3.11'", "mypy>=1.14.1", "ruff>=0.9.2", "maturin", "trustme", "cbor2<6", "go-task-bin", "pre-commit",]
docs = [ "mkdocs-material", "mkdocstrings[python]>=0.27.0", "mkdocs-gen-files", "mkdocs-literate-nav", "mkdocs-llmstxt",]
# Benchmark scripts use PEP 723 inline metadata — see `benchmark/*.py`.
# Run them with `uv run --script benchmark/<file>.py` so their dependencies
Expand Down Expand Up @@ -59,7 +59,7 @@ select = [ "E", "F", "UP", "B", "SIM", "I",]
]

[tool.mypy]
python_version = "3.9"
python_version = "3.10"
exclude = [ "benchmark/",]

[[tool.mypy.overrides]]
Expand Down
Loading
Loading