Skip to content

Commit

Permalink
Merge branch 'master' into issue-encode#806
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanidutt87 authored Feb 19, 2024
2 parents bf1e78e + 1e5f1be commit 4abc589
Show file tree
Hide file tree
Showing 71 changed files with 3,388 additions and 1,540 deletions.
16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE/1-issue.md

This file was deleted.

68 changes: 68 additions & 0 deletions .github/ISSUE_TEMPLATE/1-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Issue
description: Report a bug or unexpected behavior. 🙏

body:
- type: markdown
attributes:
value: Thank you for contributing to Uvicorn! ✊

- type: checkboxes
id: checks
attributes:
label: Initial Checks
description: Just making sure you open a discussion first. 🙏
options:
- label: I confirm this was discussed, and the maintainers suggest I open an issue.
required: true
- label: I'm aware that if I created this issue without a discussion, it may be closed without a response.
required: true

- type: textarea
id: discussion
attributes:
label: Discussion Link
description: |
Please link to the discussion that led to this issue.
If you haven't discussed this issue yet, please do so before opening an issue.
render: Text
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Please explain what you're seeing and what you would expect to see.
Please provide as much detail as possible to make understanding and solving your problem as quick as possible. 🙏
validations:
required: true

- type: textarea
id: example
attributes:
label: Example Code
description: >
If applicable, please add a self-contained,
[minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example)
demonstrating the bug.
render: Python

- type: textarea
id: version
attributes:
label: Python, Uvicorn & OS Version
description: |
Which version of Python & Uvicorn are you using, and which Operating System?
Please run the following command and copy the output below:
```bash
python -m uvicorn --version
```
render: Text
validations:
required: true
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Thanks for contributing to Uvicorn! 💚
Given this is a project maintained by volunteers, please read this template to not waste your time, or ours! 😁 -->

# Summary

<!-- Write a small summary about what is happening here. -->

# Checklist

- [ ] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [ ] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [ ] I've updated the documentation accordingly.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ updates:
directory: "/"
schedule:
interval: "monthly"
groups:
python-packages:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
name: deploy

steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: 3.7
python-version: "3.8"
- name: "Install dependencies"
run: "scripts/install"
- name: "Build package & docs"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
Expand Down
141 changes: 140 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,144 @@
# Change Log

## 0.27.1 - 2024-02-10

- Fix spurious LocalProtocolError errors when processing pipelined requests (#2243) 10/02/24

## 0.27.0.post1 - 2024-01-29

### Fixed

- Fix nav overrides for newer version of Mkdocs Material (#2233) 26/01/24

## 0.27.0 - 2024-01-22

### Added

- Raise `ClientDisconnect(IOError)` on `send()` when client disconnected (#2218) 19/01/24
- Bump ASGI WebSocket spec version to 2.4 (#2221) 20/01/24

## 0.26.0 - 2024-01-16

### Changed

- Update `--root-path` to include the root path prefix in the full ASGI `path` as per the ASGI spec (#2213) 16/01/24
- Use `__future__.annotations` on some internal modules (#2199) 16/01/24

## 0.25.0 - 2023-12-17

### Added

- Support the WebSocket Denial Response ASGI extension (#1916) 17/12/23

### Fixed

- Allow explicit hidden file paths on `--reload-include` (#2176) 08/12/23
- Properly annotate `uvicorn.run()` (#2158) 22/11/23

## 0.24.0.post1 - 2023-11-06

### Fixed

- Revert mkdocs-material from 9.1.21 to 9.2.6 (#2148) 05/11/23

## 0.24.0 - 2023-11-04

### Added

- Support Python 3.12 (#2145) 04/11/23
- Allow setting `app` via environment variable `UVICORN_APP` (#2106) 21/09/23

## 0.23.2 - 2023-07-31

### Fixed

- Maintain the same behavior of `websockets` from 10.4 on 11.0 (#2061) 30/07/23

## 0.23.1 - 2023-07-18

### Fixed

- Add `typing_extensions` for Python 3.10 and lower (#2053) 18/07/23

## 0.23.0 - 2023-07-10

### Added

- Add `--ws-max-queue` parameter WebSockets (#2033) 10/07/23

### Removed

- Drop support for Python 3.7 (#1996) 19/06/23
- Remove `asgiref` as typing dependency (#1999) 08/06/23

### Fixed

- Set `scope["scheme"]` to `ws` or `wss` instead of `http` or `https` on `ProxyHeadersMiddleware` for WebSockets (#2043) 12/07/23

### Changed

- Raise `ImportError` on circular import (#2040) 09/07/23
- Use `logger.getEffectiveLevel()` instead of `logger.level` to check if log level is `TRACE` (#1966) 01/06/23

## 0.22.0 - 2023-04-28

### Added

- Add `--timeout-graceful-shutdown` parameter (#1950) 26/04/23
- Handle `SIGBREAK` on Windows (#1909) 15/04/23

### Fixed

- Shutdown event is now being triggered on Windows when using hot reload (#1584) 13/04/23
- `--reload-delay` is effectively used on the `watchfiles` reloader (#1930) 22/04/23

## 0.21.1 - 2023-03-16

### Fixed

- Reset lifespan state on each request (#1903) 16/03/23

## 0.21.0 - 2023-03-09

### Added

- Introduce lifespan state (#1818) 05/03/23
- Allow headers to be sent as iterables on H11 implementation (#1782) 27/11/22
- Improve discoverability when --port=0 is used (#1890) 09/03/23

### Changed

- Avoid importing `h11` and `pyyaml` when not needed to improve import time (#1846) 07/02/23
- Replace current native `WSGIMiddleware` implementation by `a2wsgi` (#1825) 16/01/23
- Change default `--app-dir` from "." (dot) to "" (empty string) (#1835) 06/01/23

### Fixed

- Send code 1012 on shutdown for WebSockets (#1816) 06/01/23
- Use `surrogateescape` to encode headers on `websockets` implementation (#1005) 12/12/22
- Fix warning message on reload failure (#1784) 29/11/22

## 0.20.0 - 2022-11-20

### Added

- Check if handshake is completed before sending frame on `wsproto` shutdown (#1737)
- Add default headers to WebSockets implementations (#1606 & #1747) 28/10/22
- Warn user when `reload` and `workers` flag are used together (#1731) 31/10/22

### Fixed

- Use correct `WebSocket` error codes on `close` (#1753) 20/11/22
- Send disconnect event on connection lost for `wsproto` (#996) 29/10/22
- Add `SIGQUIT` handler to `UvicornWorker` (#1710) 01/11/22
- Fix crash on exist with "--uds" if socket doesn't exist (#1725) 27/10/22
- Annotate `CONFIG_KWARGS` in `UvicornWorker` class (#1746) 31/10/22

### Removed

- Remove conditional on `RemoteProtocolError.event_hint` on `wsproto` (#1486) 31/10/22
- Remove unused `handle_no_connect` on `wsproto` implementation (#1759) 17/11/22

## 0.19.0 - 2022-10-19

### Added
Expand All @@ -14,7 +153,7 @@
- Set `propagate` to `False` on "uvicorn" logger (#1288) 08/10/22
- USR1 signal is now handled correctly on `UvicornWorker`. (#1565) 26/08/22
- Use path with query string on `WebSockets` logs (#1385) 11/09/22
- Fix behavior on which "Date" headers were not updated on the same connection (#1706) 19/10/22
- Fix behavior on which "Date" headers were not updated on the same connection (#1706) 19/10/22

### Removed

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

[![Build Status](https://github.com/encode/uvicorn/workflows/Test%20Suite/badge.svg)](https://github.com/encode/uvicorn/actions)
[![Package version](https://badge.fury.io/py/uvicorn.svg)](https://pypi.python.org/pypi/uvicorn)
[![Supported Python Version](https://img.shields.io/pypi/pyversions/uvicorn.svg?color=%2334D058)](https://pypi.org/project/uvicorn)

**Documentation**: [https://www.uvicorn.org](https://www.uvicorn.org)

**Requirements**: Python 3.7+ (For Python 3.6 support, install version 0.16.0.)
---

Uvicorn is an ASGI web server implementation for Python.

Expand All @@ -34,7 +35,7 @@ $ pip install uvicorn
This will install uvicorn with minimal (pure Python) dependencies.

```shell
$ pip install uvicorn[standard]
$ pip install 'uvicorn[standard]'
```

This will install uvicorn with "Cython-based" dependencies (where possible) and other "optional extras".
Expand All @@ -52,17 +53,17 @@ Moreover, "optional extras" means that:
- `python-dotenv` will be installed should you want to use the `--env-file` option.
- `PyYAML` will be installed to allow you to provide a `.yaml` file to `--log-config`, if desired.

Create an application:
Create an application, in `example.py`:

```py title="main.py"
```python
async def app(scope, receive, send):
assert scope['type'] == 'http'

await send({
'type': 'http.response.start',
'status': 200,
'headers': [
[b'content-type', b'text/plain'],
(b'content-type', b'text/plain'),
],
})
await send({
Expand All @@ -74,7 +75,7 @@ async def app(scope, receive, send):
Run the server:

```shell
$ uvicorn main:app
$ uvicorn example:app
```

---
Expand Down Expand Up @@ -136,6 +137,6 @@ $ hypercorn app:App

[asgi]: https://asgi.readthedocs.io/en/latest/
[daphne]: https://github.com/django/daphne
[hypercorn]: https://gitlab.com/pgjones/hypercorn
[hypercorn]: https://github.com/pgjones/hypercorn
[mangum]: https://mangum.io
[trio]: https://trio.readthedocs.io
Loading

0 comments on commit 4abc589

Please sign in to comment.