Skip to content

Commit

Permalink
Merge branch 'v3.0' into 3023-fix-cookie-string-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobCoffee committed Mar 27, 2024
2 parents c82a6ad + 817f518 commit 649dce6
Show file tree
Hide file tree
Showing 261 changed files with 6,848 additions and 2,374 deletions.
78 changes: 77 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,9 @@
"avatar_url": "https://avatars.githubusercontent.com/u/35638715?v=4",
"profile": "https://github.com/kedod",
"contributions": [
"doc"
"doc",
"code",
"test"
]
},
{
Expand Down Expand Up @@ -1593,6 +1595,80 @@
"contributions": [
"code"
]
},
{
"login": "JeanArhancet",
"name": "Jean Arhancet",
"avatar_url": "https://avatars.githubusercontent.com/u/10811879?v=4",
"profile": "https://github.com/JeanArhancet",
"contributions": [
"bug"
]
},
{
"login": "betaprior",
"name": "Leo Alekseyev",
"avatar_url": "https://avatars.githubusercontent.com/u/338250?v=4",
"profile": "http://dnquark.com",
"contributions": [
"code"
]
},
{
"login": "aranvir",
"name": "aranvir",
"avatar_url": "https://avatars.githubusercontent.com/u/75439739?v=4",
"profile": "https://github.com/aranvir",
"contributions": [
"doc"
]
},
{
"login": "bunny-therapist",
"name": "bunny-therapist",
"avatar_url": "https://avatars.githubusercontent.com/u/87039365?v=4",
"profile": "https://github.com/bunny-therapist",
"contributions": [
"code"
]
},
{
"login": "benluo",
"name": "Ben Luo",
"avatar_url": "https://avatars.githubusercontent.com/u/70398?v=4",
"profile": "http://www.benluo.cc",
"contributions": [
"doc"
]
},
{
"login": "hugovk",
"name": "Hugo van Kemenade",
"avatar_url": "https://avatars.githubusercontent.com/u/1324225?v=4",
"profile": "https://github.com/hugovk",
"contributions": [
"doc"
]
},
{
"login": "error418",
"name": "Michael Gerbig",
"avatar_url": "https://avatars.githubusercontent.com/u/7716544?v=4",
"profile": "https://error418.github.io",
"contributions": [
"doc"
]
},
{
"login": "crisog",
"name": "CrisOG",
"avatar_url": "https://avatars.githubusercontent.com/u/40803711?v=4",
"profile": "https://github.com/crisog",
"contributions": [
"bug",
"code",
"test"
]
}
],
"contributorsPerLine": 7,
Expand Down
30 changes: 15 additions & 15 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,17 +45,17 @@
"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": [
Expand All @@ -64,7 +64,7 @@
"--extras",
"full",
"--with",
"docs,lint"
"docs,lint",
],
"remoteUser": "vscode"
"remoteUser": "vscode",
}
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ By submitting this pull request, you agree to:
- follow [Litestar's contribution guidelines](https://github.com/litestar-org/.github/blob/main/CONTRIBUTING.md)
- follow the [PSFs's Code of Conduct](https://www.python.org/psf/conduct/)
-->
## Description

-

<!--
Please add in issue numbers this pull request will close, if applicable
Examples: Fixes #4321 or Closes #1234
Ensure you are using a supported keyword to properly link an issue:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
## Closes
42 changes: 39 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,41 @@ jobs:
coverage: ${{ (matrix.python-version == '3.12' || matrix.python-version == '3.8') }}
python-version: ${{ matrix.python-version }}

test_integration:
name: Test server integration
runs-on: ubuntu-latest
strategy:
matrix:
uvicorn-version: ["uvicorn<0.27.0", "uvicorn>=0.27.0"]
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

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

upload-test-coverage:
runs-on: ubuntu-latest
needs: test
Expand All @@ -112,16 +147,17 @@ jobs:
python -Im coverage combine
python -Im coverage xml -i
- name: Fix coverage file for sonarcloud
- 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@v3
uses: codecov/codecov-action@v4
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

test-platform-compat:
if: github.event_name == 'push'
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'test platform compat')
strategy:
fail-fast: false
matrix:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/pr-merged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "PR merged"

on:
pull_request:
types:
- closed
branches:
- develop
- main

jobs:
close_and_notify:
name: Close issues and notify
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const prNumber = context.payload.number
const branch = context.baseRef
const isDevelop = branch === "develop"
const commentBody = `<!--closing-comment-->\nThis issue has been closed in #${prNumber}. The change will be included in the upcoming ${isDevelop ? "minor" : "patch"} release.`
const query = `query($number: Int!, $owner: String!, $name: String!) { repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
id
closingIssuesReferences (first: 10) { edges { node { number } } }
}
}
}`
const res = await github.graphql(query, {number: prNumber, owner: context.repo.owner, name: context.repo.repo})
const linkedIssues = res.repository.pullRequest.closingIssuesReferences.edges.map(
edge => edge.node.number
)
for (const issueNumber of linkedIssues) {
const res = await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
state: "closed",
state_reason: "completed"
})
if (res.status === 200) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: commentBody,
})
}
}
15 changes: 3 additions & 12 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: v3.0.0
rev: v3.1.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.6"
rev: "v0.2.1"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -35,23 +35,14 @@ repos:
exclude: "tests/openapi/typescript_converter/test_converter|README.md"
additional_dependencies:
- tomli
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
exclude: "_templates|.git|.all-contributorsrc"
- repo: https://github.com/python-formate/flake8-dunder-all
rev: v0.3.1
hooks:
- id: ensure-dunder-all
exclude: "test*|examples*|tools"
args: ["--use-tuple"]
- repo: https://github.com/ariebovenberg/slotscheck
rev: v0.17.1
rev: v0.17.3
hooks:
- id: slotscheck
exclude: "test_*|docs|.github"
Expand Down
Loading

0 comments on commit 649dce6

Please sign in to comment.