Skip to content

Commit

Permalink
Merge branch 'main' into feat/events/context-propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut authored Dec 3, 2023
2 parents 2e7e491 + 7979771 commit f70f4ea
Show file tree
Hide file tree
Showing 121 changed files with 2,731 additions and 812 deletions.
37 changes: 37 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,43 @@
"contributions": [
"doc"
]
},
{
"login": "cesarmg1980",
"name": "Cesar Giulietti",
"avatar_url": "https://avatars.githubusercontent.com/u/38872121?v=4",
"profile": "https://github.com/cesarmg1980",
"contributions": [
"doc"
]
},
{
"login": "marcuslimdw",
"name": "Marcus Lim",
"avatar_url": "https://avatars.githubusercontent.com/u/42759889?v=4",
"profile": "https://gitlab.com/marcuslimdw/",
"contributions": [
"doc"
]
},
{
"login": "hzhou0",
"name": "Henry Zhou",
"avatar_url": "https://avatars.githubusercontent.com/u/43188301?v=4",
"profile": "https://github.com/hzhou0",
"contributions": [
"bug",
"code"
]
},
{
"login": "WilliamStam",
"name": "William Stam",
"avatar_url": "https://avatars.githubusercontent.com/u/182800?v=4",
"profile": "https://github.com/WilliamStam",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pr-target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Validate PR target"

on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- main

permissions:
pull-requests: read

jobs:
main:
name: Validate PR target branch
runs-on: ubuntu-latest
steps:
- name: Check PR target
if: ${{ startsWith(github.event.pull_request.title, 'feat') }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Cannot merge feature type PR into main. Merge into a feature branch or develop')
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Test
run: python -m unittest test_apps/pydantic_1_app.py
run: pdm run python -m unittest test_apps/pydantic_1_app.py

publish-release:
name: upload release to PyPI
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ __pypackages__/

# test certificates
certs/
pdm.toml
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: "3.8"
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.4.0
rev: v3.0.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Expand All @@ -23,7 +23,7 @@ repos:
- id: unasyncd
additional_dependencies: ["ruff"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.5"
rev: "v0.1.6"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -40,12 +40,12 @@ repos:
hooks:
- id: blacken-docs
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
rev: "v3.1.0"
hooks:
- id: prettier
exclude: "_templates|.git|.all-contributorsrc"
- repo: https://github.com/python-formate/flake8-dunder-all
rev: v0.3.0
rev: v0.3.1
hooks:
- id: ensure-dunder-all
exclude: "test*|examples*|tools"
Expand All @@ -56,7 +56,7 @@ repos:
- id: slotscheck
exclude: "test_*|docs"
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: "v0.8.1"
rev: "v0.9.0"
hooks:
- id: sphinx-lint
- repo: local
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enforce type safety. You can run them with:

- ``make mypy``
- ``make pyright``
- ``make typecheck`` to run both
- ``make type-check`` to run both
- ``make lint`` to run pre-commit hooks and type checkers.

Our type checkers are run on Python 3.8 in CI, so you should make sure to run them on the same version locally as well.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ install: clean ## Install the project, dependencies, and pre-commit for
@if [ "$(VENV_EXISTS)" ]; then echo "=> Removing existing virtual environment"; fi
if [ "$(VENV_EXISTS)" ]; then $(MAKE) destroy; fi
if [ "$(VENV_EXISTS)" ]; then $(MAKE) clean; fi
@if [ "$(USING_PDM)" ]; then $(PDM) config venv.in_project true && python3 -m venv --copies .venv && . $(ENV_PREFIX)/activate && $(ENV_PREFIX)/pip install --quiet -U wheel setuptools cython mypy pip; fi
@if [ "$(USING_PDM)" ]; then $(PDM) config --local venv.in_project true && python3 -m venv --copies .venv && . $(ENV_PREFIX)/activate && $(ENV_PREFIX)/pip install --quiet -U wheel setuptools cython mypy pip; fi
@if [ "$(USING_PDM)" ]; then $(PDM) install -dG:all; fi
@echo "=> Install complete! Note: If you want to re-install re-run 'make install'"

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,12 @@ see [the contribution guide](CONTRIBUTING.rst).
<td align="center" valign="top" width="14.28%"><a href="https://github.com/baoliay2008"><img src="https://avatars.githubusercontent.com/u/13620348?v=4?s=100" width="100px;" alt="L. Bao"/><br /><sub><b>L. Bao</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=baoliay2008" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://jarredglaser.com"><img src="https://avatars.githubusercontent.com/u/32422167?v=4?s=100" width="100px;" alt="Jarred Glaser"/><br /><sub><b>Jarred Glaser</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=jdglaser" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hunterjsb"><img src="https://avatars.githubusercontent.com/u/69213737?v=4?s=100" width="100px;" alt="Hunter Boyd"/><br /><sub><b>Hunter Boyd</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=hunterjsb" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cesarmg1980"><img src="https://avatars.githubusercontent.com/u/38872121?v=4?s=100" width="100px;" alt="Cesar Giulietti"/><br /><sub><b>Cesar Giulietti</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=cesarmg1980" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/marcuslimdw/"><img src="https://avatars.githubusercontent.com/u/42759889?v=4?s=100" width="100px;" alt="Marcus Lim"/><br /><sub><b>Marcus Lim</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=marcuslimdw" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hzhou0"><img src="https://avatars.githubusercontent.com/u/43188301?v=4?s=100" width="100px;" alt="Henry Zhou"/><br /><sub><b>Henry Zhou</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/issues?q=author%3Ahzhou0" title="Bug reports">🐛</a> <a href="https://github.com/litestar-org/litestar/commits?author=hzhou0" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/WilliamStam"><img src="https://avatars.githubusercontent.com/u/182800?v=4?s=100" width="100px;" alt="William Stam"/><br /><sub><b>William Stam</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=WilliamStam" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
from litestar import Litestar, get, post
from litestar.contrib.sqlalchemy.base import UUIDAuditBase
from litestar.contrib.sqlalchemy.plugins import AsyncSessionConfig, SQLAlchemyAsyncConfig, SQLAlchemyInitPlugin
from litestar.contrib.sqlalchemy.repository import (
ModelT,
SQLAlchemyAsyncRepository,
)
from litestar.contrib.sqlalchemy.repository import ModelT, SQLAlchemyAsyncRepository
from litestar.di import Provide

if TYPE_CHECKING:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from litestar import Litestar, Request, Response, get, post
from litestar.connection import ASGIConnection
from litestar.contrib.jwt import JWTAuth, Token
from litestar.openapi.config import OpenAPIConfig
from litestar.security.jwt import JWTAuth, Token


# Let's assume we have a User model that is a pydantic model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from litestar import Litestar, Request, Response, get, post
from litestar.connection import ASGIConnection
from litestar.contrib.jwt import JWTCookieAuth, Token
from litestar.openapi.config import OpenAPIConfig
from litestar.security.jwt import JWTCookieAuth, Token


# Let's assume we have a User model that is a pydantic model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from litestar import Litestar, Request, Response, get, post
from litestar.connection import ASGIConnection
from litestar.contrib.jwt import OAuth2Login, OAuth2PasswordBearerAuth, Token
from litestar.openapi.config import OpenAPIConfig
from litestar.security.jwt import OAuth2Login, OAuth2PasswordBearerAuth, Token


# Let's assume we have a User model that is a pydantic model.
Expand Down
5 changes: 1 addition & 4 deletions docs/examples/security/using_session_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
from litestar import Litestar, Request, get, post
from litestar.connection import ASGIConnection
from litestar.exceptions import NotAuthorizedException
from litestar.middleware.session.server_side import (
ServerSideSessionBackend,
ServerSideSessionConfig,
)
from litestar.middleware.session.server_side import ServerSideSessionBackend, ServerSideSessionConfig
from litestar.openapi.config import OpenAPIConfig
from litestar.security.session_auth import SessionAuth
from litestar.stores.memory import MemoryStore
Expand Down
10 changes: 6 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ and
* ``http://localhost:8000/schema`` (for `ReDoc <https://redocly.com/redoc>`_),
* ``http://localhost:8000/schema/swagger`` (for `Swagger UI <https://swagger.io/>`_),
* ``http://localhost:8000/schema/elements`` (for `Stoplight Elements <https://stoplight.io/open-source/elements/>`_)
* ``http://localhost:8000/schema/rapidoc`` (for `RapiDoc <https://rapidocweb.com/>`_)

You can check out a more in-depth tutorial in the :doc:`/tutorials/todo-app/index` section!

Expand Down Expand Up @@ -287,12 +288,13 @@ Example Applications
--------------------


* `litestar-pg-redis-docker <https://github.com/litestar-org/starlite-pg-redis-docker>`_ : In addition to Litestar, this
* `litestar-pg-redis-docker <https://github.com/litestar-org/litestar-pg-redis-docker>`_ : In addition to Litestar, this
demonstrates a pattern of application modularity, SQLAlchemy 2.0 ORM, Redis cache connectivity, and more. Like all
Litestar projects, this application is open to contributions, big and small.
* `litestar-fullstack <https://github.com/litestar-org/litestar-fullstack>`_ : A reference application that features a
Litestar app configured with best practices, SQLAlchemy 2.0 and SAQ, a frontend integrated with Vitejs and Jinja2
templates. Docker, and more.
* `litestar-fullstack <https://github.com/litestar-org/litestar-fullstack>`_ : A fully-capable, production-ready fullstack
Litestar web application configured with best practices. It includes SQLAlchemy 2.0, VueJS, `Vite <https://vitejs.dev/>`_,
:doc:`SAQ job queue <https://saq-py.readthedocs.io/en/latest/>`_, ``Jinja`` templates and more.
`Read more <https://litestar-org.github.io/litestar-fullstack/latest/>`_.
* `litestar-hello-world <https://github.com/litestar-org/litestar-hello-world>`_: A bare-minimum application setup.
Great for testing and POC work.

Expand Down
3 changes: 1 addition & 2 deletions docs/reference/contrib/jwt.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
jwt
===

.. automodule:: litestar.contrib.jwt
:members:
This page has moved to :doc:`/reference/security/jwt`
1 change: 1 addition & 0 deletions docs/reference/security/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ security
.. toctree::
:maxdepth: 1

jwt
session_auth
2 changes: 2 additions & 0 deletions docs/reference/security/jwt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. automodule:: litestar.security.jwt
:members:
Loading

0 comments on commit f70f4ea

Please sign in to comment.