Skip to content

Commit 7ef57ba

Browse files
Merge branch 'pydantic:main' into dev-url-join
2 parents a7d9351 + f389728 commit 7ef57ba

File tree

107 files changed

+3232
-881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+3232
-881
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,9 @@ jobs:
455455
target: i686
456456
python-architecture: x86
457457
interpreter: 3.8 3.9 3.10 3.11 3.12 3.13
458-
# FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110
459-
# - os: windows
460-
# target: aarch64
461-
# interpreter: 3.11 3.12 3.13
458+
- os: windows
459+
target: aarch64
460+
interpreter: 3.11 3.12 3.13
462461

463462
exclude:
464463
# See above; disabled for now.
@@ -486,7 +485,9 @@ jobs:
486485
target: ${{ matrix.target }}
487486
manylinux: ${{ matrix.manylinux }}
488487
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10' }}
489-
rust-toolchain: stable
488+
# Limit windows builds to 1.77 to keep Windows 7 support.
489+
# FIXME: Unpin when Python 3.8 support is dropped. (3.9 requires Windows 10)
490+
rust-toolchain: ${{ (matrix.os == 'windows' && '1.77') || 'stable' }}
490491
docker-options: -e CI
491492

492493
- run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/
@@ -535,17 +536,18 @@ jobs:
535536

536537
- name: install rust stable
537538
id: rust-toolchain
538-
uses: dtolnay/rust-toolchain@stable
539+
uses: dtolnay/rust-toolchain@master
539540
with:
540541
components: llvm-tools
542+
# Limit windows builds to 1.77 to keep Windows 7 support.
543+
# FIXME: Unpin when Python 3.8 support is dropped. (3.9 requires Windows 10)
544+
toolchain: ${{ (matrix.os == 'windows' && '1.77') || 'stable' }}
541545

542546
- run: pip install -U 'ruff==0.5.0' typing_extensions
543547

544548
# generate self-schema now, so we don't have to do so inside docker in maturin build
545549
- run: python generate_self_schema.py
546550

547-
- run: rustc --version --verbose
548-
549551
- name: build initial wheel
550552
uses: PyO3/maturin-action@v1
551553
with:
@@ -554,7 +556,7 @@ jobs:
554556
--release
555557
--out pgo-wheel
556558
--interpreter ${{ matrix.interpreter }}
557-
rust-toolchain: stable
559+
rust-toolchain: ${{ steps.rust-toolchain.outputs.name }}
558560
docker-options: -e CI
559561
env:
560562
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
@@ -569,7 +571,7 @@ jobs:
569571
pip install -r tests/requirements.txt
570572
pip install pydantic-core --no-index --no-deps --find-links pgo-wheel --force-reinstall
571573
pytest tests/benchmarks
572-
rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"'
574+
rustup run ${{ steps.rust-toolchain.outputs.name }} bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"'
573575
574576
- name: merge pgo data
575577
run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
@@ -582,7 +584,7 @@ jobs:
582584
--release
583585
--out dist
584586
--interpreter ${{ matrix.interpreter }}
585-
rust-toolchain: stable
587+
rust-toolchain: ${{steps.rust-toolchain.outputs.name}}
586588
docker-options: -e CI
587589
env:
588590
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"

.github/workflows/codspeed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
6969

7070
- name: Run CodSpeed benchmarks
71-
uses: CodSpeedHQ/action@v2
71+
uses: CodSpeedHQ/action@v3
7272
with:
7373
run: pytest tests/benchmarks/ --codspeed

Cargo.lock

Lines changed: 36 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pydantic-core"
3-
version = "2.20.1"
3+
version = "2.24.0"
44
edition = "2021"
55
license = "MIT"
66
homepage = "https://github.com/pydantic/pydantic-core"
@@ -29,24 +29,25 @@ rust-version = "1.75"
2929
[dependencies]
3030
# TODO it would be very nice to remove the "py-clone" feature as it can panic,
3131
# but needs a bit of work to make sure it's not used in the codebase
32-
pyo3 = { version = "0.22.0", features = ["generate-import-lib", "num-bigint", "py-clone"] }
33-
regex = "1.10.4"
32+
pyo3 = { version = "0.22.2", features = ["generate-import-lib", "num-bigint", "py-clone"] }
33+
regex = "1.10.6"
3434
strum = { version = "0.26.3", features = ["derive"] }
3535
strum_macros = "0.26.4"
36-
serde_json = {version = "1.0.116", features = ["arbitrary_precision", "preserve_order"]}
36+
serde_json = {version = "1.0.128", features = ["arbitrary_precision", "preserve_order"]}
3737
enum_dispatch = "0.3.13"
38-
serde = { version = "1.0.203", features = ["derive"] }
38+
serde = { version = "1.0.209", features = ["derive"] }
3939
speedate = "0.14.4"
4040
smallvec = "1.13.2"
4141
ahash = "0.8.10"
4242
url = "2.5.0"
4343
# idna is already required by url, added here to be explicit
44-
idna = "1.0.1"
45-
base64 = "0.21.7"
44+
idna = "1.0.2"
45+
base64 = "0.22.1"
4646
num-bigint = "0.4.6"
4747
python3-dll-a = "0.2.10"
48-
uuid = "1.9.1"
48+
uuid = "1.10.0"
4949
jiter = { version = "0.5", features = ["python"] }
50+
hex = "0.4.3"
5051

5152
[lib]
5253
name = "_pydantic_core"
@@ -73,10 +74,10 @@ debug = true
7374
strip = false
7475

7576
[dev-dependencies]
76-
pyo3 = { version = "0.22.0", features = ["auto-initialize"] }
77+
pyo3 = { version = "0.22.2", features = ["auto-initialize"] }
7778

7879
[build-dependencies]
79-
version_check = "0.9.4"
80+
version_check = "0.9.5"
8081
# used where logic has to be version/distribution specific, e.g. pypy
8182
pyo3-build-config = { version = "0.22.0" }
8283

build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ fn main() {
3535
if let Some(true) = version_check::supports_feature("coverage_attribute") {
3636
println!("cargo:rustc-cfg=has_coverage_attribute");
3737
}
38+
println!("cargo:rustc-check-cfg=cfg(has_coverage_attribute)");
39+
40+
if std::env::var("RUSTFLAGS")
41+
.unwrap_or_default()
42+
.contains("-Cprofile-use=")
43+
{
44+
println!("cargo:rustc-cfg=specified_profile_use");
45+
}
46+
println!("cargo:rustc-check-cfg=cfg(specified_profile_use)");
47+
3848
generate_self_schema();
3949
println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap());
4050
}

generate_self_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
def get_schema(obj: Any, definitions: dict[str, core_schema.CoreSchema]) -> core_schema.CoreSchema: # noqa: C901
5151
if isinstance(obj, str):
5252
return {'type': obj}
53-
elif obj in (datetime, timedelta, date, time, bool, int, float, str, decimal.Decimal):
53+
elif obj in (datetime, timedelta, date, time, bool, int, float, str, decimal.Decimal, complex):
5454
return {'type': obj.__name__.lower()}
5555
elif is_typeddict(obj):
5656
return type_dict_schema(obj, definitions)

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ exclude_lines = [
103103

104104
# configuring https://github.com/pydantic/hooky
105105
[tool.hooky]
106-
assignees = ['samuelcolvin', 'adriangb', 'dmontagu', 'davidhewitt', 'lig']
107-
reviewers = ['samuelcolvin', 'adriangb', 'dmontagu', 'davidhewitt']
106+
reviewers = ['sydney-runkle', 'davidhewitt']
108107
require_change_file = false
109108

110109
[tool.pyright]

python/pydantic_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
else:
3535
from typing import NotRequired as _NotRequired
3636

37-
if _sys.version_info < (3, 9):
37+
if _sys.version_info < (3, 12):
3838
from typing_extensions import TypedDict as _TypedDict
3939
else:
4040
from typing import TypedDict as _TypedDict

0 commit comments

Comments
 (0)