diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index e9deb1b8..79173023 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -53,7 +53,7 @@ jobs: CIBW_ENVIRONMENT_WINDOWS: > CMAKE_GENERATOR="${{ matrix.cmake_generator }}" CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}" - CIBW_SKIP: cp38-* cp314* *-musllinux_* + CIBW_SKIP: cp38-* *-musllinux_* CIBW_ARCHS: ${{ matrix.arch }} run: | python -m cibuildwheel --output-dir wheelhouse python/ diff --git a/python/pyproject.toml b/python/pyproject.toml index d755154c..d3de9f62 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -71,6 +71,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Physics", "Topic :: Software Development :: Libraries", diff --git a/python/segyio/trace.py b/python/segyio/trace.py index 9c378af7..4d92afc8 100644 --- a/python/segyio/trace.py +++ b/python/segyio/trace.py @@ -435,8 +435,14 @@ def flush(self): be useful in certain contexts to provide stronger guarantees. """ garbage = [] + # If there are no external references to the data (so only internal + # references remain), the reference count is + # - 2 (Python >= 3.14) + # - 3 (Python < 3.14) + garbage_threshold = 3 if sys.version_info < (3, 14) else 2 + for i, (x, signature) in self.refs.items(): - if sys.getrefcount(x) == 3: + if sys.getrefcount(x) == garbage_threshold: garbage.append(i) if fingerprint(x) == signature: continue