Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b04128d
update makefile with uv
sydney-runkle Nov 19, 2024
9d3d96c
adding uv to ci
sydney-runkle Nov 19, 2024
73772f9
adding uv.lock
sydney-runkle Nov 19, 2024
00bf032
use sync with venv
sydney-runkle Nov 19, 2024
4451cc5
more attempted fixes
sydney-runkle Nov 19, 2024
7ad9a37
fix os test
sydney-runkle Nov 19, 2024
69a0880
fix ruff
sydney-runkle Nov 19, 2024
fa0ad9e
improved CI
sydney-runkle Nov 19, 2024
fa3457f
fixing linting issue
sydney-runkle Nov 19, 2024
9ea9a23
coverage updates
sydney-runkle Nov 19, 2024
2f57e08
remove unused mypy
sydney-runkle Nov 19, 2024
a80e698
uv run for maturin?
sydney-runkle Nov 19, 2024
a749ef8
uv run
sydney-runkle Nov 19, 2024
36a5885
more uv run updates
sydney-runkle Nov 19, 2024
de7a405
force reinstalls
sydney-runkle Nov 19, 2024
3c3b2e3
deps fix for integration test
sydney-runkle Nov 19, 2024
bf6d59b
try src file
sydney-runkle Nov 19, 2024
bef5e5c
fix linting issues
sydney-runkle Nov 19, 2024
3b7ace0
try project pydantic
sydney-runkle Nov 19, 2024
84eb33b
not cur dir
sydney-runkle Nov 19, 2024
bd62df3
another top level attempt
sydney-runkle Nov 19, 2024
b0f3e62
controlling venv?
sydney-runkle Nov 20, 2024
7b214d2
uv project environment
sydney-runkle Nov 20, 2024
d9238fa
venv
sydney-runkle Nov 20, 2024
5bb7b8b
venv
sydney-runkle Nov 20, 2024
9baefd3
another attempt
sydney-runkle Nov 20, 2024
524edae
another fix
sydney-runkle Nov 20, 2024
ce04ade
make build dev separately
sydney-runkle Nov 20, 2024
fd113cc
debug, I'm confused
sydney-runkle Nov 20, 2024
11beaeb
simplify, try to fix msrv
davidhewitt Nov 20, 2024
e573ee8
fix integration tests, versioned builds
davidhewitt Nov 20, 2024
7c83ed2
next batch of fixes
davidhewitt Nov 20, 2024
9dde9b8
fix codspeed
davidhewitt Nov 20, 2024
da6e6ef
fixup tests and CI
davidhewitt Nov 20, 2024
f822260
fix benchmarks?
davidhewitt Nov 20, 2024
a0e4a1d
debug
davidhewitt Nov 20, 2024
93c2c9d
try install python on codspeed runs
davidhewitt Nov 20, 2024
c360563
fixup arch builds
davidhewitt Nov 20, 2024
9aadc42
simplify, review comments
davidhewitt Nov 20, 2024
3327255
try last fix for arch tests
davidhewitt Nov 21, 2024
d940668
last fix
davidhewitt Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 79 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
COLUMNS: 150
UV_PYTHON: 3.13

jobs:
coverage:
Expand All @@ -30,26 +31,27 @@ jobs:

- run: rustup component add llvm-tools-preview

- name: set up python
uses: actions/setup-python@v5
- name: install uv
uses: astral-sh/setup-uv@v3
with:
python-version: '3.13'
enable-cache: true

- run: pip install -r tests/requirements.txt
- name: install deps
run: uv sync --group testing

- run: rustc --version --verbose

- run: pip install -e .
- run: uv pip install -e .
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-C instrument-coverage'

- run: pip freeze
- run: uv pip freeze

- run: coverage run -m pytest
- run: uv run coverage run -m pytest

- run: ls -lha
- run: coverage xml
- run: uv run coverage xml

- run: coverage-prepare lcov python/pydantic_core/*.so

Expand Down Expand Up @@ -85,24 +87,27 @@ jobs:
with:
key: test-v3

- name: set up python
uses: actions/setup-python@v5
- name: install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
enable-cache: true

- run: pip install -r tests/requirements.txt
- name: install deps
run: uv sync --group testing

- run: pip install -e .
- run: uv pip install -e .
env:
RUST_BACKTRACE: 1

- run: pip freeze
- run: uv pip freeze

- run: pytest
- run: uv run pytest
env:
HYPOTHESIS_PROFILE: slow

env:
UV_PYTHON: ${{ matrix.python-version }}

test-os:
name: test on ${{ matrix.os }}

Expand All @@ -121,20 +126,21 @@ jobs:
- name: cache rust
uses: Swatinem/rust-cache@v2

- name: set up python
uses: actions/setup-python@v5
- name: install uv
uses: astral-sh/setup-uv@v3
with:
python-version: '3.13'
enable-cache: true

- run: pip install -r tests/requirements.txt
- name: install deps
run: uv sync --group testing

- run: pip install -e .
- run: uv pip install -e .
env:
RUST_BACKTRACE: 1

- run: pip freeze
- run: uv pip freeze

- run: pytest
- run: uv run pytest

- run: cargo test

Expand All @@ -145,14 +151,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v5
- name: install uv
uses: astral-sh/setup-uv@v3
with:
python-version: '3.13'
enable-cache: true

- name: install deps
run: uv sync --group testing

- name: resolve MSRV
id: resolve-msrv
run: echo MSRV=`python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["package"]["rust-version"])'` >> $GITHUB_OUTPUT
run: echo MSRV=`uv run python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["package"]["rust-version"])'` >> $GITHUB_OUTPUT

- name: install rust MSRV
uses: dtolnay/rust-toolchain@master
Expand All @@ -162,15 +171,13 @@ jobs:
- name: cache rust
uses: Swatinem/rust-cache@v2

- run: pip install -r tests/requirements.txt

- run: pip install -e .
- run: uv pip install -e .
env:
RUST_BACKTRACE: 1

- run: pip freeze
- run: uv pip freeze

- run: pytest
- run: uv run pytest

- run: cargo test

Expand All @@ -188,22 +195,28 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5

- name: install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: install rust stable
uses: dtolnay/rust-toolchain@stable

- name: cache rust
uses: Swatinem/rust-cache@v2

- run: pip install -r tests/requirements.txt
- name: install deps
run: uv sync --group testing

- run: make build-dev

- run: pip freeze
- run: pytest
- run: uv pip freeze
- run: uv run pytest

env:
UV_PYTHON: ${{ matrix.python-version }}

test-pydantic-integration:
runs-on: ubuntu-latest
Expand All @@ -230,22 +243,27 @@ jobs:
with:
enable-cache: true

- name: install deps
- name: set up venv
run: |
uv sync --python 3.13 --extra timezone
uv venv
uv pip install -r pydantic/pyproject.toml --extra timezone
uv pip install maturin pip
uv run bash -c 'cd ../pydantic-core && make build-dev'
working-directory: pydantic

- name: install pydantic-core
run: make build-dev
working-directory: pydantic-core

- run: uv --version && uv pip list
working-directory: pydantic
# Run pytest with lax xfail because we often add tests to pydantic

# Run pytest with lax xfail because we often add tests to pydantic
# which xfail on a pending release of pydantic-core
- run: uv run pytest --override-ini=xfail_strict=False
working-directory: pydantic
- run: uv run pytest --override-ini=xfail_strict=False pydantic/tests
env:
PYDANTIC_PRIVATE_ALLOW_UNHANDLED_SCHEMA_TYPES: 1

env:
UV_PROJECT_ENVIRONMENT: ${{ github.workspace }}/.venv

lint:
runs-on: ubuntu-latest

Expand All @@ -260,32 +278,21 @@ jobs:
- name: cache rust
uses: Swatinem/rust-cache@v2

- uses: actions/setup-python@v5
with:
python-version: '3.13'

# used to lint js code
- uses: actions/setup-node@v4
with:
node-version: '18'

- uses: actions/cache@v4
id: cache-py
name: cache python
- name: install uv
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.pythonLocation }}
key: >
py
${{ env.pythonLocation }}
${{ hashFiles('tests/requirements-linting.txt') }}
${{ hashFiles('pyproject.toml') }}

- run: pip install -r tests/requirements-linting.txt
if: steps.cache-py.outputs.cache-hit != 'true'

- run: make build-dev
enable-cache: true

- run: pip freeze
- name: install deps
run: |
uv sync --group linting
make build-dev
uv pip freeze

- run: make lint
- run: make pyright
Expand Down Expand Up @@ -319,12 +326,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: install rust nightly
uses: dtolnay/rust-toolchain@nightly
with:
Expand All @@ -342,7 +343,13 @@ jobs:
version: '3.1.58'
actions-cache-folder: emsdk-cache

- run: pip install 'maturin>=1,<2' 'ruff==0.5.0' typing_extensions
- name: install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: install deps
run: uv sync --python 3.12 --group wasm

- name: build wheels
run: make build-wasm
Expand Down
34 changes: 12 additions & 22 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,26 @@ on:
# performance analysis in order to generate initial data.
workflow_dispatch:

env:
UV_FROZEN: true

jobs:
benchmarks:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- uses: actions/cache@v4
id: cache-py
name: cache python
- name: install uv
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.pythonLocation }}
key: >
py-v2
${{ env.pythonLocation }}
${{ hashFiles('tests/requirements.txt') }}
${{ hashFiles('pyproject.toml') }}

- run: pip install -r tests/requirements.txt
if: steps.cache-py.outputs.cache-hit != 'true'

- run: pip uninstall pytest-speed -y
if: steps.cache-py.outputs.cache-hit != 'true'
enable-cache: true

- run: pip install pytest-benchmark==4.0.0 pytest-codspeed
if: steps.cache-py.outputs.cache-hit != 'true'
- name: install deps
run: |
uv sync --python 3.13 --group testing
uv pip uninstall pytest-speed -y
uv pip install pytest-benchmark==4.0.0 pytest-codspeed

- name: install rust stable
id: rust-toolchain
Expand Down Expand Up @@ -70,4 +60,4 @@ jobs:
- name: Run CodSpeed benchmarks
uses: CodSpeedHQ/action@v3
with:
run: pytest tests/benchmarks/ --codspeed
run: uv run pytest tests/benchmarks/ --codspeed
Loading
Loading