Skip to content

Commit

Permalink
Merge branch 'master' into fail-fast-false
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Nov 20, 2024
2 parents 2b3c4d5 + bc412d2 commit ccb4258
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 24 deletions.
88 changes: 72 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,80 @@ on:
- '*'

jobs:
publish:
name: "Publish release"
runs-on: "ubuntu-latest"
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: scripts/install

- name: Build package & docs
run: scripts/build

- name: Upload package distributions
uses: actions/upload-artifact@v4
with:
name: package-distributions
path: dist/

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: documentation
path: site/

pypi-publish:
runs-on: ubuntu-latest
needs: build

permissions:
id-token: write

environment:
name: deploy
name: pypi
url: https://pypi.org/project/uvicorn

steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
python-version: "3.8"
- name: "Install dependencies"
run: "scripts/install"
- name: "Build package & docs"
run: "scripts/build"
- name: "Publish to PyPI & deploy docs"
run: "scripts/publish"
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
name: package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

docs-publish:
runs-on: ubuntu-latest
needs: build

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: documentation
path: site/

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: scripts/install

- name: Publish documentation 📚 to GitHub Pages
run: mkdocs gh-deploy --force
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 0.32.1 (2024-11-20)

### Fixed

* Drop ASGI spec version to 2.3 on HTTP scope [#2513](https://github.com/encode/uvicorn/pull/2513)
* Enable httptools lenient data on `httptools >= 0.6.3` [#2488](https://github.com/encode/uvicorn/pull/2488)

## 0.32.0 (2024-10-15)

### Added
Expand Down
4 changes: 2 additions & 2 deletions tests/protocols/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,8 @@ async def asgi(receive: ASGIReceiveCallable, send: ASGISendCallable):
@pytest.mark.parametrize(
"asgi2or3_app, expected_scopes",
[
(asgi3app, {"version": "3.0", "spec_version": "2.4"}),
(asgi2app, {"version": "2.0", "spec_version": "2.4"}),
(asgi3app, {"version": "3.0", "spec_version": "2.3"}),
(asgi2app, {"version": "2.0", "spec_version": "2.3"}),
],
)
async def test_scopes(
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from uvicorn.config import Config
from uvicorn.main import Server, main, run

__version__ = "0.32.0"
__version__ = "0.32.1"
__all__ = ["main", "run", "Config", "Server"]
5 changes: 1 addition & 4 deletions uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ def handle_events(self) -> None:
full_raw_path = self.root_path.encode("ascii") + raw_path
self.scope = {
"type": "http",
"asgi": {
"version": self.config.asgi_version,
"spec_version": "2.4",
},
"asgi": {"version": self.config.asgi_version, "spec_version": "2.3"},
"http_version": event.http_version.decode("ascii"),
"server": self.server,
"client": self.client,
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def on_message_begin(self) -> None:
self.headers = []
self.scope = { # type: ignore[typeddict-item]
"type": "http",
"asgi": {"version": self.config.asgi_version, "spec_version": "2.4"},
"asgi": {"version": self.config.asgi_version, "spec_version": "2.3"},
"http_version": "1.1",
"server": self.server,
"client": self.client,
Expand Down

0 comments on commit ccb4258

Please sign in to comment.