Skip to content

try testing and building for 3.12 #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12-dev'
- 'pypy3.7'
- 'pypy3.8'
- 'pypy3.9'
Expand Down Expand Up @@ -301,15 +302,15 @@ jobs:
platform: linux
- os: windows
ls: dir
interpreter: 3.7 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
- os: windows
ls: dir
target: i686
python-architecture: x86
interpreter: 3.7 3.8 3.9 3.10 3.11
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
- os: macos
target: aarch64
interpreter: 3.7 3.8 3.9 3.10 3.11
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
- os: ubuntu
platform: linux
target: i686
Expand All @@ -323,7 +324,7 @@ jobs:
platform: linux
target: armv7
container: messense/manylinux_2_24-cross:armv7
interpreter: 3.7 3.8 3.9 3.10 3.11
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
# musllinux
- os: ubuntu
platform: linux
Expand All @@ -337,12 +338,12 @@ jobs:
platform: linux
target: ppc64le
container: messense/manylinux_2_24-cross:ppc64le
interpreter: 3.7 3.8 3.9 3.10 3.11
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
- os: ubuntu
platform: linux
target: s390x
container: messense/manylinux_2_24-cross:s390x
interpreter: 3.7 3.8 3.9 3.10 3.11
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
exclude:
# Windows on arm64 only supports Python 3.11+
- os: windows
Expand Down Expand Up @@ -377,7 +378,7 @@ jobs:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 pypy3.7 pypy3.8 pypy3.9' }}
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' }}
rust-toolchain: stable
docker-options: -e CI

Expand Down
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ url = "2.3.1"
idna = "0.3.0"
base64 = "0.13.1"
num-bigint = "0.4.3"
python3-dll-a = "0.2.7"

[lib]
name = "_pydantic_core"
Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Rust',
'Framework :: Pydantic',
'Intended Audience :: Developers',
Expand Down Expand Up @@ -64,7 +65,13 @@ isort = { known-first-party = ['pydantic_core', 'tests'] }
[tool.pytest.ini_options]
testpaths = 'tests'
log_format = '%(name)s %(levelname)s: %(message)s'
filterwarnings = 'error'
filterwarnings = [
'error',
# Work around https://github.com/pytest-dev/pytest/issues/10977 for Python 3.12
'ignore:(ast\.Str|ast\.NameConstant|ast\.Num|Attribute s) is deprecated and will be removed.*:DeprecationWarning:',
# issue with pytz - https://github.com/stub42/pytz/issues/105 for Python 3.12
'ignore:datetime\.utcfromtimestamp\(\) is deprecated.*:DeprecationWarning:',
]
timeout = 30
xfail_strict = true
# min, max, mean, stddev, median, iqr, outliers, ops, rounds, iterations
Expand Down
2 changes: 1 addition & 1 deletion tests/benchmarks/test_micro_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class CoreModel:

@pytest.fixture(scope='class')
def datetime_raw(self):
return datetime.utcnow().replace(tzinfo=timezone.utc) + timedelta(days=1)
return datetime.now(timezone.utc) + timedelta(days=1)

@pytest.fixture(scope='class')
def datetime_str(self, datetime_raw):
Expand Down
2 changes: 1 addition & 1 deletion tests/validators/test_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_date_future(py_and_json: PyAndJson, input_value, expected):

def test_date_past_future_today():
v = SchemaValidator(core_schema.date_schema(now_op='past', now_utc_offset=0))
today = datetime.utcnow().replace(tzinfo=timezone.utc).date()
today = datetime.now(timezone.utc).date()
assert v.isinstance_python(today) is False
assert v.isinstance_python(today - timedelta(days=1)) is True
assert v.isinstance_python(today + timedelta(days=1)) is False
Expand Down
8 changes: 4 additions & 4 deletions tests/validators/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def test_datetime_past(py_and_json: PyAndJson, input_value, expected):

def test_datetime_past_timezone():
v = SchemaValidator(core_schema.datetime_schema(now_utc_offset=0, now_op='past'))
now_utc = datetime.utcnow().replace(tzinfo=timezone.utc) - timedelta(seconds=1)
now_utc = datetime.now(timezone.utc) - timedelta(seconds=1)
assert v.isinstance_python(now_utc)
# "later" in the day
assert v.isinstance_python(now_utc.astimezone(pytz.timezone('Europe/Istanbul')))
Expand Down Expand Up @@ -350,7 +350,7 @@ def test_datetime_future(py_and_json: PyAndJson, input_value, expected):

def test_datetime_future_timezone():
v = SchemaValidator(core_schema.datetime_schema(now_utc_offset=0, now_op='future'))
now_utc = datetime.utcnow().replace(tzinfo=timezone.utc)
now_utc = datetime.now(timezone.utc)

soon_utc = now_utc + timedelta(minutes=1)
assert v.isinstance_python(soon_utc)
Expand All @@ -376,10 +376,10 @@ def test_mock_utc_offset_8_hours(mocker):
"""
mocker.patch('time.localtime', return_value=type('time.struct_time', (), {'tm_gmtoff': 8 * 60 * 60}))
v = SchemaValidator(core_schema.datetime_schema(now_op='future'))
future = datetime.utcnow() + timedelta(hours=8, minutes=1)
future = datetime.now(timezone.utc).replace(tzinfo=None) + timedelta(hours=8, minutes=1)
assert v.isinstance_python(future)

future = datetime.utcnow() + timedelta(hours=7, minutes=59)
future = datetime.now(timezone.utc).replace(tzinfo=None) + timedelta(hours=7, minutes=59)
assert not v.isinstance_python(future)


Expand Down