Skip to content
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
16 changes: 5 additions & 11 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ jobs:
strategy:
matrix:
pyver:
- 3.13-freethreading
- 3.14t
- 3.14
- 3.13t
- 3.13
- 3.12
- 3.11
Expand All @@ -191,9 +193,9 @@ jobs:
- os: windows
no-extensions: Y
- os: macos
pyver: 3.13-freethreading # this is still tested within cibuildwheel
pyver: 3.13t # this is still tested within cibuildwheel
- os: windows
pyver: 3.13-freethreading # this is still tested within cibuildwheel
pyver: 3.13t # this is still tested within cibuildwheel
- no-extensions: Y
debug: Y
include:
Expand Down Expand Up @@ -237,18 +239,10 @@ jobs:
path: dist

- name: Setup Python ${{ matrix.pyver }}
if: >-
!endsWith(matrix.pyver, '-freethreading')
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}
allow-prereleases: true
- name: Setup Python ${{ matrix.pyver }}
if: endsWith(matrix.pyver, '-freethreading')
uses: deadsnakes/[email protected]
with:
python-version: 3.13-dev
nogil: true
- name: Compute runtime Python version
id: python-install
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v3.0.0
uses: pypa/cibuildwheel@v3.1.4
with:
package-dir: >- # not necessarily a dir, we pass an acceptable sdist
dist/${{ inputs.source-tarball-name }}
Expand Down
1 change: 1 addition & 0 deletions CHANGES/1235.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated tests and added CI for CPython 3.14 -- by :user:`kumaraditya303`.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ classifiers =
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14

[options]
python_requires = >= 3.9
Expand Down
4 changes: 3 additions & 1 deletion tests/isolated/multidict_pop.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ def get_memory_usage() -> int:
return memory_info.rss / (1024 * 1024) # type: ignore[no-any-return]


initial_memory_usage = get_memory_usage()

keys = [f"X-Any-{i}" for i in range(100)]
headers = {key: key * 2 for key in keys}


def check_for_leak() -> None:
trim_ram()
usage = get_memory_usage()
usage = get_memory_usage() - initial_memory_usage
assert usage < 50, f"Memory leaked at: {usage} MB"


Expand Down
15 changes: 6 additions & 9 deletions tests/test_istr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest

IMPLEMENTATION = getattr(sys, "implementation") # to suppress mypy error
GIL_ENABLED = getattr(sys, "_is_gil_enabled", lambda: True)()


def test_ctor(case_insensitive_str_class: Type[str]) -> None:
Expand Down Expand Up @@ -64,16 +63,14 @@ def _create_strs() -> None:
IMPLEMENTATION.name != "cpython",
reason="PyPy has different GC implementation",
)
@pytest.mark.skipif(
not GIL_ENABLED,
reason="free threading has different GC implementation",
)
def test_leak(create_istrs: Callable[[], None]) -> None:
def test_leak(
create_istrs: Callable[[], None], case_insensitive_str_class: Type[str]
) -> None:
gc.collect()
cnt = len(gc.get_objects())
for _ in range(10000):
create_istrs()

gc.collect()
cnt2 = len(gc.get_objects())
assert abs(cnt - cnt2) < 10 # on other GC impls these numbers are not equal
assert not any(
isinstance(obj, case_insensitive_str_class) for obj in gc.get_objects()
)
Loading