Skip to content

Commit 1286090

Browse files
authored
Merge pull request #656 from ajaust/enable-py314
Introduce support for Python 3.14
2 parents 6aa6c2f + 252acc4 commit 1286090

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/wheels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
CIBW_ENVIRONMENT_WINDOWS: >
5454
CMAKE_GENERATOR="${{ matrix.cmake_generator }}"
5555
CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}"
56-
CIBW_SKIP: cp38-* cp314* *-musllinux_*
56+
CIBW_SKIP: cp38-* *-musllinux_*
5757
CIBW_ARCHS: ${{ matrix.arch }}
5858
run: |
5959
python -m cibuildwheel --output-dir wheelhouse python/

python/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ classifiers = [
7171
"Programming Language :: Python :: 3.11",
7272
"Programming Language :: Python :: 3.12",
7373
"Programming Language :: Python :: 3.13",
74+
"Programming Language :: Python :: 3.14",
7475
"Topic :: Scientific/Engineering",
7576
"Topic :: Scientific/Engineering :: Physics",
7677
"Topic :: Software Development :: Libraries",

python/segyio/trace.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,14 @@ def flush(self):
435435
be useful in certain contexts to provide stronger guarantees.
436436
"""
437437
garbage = []
438+
# If there are no external references to the data (so only internal
439+
# references remain), the reference count is
440+
# - 2 (Python >= 3.14)
441+
# - 3 (Python < 3.14)
442+
garbage_threshold = 3 if sys.version_info < (3, 14) else 2
443+
438444
for i, (x, signature) in self.refs.items():
439-
if sys.getrefcount(x) == 3:
445+
if sys.getrefcount(x) == garbage_threshold:
440446
garbage.append(i)
441447

442448
if fingerprint(x) == signature: continue

0 commit comments

Comments
 (0)