Skip to content

Commit

Permalink
Merge branch 'main' into docs-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobCoffee authored May 7, 2024
2 parents 1de897e + 39b048a commit 61ba319
Show file tree
Hide file tree
Showing 142 changed files with 3,197 additions and 1,491 deletions.
21 changes: 20 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@
"contributions": [
"doc",
"code",
"test"
"test",
"infra"
]
},
{
Expand Down Expand Up @@ -1706,6 +1707,24 @@
"contributions": [
"test"
]
},
{
"login": "maintain0404",
"name": "Taein Min",
"avatar_url": "https://avatars.githubusercontent.com/u/50428534?v=4",
"profile": "https://github.com/maintain0404",
"contributions": [
"doc"
]
},
{
"login": "wallseat",
"name": "Stanislav Lyu.",
"avatar_url": "https://avatars.githubusercontent.com/u/26143672?v=4",
"profile": "https://github.com/wallseat",
"contributions": [
"bug"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ FROM python:${VARIANT}
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get purge -y fish

RUN python3 -m pip install --upgrade setuptools cython pip poetry
RUN python3 -m pip install --upgrade setuptools cython pip pdm
36 changes: 16 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"name": "litestar-org/litestar",
"build": {
"dockerfile": "./Dockerfile",
"context": ".",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/devcontainers/features/python:1": "none",
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false",
},
"ppa": "false"
}
},
"customizations": {
"codespaces": {
"openFiles": ["CONTRIBUTING.rst"],
"openFiles": ["CONTRIBUTING.rst"]
},
"vscode": {
"extensions": [
Expand All @@ -31,7 +31,7 @@
"github.vscode-github-actions",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"charliermarsh.ruff",
"charliermarsh.ruff"
],
"settings": {
"python.editor.defaultFormatter": "charliermarsh.ruff",
Expand All @@ -45,26 +45,22 @@
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh",
"path": "zsh"
},
"fish": {
"path": "fish",
},
},
},
},
"path": "fish"
}
}
}
}
},
"forwardPorts": [8000],
"postCreateCommand": [
"poetry",
"install",
"--extras",
"full",
"--with",
"docs,lint",
"pdm",
"install"
],
"remoteUser": "vscode",
"remoteUser": "vscode"
}
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_lines_enabled: true
blank_issues_enabled: false
contact_links:
- name: Litestar Documentation
url: https://docs.litestar.dev/
Expand All @@ -7,5 +7,5 @@ contact_links:
url: https://litestar.dev/
about: Main Litestar website - for details about Litestar's projects.
- name: Discord
url: https://discord.gg/litestar-919193495116337154
url: https://discord.gg/litestar
about: Join our Discord community to chat or get in touch with the maintainers.
135 changes: 106 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,35 +152,6 @@ jobs:
- name: Test
run: pdm run pytest tests -m server_integration

upload-test-coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: coverage-data

- name: Combine coverage files
run: |
python -Im pip install coverage covdefaults
python -Im coverage combine
python -Im coverage xml -i
- name: Fix coverage file name
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
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

test-platform-compat:
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'test platform compat')
strategy:
Expand Down Expand Up @@ -275,3 +246,109 @@ jobs:
path: |
docs/_build/html
.pr_number
test_minimal_app:
name: Test Minimal Application with Base Dependencies
runs-on: ubuntu-latest
env:
python_version: "3.12"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

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

- 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

test_pydantic_1_app:
name: Test Minimal Pydantic 1 application
runs-on: ubuntu-latest
env:
python_version: "3.12"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
with:
python-version: "3.12"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m 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

- name: Rename coverage file
run: mv .coverage* .coverage.pydantic_v1

- uses: actions/upload-artifact@v3
with:
name: coverage-data
path: .coverage.pydantic_v1

upload-test-coverage:
runs-on: ubuntu-latest
needs:
- test
- test_pydantic_1_app
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: coverage-data

- name: Combine coverage files
run: |
python -Im pip install coverage covdefaults
python -Im coverage combine
python -Im coverage xml -i
- name: Fix coverage file name
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
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
65 changes: 0 additions & 65 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,6 @@ on:
workflow_dispatch:

jobs:
test_minimal_app:
name: Test Minimal Application with Base Dependencies
runs-on: ubuntu-latest
env:
python_version: "3.12"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

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

- 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

test_pydantic_1_app:
name: Test Minimal Pydantic 1 application
runs-on: ubuntu-latest
env:
python_version: "3.12"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- uses: pdm-project/setup-pdm@v4
name: Set up PDM
with:
python-version: "3.12"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: |
pdm install
pip install "pydantic==1.*"
- name: Set pythonpath
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

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

publish-release:
name: upload release to PyPI
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ repos:
- id: conventional-pre-commit
stages: [commit-msg]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-toml
- id: debug-statements
exclude: "litestar/middleware/exceptions/middleware.py"
exclude: "litestar/middleware/_internal/exceptions/middleware.py"
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021, 2022, 2023 Litestar Org.
Copyright (c) 2021, 2022, 2023, 2024 Litestar Org.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 61ba319

Please sign in to comment.