## Change Summary

As per title.

## Related issue number

N/A

## Checklist

* [ ] The pull request title is a good summary of the changes - it will be used in the changelog
* [ ] Unit tests for the changes exist
* [ ] Tests pass on CI
* [ ] Documentation reflects the changes where applicable
* [ ] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**

Update pydantic-core to 2.10.1. ## Change Summary

As per title.

## Related issue number

N/A

## Checklist

* [ ] The pull request title is a good summary of the changes - it will be used in the changelog
* [ ] Unit tests for the changes exist
* [ ] Tests pass on CI
* [ ] Documentation reflects the changes where applicable
* [ ] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**

name: Publish Documentation

on:
  push:
    branches:
      - main
      - docs-update
    tags:
      - '**'

env:
  COLUMNS: 150
  PDM_DEPS: 'urllib3<2'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: pdm-project/setup-pdm@v3
        with:
          python-version: '3.11'
          cache: true

      - name: install
        run: pdm install -G linting -G email

      - uses: pre-commit/action@v3.0.0
        with:
          extra_args: --all-files --verbose
        env:
          SKIP: no-commit-to-branch

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: pdm-project/setup-pdm@v3
        with:
          python-version: '3.11'
          cache: true

      - name: install deps
        run: pdm install -G testing

      - run: pdm info && pdm list

      - run: 'pdm run python -c "import pydantic.version; print(pydantic.version.version_info())"'

      - run: make test

  publish:
    # Compare with the docs-build job in .github/workflows/ci.yml
    needs: [lint, test]
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: checkout docs-site
        uses: actions/checkout@v3
        with:
          ref: docs-site

      - name: checkout current branch
        uses: actions/checkout@v3

      - uses: pdm-project/setup-pdm@v3
        with:
          python-version: '3.10'

      - name: install
        run: |
          pdm venv create --with-pip $PYTHON
          pdm install -G docs
          pdm run python -m pip install https://files.scolvin.com/${MKDOCS_TOKEN}/mkdocs_material-9.4.2+insiders.4.42.0-py3-none-any.whl
        env:
          MKDOCS_TOKEN: ${{ secrets.MKDOCS_TOKEN }}

      - run: pdm run python -c 'import docs.plugins.main'

      # Adding local symlinks gets nice source locations like
      #   pydantic_core/core_schema.py
      # instead of
      #   .venv/lib/python3.10/site-packages/pydantic_core/core_schema.py
      - name: prepare shortcuts for extra modules
        run: |
          ln -s .venv/lib/python*/site-packages/pydantic_core pydantic_core
          ln -s .venv/lib/python*/site-packages/pydantic_settings pydantic_settings
          ln -s .venv/lib/python*/site-packages/pydantic_extra_types pydantic_extra_types

      - name: Set git credentials
        run: |
          git config --global user.name "${{ github.actor }}"
          git config --global user.email "${{ github.actor }}@users.noreply.github.com"

      - run: pdm run mike deploy -b docs-site dev-v2 --push
        if: "github.ref == 'refs/heads/main'"

      - if: "github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/')"
        id: check-version
        uses: samuelcolvin/check-python-version@v4.1
        with:
          version_file_path: 'pydantic/version.py'
          skip_env_check: true

      - run: pdm run mike deploy -b docs-site ${{ steps.check-version.outputs.VERSION_MAJOR_MINOR }} latest --update-aliases --push
        if: "(github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/')) && !fromJSON(steps.check-version.outputs.IS_PRERELEASE)"
        env:
          PYDANTIC_VERSION: v${{ steps.check-version.outputs.VERSION }}

name: Publish Documentation

on:
  push:
    branches:
      - main
      - docs-update
    tags:
      - '**'

env:
  COLUMNS: 150
  PDM_DEPS: 'urllib3<2'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: pdm-project/setup-pdm@v3
        with:
          python-version: '3.11'
          cache: true

      - name: install
        run: pdm install -G linting -G email

      - uses: pre-commit/action@v3.0.0
        with:
          extra_args: --all-files --verbose
        env:
          SKIP: no-commit-to-branch

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: pdm-project/setup-pdm@v3
        with:
          python-version: '3.11'
          cache: true

      - name: install deps
        run: pdm install -G testing

      - run: pdm info && pdm list

      - run: 'pdm run python -c "import pydantic.version; print(pydantic.version.version_info())"'

      - run: make test

  publish:
    # Compare with the docs-build job in .github/workflows/ci.yml
    needs: [lint, test]
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: checkout docs-site
        uses: actions/checkout@v3
        with:
          ref: docs-site

      - name: checkout current branch
        uses: actions/checkout@v3

      - uses: pdm-project/setup-pdm@v3
        with:
          python-version: '3.10'

      - name: install
        run: |
          pdm venv create --with-pip $PYTHON
          pdm install -G docs
          pdm run python -m pip install https://files.scolvin.com/${MKDOCS_TOKEN}/mkdocs_material-9.4.2+insiders.4.42.0-py3-none-any.whl
        env:
          MKDOCS_TOKEN: ${{ secrets.MKDOCS_TOKEN }}

      - run: pdm run python -c 'import docs.plugins.main'

      # Adding local symlinks gets nice source locations like
      #   pydantic_core/core_schema.py
      # instead of
      #   .venv/lib/python3.10/site-packages/pydantic_core/core_schema.py
      - name: prepare shortcuts for extra modules
        run: |
          ln -s .venv/lib/python*/site-packages/pydantic_core pydantic_core
          ln -s .venv/lib/python*/site-packages/pydantic_settings pydantic_settings
          ln -s .venv/lib/python*/site-packages/pydantic_extra_types pydantic_extra_types

      - name: Set git credentials
        run: |
          git config --global user.name "${{ github.actor }}"
          git config --global user.email "${{ github.actor }}@users.noreply.github.com"

      - run: pdm run mike deploy -b docs-site dev-v2 --push
        if: "github.ref == 'refs/heads/main'"

      - if: "github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/')"
        id: check-version
        uses: samuelcolvin/check-python-version@v4.1
        with:
          version_file_path: 'pydantic/version.py'
          skip_env_check: true

      - run: pdm run mike deploy -b docs-site ${{ steps.check-version.outputs.VERSION_MAJOR_MINOR }} latest --update-aliases --push
        if: "(github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/')) && !fromJSON(steps.check-version.outputs.IS_PRERELEASE)"
        env:
          PYDANTIC_VERSION: v${{ steps.check-version.outputs.VERSION }}
