Skip to content

Commit

Permalink
Merge branch 'main' into dto-codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut authored Oct 7, 2023
2 parents 62a5ff8 + 6f084ef commit 81d39b0
Show file tree
Hide file tree
Showing 42 changed files with 2,136 additions and 2,988 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 16 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
### Pull Request Checklist
<!--
By submitting this pull request, you agree to:
- follow [Litestar's Code of Conduct](https://github.com/litestar-org/.github/blob/main/CODE_OF_CONDUCT.md)
- 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/)
-->

[//]: # "By submitting this issue, you agree to:"
[//]: # "- follow Litestar's [Code of Conduct](https://github.com/litestar-org/.github/blob/main/CODE_OF_CONDUCT.md)"
[//]: # "- follow Litestar's [Contribution Guidelines](https://litestar.dev/community/contribution-guide)"
### Pull Request Checklist

- [ ] New code has 100% test coverage
- [ ] (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
- [ ] (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
- [ ] Pre-Commit Checks were ran and passed
- [ ] Tests were ran and passed

### Description
[//]: # "Please describe your pull request for new release changelog purposes"
[//]: # "Example: 'This pr adds the capability to use server-sent events, and documents it in the usage docs'"
<!--
Please describe your pull request for new release changelog purposes
-->

-

### Close Issue(s)
[//]: # "Please add in issue numbers this pull request will close, if applicable"
[//]: # "Examples: Fixes #4321 or Closes #1234"
<!--
Please add in issue numbers this pull request will close, if applicable
Examples: Fixes #4321 or Closes #1234
-->

-
File renamed without changes.
30 changes: 12 additions & 18 deletions .github/workflows/ci.yaml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
pydantic-version: ["1", "2"]
uses: ./.github/workflows/test.yaml
uses: ./.github/workflows/test.yml
with:
coverage: ${{ matrix.python-version == '3.11' && matrix.pydantic-version == '2' }}
pydantic-version: ${{ matrix.pydantic-version }}
Expand All @@ -48,7 +48,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest", "windows-latest"]
uses: ./.github/workflows/test.yaml
uses: ./.github/workflows/test.yml
with:
python-version: "3.11"
pydantic-version: "2"
Expand Down Expand Up @@ -110,31 +110,25 @@ jobs:
with:
python-version: "3.11"

- name: Install Poetry
uses: snok/install-poetry@v1
- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
python-version: "3.11"
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: v1-venv-docs-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --with docs --extras full
run: pdm install -G:all

- name: Build docs
env:
LITESTAR_DOCS_IGNORE_MISSING_EXAMPLE_OUTPUT: 1
run: poetry run make docs
run: pdm run make docs

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

- name: Save PR number
env:
Expand Down
File renamed without changes.
35 changes: 20 additions & 15 deletions .github/workflows/docs.yaml → .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
name: Documentation Building

on:
release:
types: [published]
push:
branches:
- main

jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
virtualenvs-create: false
installer-parallel: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}
- name: Install App Dependencies
run: poetry install --no-interaction --with docs --extras full
python-version: "3.11"
allowpython-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install -G:all

- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1

- name: Build release docs
run: poetry run python tools/build_docs.py docs-build
run: pdm run python tools/build_docs.py docs-build
if: github.event_name == 'release'

- name: Build dev docs
run: poetry run python tools/build_docs.py docs-build --version dev
run: pdm run python tools/build_docs.py docs-build --version dev
if: github.event_name == 'push'

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
File renamed without changes.
43 changes: 21 additions & 22 deletions .github/workflows/publish.yaml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,47 @@ jobs:
with:
python-version: "3.11"

- name: Install Poetry
uses: snok/install-poetry@v1
- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
python-version: ${{ matrix.python-version }}
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install App Dependencies
run: poetry install --no-interaction --only main

- name: Install Test Dependencies
run: poetry run python -m pip install pytest pytest-asyncio httpx trio time-machine
- 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 && poetry run pytest test_hello_world.py
run: mv tests/examples/test_hello_world.py test_hello_world.py && pdm run pytest test_hello_world.py

publish-release:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
environment: release
steps:
- name: Check out repository
uses: actions/checkout@v4

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

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install --no-interaction --no-root --no-dev
- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
allow-python-prereleases: false
cache: true

- name: build
shell: bash
run: poetry build
- name: Build package
run: pdm build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
75 changes: 0 additions & 75 deletions .github/workflows/test.yaml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test

on:
workflow_call:
inputs:
python-version:
required: true
type: string
pydantic-version:
required: true
type: string
coverage:
required: false
type: boolean
default: false
os:
required: false
type: string
default: "ubuntu-latest"

jobs:
test:
runs-on: ${{ inputs.os }}
timeout-minutes: 10
defaults:
run:
shell: bash
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: ${{ inputs.python-version }}
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
- name: Install dependencies
run: pdm install -G:all

- if: ${{ inputs.pydantic-version == '1' }}
name: Prepare for pydantic v1
run: pdm add --no-sync "pydantic>=1.10.11,<2" "piccolo"

- if: ${{ inputs.pydantic-version == '2' }}
name: Prepare for pydantic v2
run: pdm add --no-sync "pydantic>=2.3.0" "pydantic-extra-types>=2.0.0"

- name: Sync dependencies
run: pdm sync

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

- name: Test
if: ${{ !inputs.coverage }}
run: pdm run pytest docs/examples tests -n auto

- name: Test with coverage
if: inputs.coverage
run: pdm run pytest docs/examples tests --cov=litestar --cov-report=xml -n auto

- uses: actions/upload-artifact@v3
if: inputs.coverage
with:
name: coverage-xml
path: coverage.xml
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ target/
/docs/_build/
coverage.*
setup.py

# pdm
.pdm.toml
.pdm-python
.pdm-build/
Loading

0 comments on commit 81d39b0

Please sign in to comment.