Skip to content

Commit

Permalink
Merge branch 'main' into add-test-for-paginated-return-dto
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin authored Jan 5, 2025
2 parents 3d2e572 + 75d3430 commit 35ef604
Show file tree
Hide file tree
Showing 400 changed files with 16,470 additions and 10,030 deletions.
102 changes: 100 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,9 @@
"avatar_url": "https://avatars.githubusercontent.com/u/57007485?v=4",
"profile": "https://github.com/floxay",
"contributions": [
"doc"
"doc",
"code",
"test"
]
},
{
Expand Down Expand Up @@ -1621,7 +1623,9 @@
"avatar_url": "https://avatars.githubusercontent.com/u/75439739?v=4",
"profile": "https://github.com/aranvir",
"contributions": [
"doc"
"doc",
"code",
"test"
]
},
{
Expand Down Expand Up @@ -1838,6 +1842,100 @@
"test",
"doc"
]
},
{
"login": "trim21",
"name": "Trim21",
"avatar_url": "https://avatars.githubusercontent.com/u/13553903?v=4",
"profile": "https://blog.trim21.me/",
"contributions": [
"code",
"test"
]
},
{
"login": "aarcex3",
"name": "Agustin Arce",
"avatar_url": "https://avatars.githubusercontent.com/u/59893355?v=4",
"profile": "http://aarcex3.github.io",
"contributions": [
"doc"
]
},
{
"login": "FarhanAliRaza",
"name": "Farhan Ali Raza",
"avatar_url": "https://avatars.githubusercontent.com/u/62690310?v=4",
"profile": "https://github.com/FarhanAliRaza",
"contributions": [
"doc"
]
},
{
"login": "pogopaule",
"name": "Fabian",
"avatar_url": "https://avatars.githubusercontent.com/u/576949?v=4",
"profile": "https://github.com/pogopaule",
"contributions": [
"code"
]
},
{
"login": "mohammedbabelly20",
"name": "Mohammed Babelly",
"avatar_url": "https://avatars.githubusercontent.com/u/104768048?v=4",
"profile": "https://github.com/mohammedbabelly20",
"contributions": [
"code"
]
},
{
"login": "charles-dyfis-net",
"name": "Charles Duffy",
"avatar_url": "https://avatars.githubusercontent.com/u/22370?v=4",
"profile": "https://keybase.io/charlesdyfisnet",
"contributions": [
"code"
]
},
{
"login": "RenameMe1",
"name": "Evgeny Demchenko",
"avatar_url": "https://avatars.githubusercontent.com/u/165988121?v=4",
"profile": "https://github.com/RenameMe1",
"contributions": [
"doc"
]
},
{
"login": "olzhasar",
"name": "Olzhas Arystanov",
"avatar_url": "https://avatars.githubusercontent.com/u/12471703?v=4",
"profile": "https://olzhasar.com",
"contributions": [
"bug",
"doc"
]
},
{
"login": "vikigenius",
"name": "Vikash",
"avatar_url": "https://avatars.githubusercontent.com/u/12724810?v=4",
"profile": "https://github.com/vikigenius",
"contributions": [
"code"
]
},
{
"login": "ftsartek",
"name": "Jordan Russell",
"avatar_url": "https://avatars.githubusercontent.com/u/20253317?v=4",
"profile": "https://github.com/ftsartek",
"contributions": [
"doc",
"test",
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
13 changes: 9 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): 3, 3.11, 3.10, 3.9, 3.8, 3-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm, 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster
ARG VARIANT=3-bookworm
FROM python:${VARIANT}
# [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): 3, 3.13, 3.12, 3.11, 3.10, 3.9, 3.8, 3-bookworm, 3.13-bookworm, 3.12-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm, 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster
ARG VERSION=3.12
ARG VARIANT=-bookworm
FROM python:${VERSION}${VARIANT}

ARG VERSION
ENV UV_LOCKED=1 UV_PYTHON=${VERSION}
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get purge -y fish

RUN python3 -m pip install --upgrade setuptools cython pip pdm
RUN python3 -m pip install --upgrade setuptools cython pip
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
},
"forwardPorts": [8000],
"postCreateCommand": [
"pdm",
"install"
"uv",
"sync"
],
"remoteUser": "vscode"
}
126 changes: 48 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- main
- v1.51

env:
UV_LOCKED: 1

jobs:
validate:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -41,20 +44,14 @@ jobs:
python-version: "3.8"
allow-prereleases: true

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.8"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install -G:all
version: "0.5.4"
enable-cache: true

- name: Run mypy
run: pdm run mypy
run: uv run mypy

pyright:
runs-on: ubuntu-latest
Expand All @@ -66,20 +63,14 @@ jobs:
python-version: "3.8"
allow-prereleases: true

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.8"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install -G:all
version: "0.5.4"
enable-cache: true

- name: Run pyright
run: pdm run pyright
run: uv run pyright

slotscheck:
runs-on: ubuntu-latest
Expand All @@ -91,20 +82,14 @@ jobs:
python-version: "3.8"
allow-prereleases: false

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.8"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install -G:all
version: "0.5.4"
enable-cache: true

- name: Run slotscheck
run: pdm run slotscheck litestar
run: uv run slotscheck litestar

test:
name: "test (${{ matrix.python-version }})"
Expand Down Expand Up @@ -132,25 +117,22 @@ jobs:
with:
python-version: 3.11

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.11
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
version: "0.5.4"
enable-cache: true

- name: Install dependencies
run: |
pdm install -G:all
pip install -U "${{ matrix.uvicorn-version }}"
uv sync
uv pip install -U "${{ matrix.uvicorn-version }}"
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Test
run: pdm run pytest tests -m server_integration
run: uv run --no-sync pytest tests -m server_integration

test-platform-compat:
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'test platform compat')
Expand Down Expand Up @@ -214,25 +196,19 @@ jobs:
python-version: "3.12"
allow-prereleases: true

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install -G:all
version: "0.5.4"
enable-cache: true

- name: Build docs
run: pdm run make docs
run: uv run make docs

- name: Check docs links
env:
LITESTAR_DOCS_IGNORE_MISSING_EXAMPLE_OUTPUT: 1
run: pdm run make docs-linkcheck
run: uv run make docs-linkcheck

- name: Save PR number
run: |
Expand All @@ -245,6 +221,7 @@ jobs:
path: |
docs/_build/html
.pr_number
include-hidden-files: true

test_minimal_app:
name: Test Minimal Application with Base Dependencies
Expand All @@ -260,23 +237,19 @@ jobs:
with:
python-version: "3.12"

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install
version: "0.5.4"
enable-cache: true

- name: Set pythonpath
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Test
run: mv tests/examples/test_hello_world.py test_hello_world.py && pdm run pytest test_hello_world.py
run: |
mv tests/examples/test_hello_world.py test_hello_world.py
uv run pytest test_hello_world.py
test_pydantic_1_app:
name: Test Minimal Pydantic 1 application
Expand All @@ -292,26 +265,22 @@ jobs:
with:
python-version: "3.12"

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
version: "0.5.4"
enable-cache: true

- name: Install dependencies
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m pip install "pydantic==1.*"
uv sync
uv pip install "pydantic==1.*"
- name: Set pythonpath
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Test
run: pdm run coverage run --branch -m unittest test_apps/pydantic_1_app.py
run: uv run --no-sync coverage run --branch -m unittest test_apps/pydantic_1_app.py

- name: Rename coverage file
run: mv .coverage* .coverage.pydantic_v1
Expand All @@ -320,6 +289,7 @@ jobs:
with:
name: coverage-data
path: .coverage.pydantic_v1
include-hidden-files: true

upload-test-coverage:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -347,7 +317,7 @@ jobs:
run: sed -i "s/home\/runner\/work\/litestar\/litestar/github\/workspace/g" coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 35ef604

Please sign in to comment.