8000 add build tests on ppc64le, simplify (#369) · pydantic/pydantic-core@084c551 · GitHub
[go: up one dir, main page]

Skip to content

Commit 084c551

Browse files
authored
add build tests on ppc64le, simplify (#369)
* add build tests on ppc64le, simplify * fix build tests, disable hypothesis on pyodide * use python3 -m, add set-x * try deleting pydantic_core, not tests/__init__.py * disable a hypothesis test on pyodide
1 parent 3844ea9 commit 084c551

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ jobs:
453453
strategy:
454454
fail-fast: false
455455
matrix:
456-
target: [aarch64, armv7, s390x]
456+
target: [aarch64, armv7, s390x, ppc64le]
457457
distro: ['ubuntu22.04']
458458
include:
459459
- target: aarch64
@@ -469,38 +469,32 @@ jobs:
469469
path: dist
470470

471471
- uses: uraimo/run-on-arch-action@v2.5.0
472-
if: matrix.distro == 'ubuntu22.04'
473-
name: Install & test on Ubuntu
472+
name: install & test
474473
with:
475474
arch: ${{ matrix.target }}
476475
distro: ${{ matrix.distro }}
477476
githubToken: ${{ github.token }}
478477
install: |
479-
apt-get update
480-
apt-get install -y --no-install-recommends python3 python3-pip
478+
set -x
479+
if command -v apt-get &> /dev/null; then
480+
echo "installing python & pip with apt-get..."
481+
apt-get update
482+
apt-get install -y --no-install-recommends python3 python3-pip
483+
else
484+
echo "installing python & pip with apk..."
485+
apk update
486+
apk add python3 py3-pip
487+
fi
481488
run: |
489+
set -x
490+
# this is required so that pytest uses the installed pydantic-core package
482491
rm -r pydantic_core
483-
pip install -U pip typing-extensions
484-
pip install -r tests/requirements.txt
485-
pip install pydantic-core --no-index --no-deps --find-links dist --force-reinstall
486-
pytest
487-
488-
- uses: uraimo/run-on-arch-action@v2.5.0
489-
if: matrix.distro == 'alpine_latest'
490-
name: Install & test on Alpine
491-
with:
492-
arch: ${{ matrix.target }}
493-
distro: ${{ matrix.distro }}
494-
githubToken: ${{ github.token }}
495-
install: |
496-
apk update
497-
apk add python3 py3-pip
498-
run: |
499-
rm -r pydantic_core
500-
pip install -U pip typing-extensions
501-
pip install -r tests/requirements.txt
502-
pip install pydantic-core --no-index --no-deps --find-links dist --force-reinstall
503-
pytest
492+
# typing-extensions isn't automatically installed because of `--no-index --no-deps`
493+
python3 -m pip install -U pip typing-extensions
494+
python3 -m pip install -r tests/requirements.txt
495+
python3 -m pip install pydantic-core --no-index --no-deps --find-links dist --force-reinstall
496+
python3 -m pytest
497+
python3 -c 'import pydantic_core._pydantic_core; print(pydantic_core._pydantic_core.__version__)'
504498
505499
test-builds-os:
506500
name: test build on ${{ matrix.os }}

tests/test_hypothesis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import re
3+
import sys
34
from datetime import datetime, timezone
45
from typing import Optional
56

@@ -21,6 +22,7 @@ def test_datetime_datetime(datetime_schema, data):
2122
assert datetime_schema.validate_python(data) == data
2223

2324

25+
@pytest.mark.skipif(sys.platform == 'win32', reason='Can fail on windows, I guess due to 64-bit issue')
2426
@given(strategies.integers(min_value=-11_676_096_000, max_value=253_402_300_799_000))
2527
def test_datetime_int(datetime_schema, data):
2628
try:
@@ -82,6 +84,7 @@ class BranchModel(TypedDict):
8284
sub_branch: Optional['BranchModel']
8385

8486

87+
@pytest.mark.skipif(sys.platform == 'emscripten', reason='Seems to fail sometimes on pyodide no idea why')
8588
@given(strategies.from_type(BranchModel))
8689
def test_recursive(recursive_schema, data):
8790
assert recursive_schema.validate_python(data) == data

0 commit comments

Comments
 (0)
0