Skip to content

Commit 8273f2f

Browse files
authored
Merge branch 'main' into test-build-3.12
2 parents e4a5d36 + 081cf31 commit 8273f2f

File tree

100 files changed

+1941
-1279
lines changed

Some content is hidden

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

100 files changed

+1941
-1279
lines changed

.cargo/config.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
[build]
2-
rustflags = [
3-
"-A", "incomplete_features",
4-
]
2+
rustflags = []
53

64
# see https://pyo3.rs/main/building_and_distribution.html#macos
75
[target.x86_64-apple-darwin]
86
rustflags = [
97
"-C", "link-arg=-undefined",
108
"-C", "link-arg=dynamic_lookup",
11-
"-A", "incomplete_features",
129
]
1310

1411
[target.aarch64-apple-darwin]
1512
rustflags = [
1613
"-C", "link-arg=-undefined",
1714
"-C", "link-arg=dynamic_lookup",
18-
"-A", "incomplete_features",
1915
]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Thank you for your contribution! -->
2+
3+
## Change Summary
4+
5+
<!-- Please give a short summary of the changes. -->
6+
7+
## Related issue number
8+
9+
<!-- Are there any issues opened that will be resolved by merging this change? -->
10+
<!-- WARNING: please use "fix #123" style references so the issue is closed when this PR is merged. -->
11+
12+
## Checklist
13+
14+
* [ ] Unit tests for the changes exist
15+
* [ ] Documentation reflects the changes where applicable
16+
* [ ] Pydantic tests pass with this `pydantic-core` (except for expected changes)
17+
* [ ] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- run: ls -lha
5454
- run: coverage xml
5555

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

5858
- uses: codecov/codecov-action@v3
5959

@@ -152,8 +152,7 @@ jobs:
152152
python-version: '3.11'
153153

154154
- run: pip install -r tests/requirements.txt
155-
- run: 'pip install "maturin==1.0.1" typing_extensions'
156-
- run: make build-dev
155+
- run: pip install -e . --config-settings=build-args='--profile dev'
157156

158157
- run: pip freeze
159158
- run: pytest
@@ -174,7 +173,7 @@ jobs:
174173

175174
- uses: actions/setup-python@v4
176175
with:
177-
python-version: '3.10'
176+
python-version: '3.11'
178177

179178
# used to lint js code
180179
- uses: actions/setup-node@v3
@@ -196,7 +195,6 @@ jobs:
196195
if: steps.cache-py.outputs.cache-hit != 'true'
197196

198197
- run: pip install .
199-
if: steps.cache-py.outputs.cache-hit != 'true'
200198

201199
- run: pip freeze
202200

@@ -255,7 +253,7 @@ jobs:
255253
version: '3.1.32'
256254
actions-cache-folder: emsdk-cache
257255

258-
- run: pip install 'maturin==1.0.1' 'black>=22.3.0,<23' typing_extensions
256+
- run: pip install 'maturin>=1,<2' 'black>=22.3.0,<23' typing_extensions
259257

260258
- name: build wheels
261259
run: make build-wasm
@@ -362,6 +360,7 @@ jobs:
362360
architecture: ${{ matrix.python-architecture || 'x64' }}
363361

364362
- run: pip install -U twine 'black>=22.3.0,<23' typing_extensions
363+
365364
# generate self-schema now, so we don't have to do so inside docker in maturin build
366365
- run: python generate_self_schema.py
367366

@@ -381,6 +380,7 @@ jobs:
381380
container: ${{ matrix.container }}
382381
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 3.12 pypy3.7 pypy3.8 pypy3.9' }}
383382
rust-toolchain: stable
383+
docker-options: -e CI
384384

385385
- run: ${{ matrix.ls || 'ls -lh' }} dist/
386386

@@ -463,8 +463,6 @@ jobs:
463463
fi
464464
run: |
465465
set -x
466-
# this is required so that pytest uses the installed pydantic-core package
467-
rm -r pydantic_core
468466
# typing-extensions isn't automatically installed because of `--no-index --no-deps`
469467
python3 -m venv venv
470468
source venv/bin/activate
@@ -498,7 +496,6 @@ jobs:
498496
name: pypi_files
499497
path: dist
500498

501-
- run: rm -r pydantic_core
502499
- run: pip install typing-extensions
503500
- run: pip install -r tests/requirements.txt
504501
- run: pip install pydantic-core --no-index --no-deps --find-links dist --force-reinstall

.github/workflows/codspeed.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ jobs:
4646
- name: cache rust
4747
uses: Swatinem/rust-cache@v2
4848

49-
- run: pip install . -v
49+
- name: Install pydantic-core
50+
# --no-default-features to avoid using mimalloc
51+
run: |
52+
pip install -e . --config-settings=build-args='--no-default-features --verbose' -v
53+
python -c 'import pydantic_core; assert pydantic_core._pydantic_core.__pydantic_core_default_allocator__'
5054
env:
5155
CONST_RANDOM_SEED: 0 # Fix the compile time RNG seed
5256

53-
# this is required so that pytest uses the installed package
54-
- run: rm tests/__init__.py
55-
5657
- name: Run CodSpeed benchmarks
5758
uses: CodSpeedHQ/action@v1
5859
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ node_modules/
3434
/*.profdata
3535
/*.profraw
3636
/foobar.py
37-
/pydantic_core/*.so
37+
/python/pydantic_core/*.so
3838
/src/self_schema.py

.mypy-stubtest-allowlist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# TODO: __init__ signature inherited from BaseException, probably needs investigating
2+
pydantic_core._pydantic_core.PydanticOmit.__init__
3+
# TODO: don't want to expose this staticmethod, requires https://github.com/PyO3/pyo3/issues/2384
4+
pydantic_core._pydantic_core.PydanticUndefinedType.new

Cargo.lock

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

0 commit comments

Comments
 (0)