Skip to content

Commit

Permalink
Merge branch 'master' into feat-bytes-json-options
Browse files Browse the repository at this point in the history
  • Loading branch information
svlandeg committed Jan 8, 2025
2 parents 114b761 + f110845 commit 4b75b07
Show file tree
Hide file tree
Showing 118 changed files with 1,741 additions and 2,081 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
types:
- opened
- synchronize

env:
UV_SYSTEM_PYTHON: 1

jobs:
changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +40,7 @@ jobs:
- mkdocs.no-insiders.yml
- .github/workflows/build-docs.yml
- .github/workflows/deploy-docs.yml
- data/**
build-docs:
needs:
Expand All @@ -52,17 +57,19 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt') }}-v02
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
run: uv pip install -r requirements-docs.txt
- name: Install Material for MkDocs Insiders
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs-insiders.txt
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
run: uv pip install -r requirements-docs-insiders.txt
env:
TOKEN: ${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }}
- uses: actions/cache@v4
Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ permissions:
pull-requests: write
statuses: write

env:
UV_SYSTEM_PYTHON: 1

jobs:
deploy-docs:
runs-on: ubuntu-latest
Expand All @@ -25,14 +28,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Install GitHub Actions dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-github-actions.txt
run: uv pip install -r requirements-github-actions.txt
- name: Deploy Docs Status Pending
run: python ./scripts/deploy_docs_status.py
env:
Expand All @@ -55,19 +60,19 @@ jobs:
# hashFiles returns an empty string if there are no files
if: hashFiles('./site/*')
id: deploy
uses: cloudflare/pages-action@v1
env:
PROJECT_NAME: typertiangolo
BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: typertiangolo
directory: './site'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }}
- name: Comment Deploy
run: python ./scripts/deploy_docs_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOY_URL: ${{ steps.deploy.outputs.url }}
DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }}
IS_DONE: "true"
2 changes: 2 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
- run: echo "Done adding labels"
# Run this after labeler applied labels
check-labels:
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- uses: tiangolo/[email protected].1
- uses: tiangolo/[email protected].2
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: docs/release-notes.md
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.10.1
uses: pypa/gh-action-pypi-publish@v1.12.3
24 changes: 17 additions & 7 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,45 @@ name: Smokeshow

on:
workflow_run:
workflows: [Test]
types: [completed]
workflows:
- Test
types:
- completed

permissions:
statuses: write

env:
UV_SYSTEM_PYTHON: 1

jobs:
smokeshow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'

- run: pip install smokeshow

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- run: uv pip install -r requirements-github-actions.txt
- uses: actions/download-artifact@v4
with:
name: coverage-html
path: htmlcov
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- run: smokeshow upload htmlcov
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
Expand Down
37 changes: 22 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ on:
# cron every week on monday
- cron: "0 0 * * 1"

env:
UV_SYSTEM_PYTHON: 1

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ "3.12" ]
include:
- os: ubuntu-latest
- os: ubuntu-22.04
python-version: "3.7"
- os: macos-latest
python-version: "3.8"
Expand All @@ -41,18 +44,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- uses: actions/cache@v4
if: ${{ runner.os != 'macOS' }}
id: cache
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
run: uv pip install -r requirements-tests.txt
- name: Lint
run: bash scripts/lint.sh
- run: mkdir coverage
Expand Down Expand Up @@ -81,16 +82,22 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.8'
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Get coverage files
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: coverage
merge-multiple: true
- run: pip install coverage[toml]
- name: Install Dependencies
run: uv pip install -r requirements-tests.txt
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage report
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-toml
Expand All @@ -14,7 +14,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.8.6
hooks:
- id: ruff
args:
Expand Down
1 change: 1 addition & 0 deletions data/members.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
members:
- login: tiangolo
- login: svlandeg
- login: patrick91
6 changes: 3 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This command generates a directory `./htmlcov/`, if you open the file `./htmlcov

To try and test the completion for different shells and check that they are working you can use a Docker container.

There's a `Dockerfile` and a a Docker Compose file `compose.yaml` at `./scripts/docker/`.
There's a `Dockerfile` and a Docker Compose file `compose.yaml` at `./scripts/docker/`.

It has installed `bash`, `zsh`, `fish`, and `pwsh` (PowerShell for Linux).

Expand Down Expand Up @@ -237,9 +237,9 @@ That way, you can edit the documentation/source files and see the changes live.

/// tip

Alternatively, you can perform the same steps that scripts does manually.
Alternatively, you can perform the same steps that script does manually.

Go into the docs director at `docs/`:
Go into the docs directory at `docs/`:

```console
$ cd docs/
Expand Down
2 changes: 1 addition & 1 deletion docs/help-typer.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Here's what to have in mind and how to review a pull request:

* Don't worry too much about things like commit message styles, I will squash and merge customizing the commit manually.

* Also don't worry about style rules, there are already automatized tools checking that.
* Also don't worry about style rules, there are already automated tools checking that.

And if there's any other style or consistency need, I'll ask directly for that, or I'll add commits on top with the needed changes.

Expand Down
Loading

0 comments on commit 4b75b07

Please sign in to comment.