Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Refactor logic to support Pydantic'sField()
function in dataclasses#5561
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
name:codspeed | |
on: | |
push: | |
branches: | |
-main | |
pull_request: | |
# `workflow_dispatch` allows CodSpeed to trigger backtest | |
# performance analysis in order to generate initial data. | |
workflow_dispatch: | |
env: | |
UV_FROZEN:true | |
jobs: | |
codspeed-profiling: | |
name:CodSpeed profiling | |
runs-on:ubuntu-24.04 | |
steps: | |
-uses:actions/checkout@v4 | |
-uses:astral-sh/setup-uv@v6 | |
# Using this action is still necessary for CodSpeed to work: | |
-uses:actions/setup-python@v5 | |
with: | |
python-version:"3.12" | |
-id:core-version | |
name:resolve pydantic-core tag | |
run:| | |
set -uex -o pipefail | |
echo core-ref=$(python -c " | |
import re | |
import tomllib | |
pyproject_toml = tomllib.loads(open('pyproject.toml').read()) | |
core = next(d for d in pyproject_toml['project']['dependencies'] if d.startswith('pydantic-core')) | |
if (result := re.search(r'==(.+)', core)) is not None: | |
print(f'v{result.group(1)}') | |
elif (result := re.search(r'@ git\+https://github\.com/pydantic/pydantic-core\.git@(.+)', core)) is not None: | |
print(result.group(1)) | |
else: | |
raise RuntimeError('Could not resolve pydantic-core ref') | |
") >> $GITHUB_OUTPUT | |
-name:install deps | |
run:uv sync --python 3.12 --group testing-extra --extra email --frozen | |
-name:checkout pydantic-core | |
uses:actions/checkout@v4 | |
with: | |
repository:pydantic/pydantic-core | |
ref:${{ steps.core-version.outputs.core-ref }} | |
path:pydantic-core | |
-name:install rust stable | |
uses:dtolnay/rust-toolchain@stable | |
with: | |
components:llvm-tools | |
-name:cache rust | |
uses:Swatinem/rust-cache@v2 | |
with: | |
workspaces:pydantic-core | |
-name:install pydantic-core with profiling symbols | |
run:| | |
cd pydantic-core | |
ln -s ../.venv .venv | |
uv sync --group all --inexact | |
uv pip uninstall pytest-speed | |
uv run make build-pgo | |
env: | |
CARGO_PROFILE_RELEASE_DEBUG:"line-tables-only" | |
CARGO_PROFILE_RELEASE_STRIP:"false" | |
-name:Run CodSpeed benchmarks | |
uses:CodSpeedHQ/action@v3 | |
with: | |
run:uv run --no-sync pytest ./tests/benchmarks --codspeed |