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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 30
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 30
43 changes: 0 additions & 43 deletions .github/workflows/ci.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CodSpeed

on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- '**/*.md'

permissions:
contents: read
id-token: write # required for OIDC authentication with CodSpeed

jobs:
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
version: "latest"
- name: Install dependencies
run: uv sync --all-extras
- name: Run the benchmarks
uses: CodSpeedHQ/action@4296e51e7041e24dadb86d1d6e8b9320d223dbe8 # v5.0.3
with:
mode: simulation
run: uv run pytest tests/ --codspeed
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Release

on:
push:
tags:
- v*

permissions:
contents: read

env:
CIBW_BUILD_VERBOSITY: 1

jobs:
compiled-wheels:
name: Compiled wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, windows-latest]
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: false
version: "latest"

- name: Set version from tag
shell: bash
run: |
set -euo pipefail
python - <<'PY'
import os, pathlib, re
version = os.environ["GITHUB_REF_NAME"].removeprefix("v")
path = pathlib.Path("h11_mypyc/_version.py")
path.write_text(
re.sub(r"^__version__ = .*$", f'__version__ = "{version}"', path.read_text(), flags=re.M)
)
print("building h11_mypyc", version)
PY

- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl

sdist-and-pure-wheel:
name: sdist and pure-Python wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: false
version: "latest"
python-version: "3.12"

- name: Set version from tag
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
sed -i "s/^__version__ = .*/__version__ = \"${version}\"/" h11_mypyc/_version.py
echo "Building h11_mypyc ${version}"

- name: Build
run: |
set -euxo pipefail
uv build
ls -l dist
# A platform-tagged wheel here would mean H11_MYPYC leaked in and the
# fallback is gone, leaving PyPy with nothing to install.
ls dist/*-py3-none-any.whl

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: sdist-and-pure-wheel
path: dist/*

publish:
name: Publish to PyPI
needs: [compiled-wheels, sdist-and-pure-wheel]
runs-on: ubuntu-latest
environment:
name: release
permissions:
contents: read
id-token: write # trusted publishing to PyPI
steps:
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: false
version: "latest"
python-version: "3.12"

- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: dist
merge-multiple: true

- name: Show what is being published
run: ls -l dist

- name: Publish
run: uv publish --trusted-publishing always dist/*
45 changes: 45 additions & 0 deletions .github/workflows/release_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release docs

on:
push:
branches: ["master"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
python-version: "3.12"
version: "latest"

- name: Install dependencies
run: uv sync --group docs --frozen

- name: Build site
run: uv run --no-sync zensical build --strict

- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site

- uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
id: deployment
93 changes: 93 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Tests

on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- '**/*.md'
workflow_dispatch: # for CodeSpeed

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
version: "latest"
python-version: "3.12"
- name: Install dependencies
run: uv sync --group lint
- name: Run ruff
run: uv run ruff check h11_mypyc tests
- name: Run zizmor
run: uv run zizmor .github

type-check:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
version: "latest"
python-version: "3.12"
- name: Install dependencies
run: uv sync --group build
- name: Run type checkers
run: uv run mypy h11_mypyc

python-tests:
name: Python tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
cache-suffix: ${{ matrix.python-version }}
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Run tests
run: uv run --group test pytest

mypyc-tests:
name: Tests against the compiled build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
version: "latest"
python-version: "3.12"
- name: Install dependencies
run: uv sync --group build --group test
- name: Compile with mypyc
run: uv run env H11_MYPYC=1 python setup.py build_ext --inplace
- name: Run tests against the compiled build
run: uv run pytest tests -q
13 changes: 3 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Project-specific generated files
docs/source/_static/CLIENT.dot
docs/source/_static/CLIENT.svg
docs/source/_static/SERVER.dot
docs/source/_static/SERVER.svg
docs/source/_static/special-states.dot
docs/source/_static/special-states.svg
docs/build/
/site/
.zensical/

bench/results/
bench/env/
Expand Down Expand Up @@ -63,6 +58,4 @@ coverage.xml
# Django stuff:
*.log
*.pot

# Sphinx documentation
doc/_build/
wheelhouse/
Loading