Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-lz4 for openSUSE:Factory checked in at 2025-11-14 16:10:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-lz4 (Old) and /work/SRC/openSUSE:Factory/.python-lz4.new.2061 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-lz4" Fri Nov 14 16:10:52 2025 rev:16 rq:1317438 version:4.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-lz4/python-lz4.changes 2025-09-11 14:39:21.119825702 +0200 +++ /work/SRC/openSUSE:Factory/.python-lz4.new.2061/python-lz4.changes 2025-11-14 16:10:53.095175604 +0100 @@ -1,0 +2,13 @@ +Wed Nov 12 14:42:31 UTC 2025 - John Paul Adrian Glaubitz <[email protected]> + +- Update to 4.4.5 + * Enable CPython free-threaded wheel builds + * Correct the import of _compression for Python 3.14 + * Keep GitHub Actions up to date with GitHub's Dependabot + * Build wheels for Python 3.14 + * Fix typos discovered by codespell + * Bump pypa/cibuildwheel from 3.2.0 to 3.2.1 in the + github-actions group across 1 directory +- Drop py314.patch, merged upstream + +------------------------------------------------------------------- Old: ---- lz4-4.4.4.tar.gz py314.patch New: ---- lz4-4.4.5.tar.gz ----------(Old B)---------- Old: github-actions group across 1 directory - Drop py314.patch, merged upstream ----------(Old E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-lz4.spec ++++++ --- /var/tmp/diff_new_pack.Jifp5x/_old 2025-11-14 16:10:54.211222438 +0100 +++ /var/tmp/diff_new_pack.Jifp5x/_new 2025-11-14 16:10:54.215222605 +0100 @@ -18,15 +18,13 @@ %{?sle15_python_module_pythons} Name: python-lz4 -Version: 4.4.4 +Version: 4.4.5 Release: 0 Summary: LZ4 Bindings for Python License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/python-lz4/python-lz4 Source: https://files.pythonhosted.org/packages/source/l/lz4/lz4-%{version}.tar.gz -# PATCH-FIX-UPSTREAM https://github.com/python-lz4/python-lz4/pull/303 Correct the import of _compression for Python 3.14 -Patch0: py314.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module pkgconfig} ++++++ lz4-4.4.4.tar.gz -> lz4-4.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/.github/dependabot.yml new/lz4-4.4.5/.github/dependabot.yml --- old/lz4-4.4.4/.github/dependabot.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/lz4-4.4.5/.github/dependabot.yml 2025-11-03 13:29:03.000000000 +0100 @@ -0,0 +1,13 @@ +# Keep GitHub Actions up to date with GitHub's Dependabot... +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot +# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + groups: + github-actions: + patterns: + - "*" # Group all Actions updates into a single larger pull request + schedule: + interval: weekly diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/.github/workflows/build_dist.yml new/lz4-4.4.5/.github/workflows/build_dist.yml --- old/lz4-4.4.4/.github/workflows/build_dist.yml 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/.github/workflows/build_dist.yml 2025-11-03 13:29:03.000000000 +0100 @@ -19,11 +19,11 @@ runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work + fetch-depth: 0 # To ensure tags are retrieved to enable setuptools_scm to work - name: Install Python 3.x - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.x - name: Build sdist @@ -45,17 +45,17 @@ matrix: os: - ubuntu-latest - - macos-13 # x86 + - macos-15-intel # x86 - macos-latest # arm - windows-latest - cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*] + cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*, cp313t-*, cp314-*] steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work + fetch-depth: 0 # To ensure tags are retrieved to enable setuptools_scm to work - name: Install Python 3.x - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.x - name: Set up QEMU # Needed to build aarch64 wheels @@ -63,17 +63,30 @@ uses: docker/setup-qemu-action@v3 with: platforms: all + + - name: Setup free-threading variables + if: ${{ endsWith(matrix.cibw_build, 't-*') }} + shell: bash -l {0} + run: | + echo "CIBW_BEFORE_TEST=pip install pytest pytest-run-parallel" >> "$GITHUB_ENV" + echo "CIBW_ENVIRONMENT=PYLZ4_USE_SYSTEM_LZ4=False PYTEST_ADDOPTS=--parallel-threads=4" >> "$GITHUB_ENV" + echo "CIBW_TEST_COMMAND=tox -x testenv.deps+=pytest-run-parallel -x testenv.pass_env+=PYTEST_ADDOPTS -c {project}" >> "$GITHUB_ENV" + - name: Setup environment + if: ${{ !endsWith(matrix.cibw_build, 't-*') }} + shell: bash -l {0} + run: | + echo "CIBW_ENVIRONMENT=PYLZ4_USE_SYSTEM_LZ4=False" >> "$GITHUB_ENV" + echo "CIBW_TEST_COMMAND=tox -c {project}" >> "$GITHUB_ENV" - name: Build wheels - uses: pypa/[email protected] + uses: pypa/[email protected] env: - CIBW_ENVIRONMENT: PYLZ4_USE_SYSTEM_LZ4="False" # CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" CIBW_ARCHS_LINUX: "x86_64 i686" CIBW_ARCHS_MACOS: "auto64" # since we have both runner arches CIBW_ARCHS_WINDOWS: "AMD64 x86 ARM64" + CIBW_ENABLE: cpython-freethreading CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_SKIP: "cp*-musllinux*" - CIBW_TEST_COMMAND: "tox -c {project}" CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-*linux_{ppc64le,s390x} *-win_arm64" CIBW_BEFORE_BUILD: "python -m pip install -U pip && python -m pip install tox" - name: Save wheels @@ -93,24 +106,38 @@ matrix: os: - ubuntu-24.04-arm - cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*] + cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*, cp313t-*, cp314-*] steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work + fetch-depth: 0 # To ensure tags are retrieved to enable setuptools_scm to work - name: Install Python 3.x - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.x + - name: Setup free-threading variables + if: ${{ endsWith(matrix.cibw_build, 't-*') }} + shell: bash -l {0} + run: | + # Variables are set in order to be passed down to both cibuildwheel and the + # Docker image spawned by that action + echo "CIBW_BEFORE_TEST=pip install pytest pytest-run-parallel" >> "$GITHUB_ENV" + echo "CIBW_ENVIRONMENT=PYLZ4_USE_SYSTEM_LZ4=False PYTEST_ADDOPTS=--parallel-threads=1" >> "$GITHUB_ENV" + echo "CIBW_TEST_COMMAND=tox -x testenv.deps+=pytest-run-parallel -x testenv.pass_env+=PYTEST_ADDOPTS -c {project}" >> "$GITHUB_ENV" + - name: Setup environment + if: ${{ !endsWith(matrix.cibw_build, 't-*') }} + shell: bash -l {0} + run: | + echo "CIBW_ENVIRONMENT=PYLZ4_USE_SYSTEM_LZ4=False" >> "$GITHUB_ENV" + echo "CIBW_TEST_COMMAND=tox -c {project}" >> "$GITHUB_ENV" - name: Build wheels - uses: pypa/[email protected] + uses: pypa/[email protected] env: - CIBW_ENVIRONMENT: PYLZ4_USE_SYSTEM_LZ4="False" - CIBW_ARCHS_LINUX: "aarch64 armv7l" + CIBW_ARCHS_LINUX: "aarch64" CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_SKIP: "cp*-musllinux*" - CIBW_TEST_COMMAND: "tox -c {project}" + CIBW_ENABLE: cpython-freethreading CIBW_BEFORE_BUILD: "python -m pip install -U pip && python -m pip install tox" - name: Save wheels uses: actions/upload-artifact@v4 @@ -124,7 +151,7 @@ runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: pattern: cibw-* path: dist diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/PKG-INFO new/lz4-4.4.5/PKG-INFO --- old/lz4-4.4.4/PKG-INFO 2025-04-02 00:34:34.668321100 +0200 +++ new/lz4-4.4.5/PKG-INFO 2025-11-03 13:29:10.372120100 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: lz4 -Version: 4.4.4 +Version: 4.4.5 Summary: LZ4 Bindings for Python Home-page: https://github.com/python-lz4/python-lz4 Author: Jonathan Underwood diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/_version.c new/lz4-4.4.5/lz4/_version.c --- old/lz4-4.4.4/lz4/_version.c 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/lz4/_version.c 2025-11-03 13:29:03.000000000 +0100 @@ -113,5 +113,9 @@ if (module == NULL) return NULL; + #ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); + #endif + return module; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/block/_block.c new/lz4-4.4.5/lz4/block/_block.c --- old/lz4-4.4.4/lz4/block/_block.c 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/lz4/block/_block.c 2025-11-03 13:29:03.000000000 +0100 @@ -518,5 +518,9 @@ Py_INCREF(LZ4BlockError); PyModule_AddObject(module, "LZ4BlockError", LZ4BlockError); + #ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); + #endif + return module; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/frame/__init__.py new/lz4-4.4.5/lz4/frame/__init__.py --- old/lz4-4.4.4/lz4/frame/__init__.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/lz4/frame/__init__.py 2025-11-03 13:29:03.000000000 +0100 @@ -25,9 +25,9 @@ __doc__ = _doc try: - import _compression # Python 3.6 and later + import compression._common._streams as _compression # Python 3.14 except ImportError: - from . import _compression + import _compression # Python 3.9 - 3.13 BLOCKSIZE_DEFAULT = _BLOCKSIZE_DEFAULT @@ -268,7 +268,7 @@ This returns a ``bytes`` or ``bytearray`` object containing any data stored in the compressor's internal buffers and a frame footer. - The LZ4FrameCompressor instance may be re-used after this method has + The LZ4FrameCompressor instance may be reused after this method has been called to create a new frame of compressed data. Returns: @@ -287,7 +287,7 @@ def reset(self): """Reset the `LZ4FrameCompressor` instance. - This allows the `LZ4FrameCompression` instance to be re-used after an + This allows the `LZ4FrameCompression` instance to be reused after an error. """ @@ -360,7 +360,7 @@ def reset(self): """Reset the decompressor state. - This is useful after an error occurs, allowing re-use of the instance. + This is useful after an error occurs, allowing reuse of the instance. """ reset_decompression_context(self._context) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/frame/_frame.c new/lz4-4.4.5/lz4/frame/_frame.c --- old/lz4-4.4.4/lz4/frame/_frame.c 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/lz4/frame/_frame.c 2025-11-03 13:29:03.000000000 +0100 @@ -1330,7 +1330,7 @@ ); #define COMPRESS_KWARGS_DOCSTRING \ - " block_size (int): Sepcifies the maximum blocksize to use.\n" \ + " block_size (int): Specifies the maximum blocksize to use.\n" \ " Options:\n\n" \ " - `lz4.frame.BLOCKSIZE_DEFAULT`: the lz4 library default\n" \ " - `lz4.frame.BLOCKSIZE_MAX64KB`: 64 kB\n" \ @@ -1466,7 +1466,7 @@ "data will also be included in the returned data.\n" \ "\n" \ "If the ``end_frame`` argument is ``True``, the compression context will be\n" \ - "reset and can be re-used.\n" \ + "reset and can be reused.\n" \ "\n" \ "Args:\n" \ " context (cCtx): Compression context\n" \ @@ -1677,5 +1677,9 @@ PyModule_AddIntConstant (module, "BLOCKSIZE_MAX1MB", LZ4F_max1MB); PyModule_AddIntConstant (module, "BLOCKSIZE_MAX4MB", LZ4F_max4MB); + #ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); + #endif + return module; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/stream/__init__.py new/lz4-4.4.5/lz4/stream/__init__.py --- old/lz4-4.4.4/lz4/stream/__init__.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/lz4/stream/__init__.py 2025-11-03 13:29:03.000000000 +0100 @@ -32,7 +32,7 @@ perform decompression using this initial dictionary. Raises: - Exceptions occuring during the context initialization. + Exceptions occurring during the context initialization. OverflowError: raised if the ``dictionary`` parameter is too large for the LZ4 context. @@ -73,7 +73,7 @@ bytes or bytearray: Decompressed data. Raises: - Exceptions occuring during decompression. + Exceptions occurring during decompression. ValueError: raised if the source is inconsistent with a finite LZ4 stream block chain. @@ -96,7 +96,7 @@ bytes or bytearray: LZ4 compressed data block. Raises: - Exceptions occuring while getting the first block from ``stream``. + Exceptions occurring while getting the first block from ``stream``. BufferError: raised if the function cannot return a complete LZ4 compressed block from the stream (i.e. the stream does not hold @@ -150,7 +150,7 @@ perform compression using this initial dictionary. Raises: - Exceptions occuring during the context initialization. + Exceptions occurring during the context initialization. OverflowError: raised if the ``dictionary`` parameter is too large for the LZ4 context. @@ -194,7 +194,7 @@ bytes or bytearray: Compressed data. Raises: - Exceptions occuring during compression. + Exceptions occurring during compression. OverflowError: raised if the source is too large for being compressed in the given context. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/stream/_stream.c new/lz4-4.4.5/lz4/stream/_stream.c --- old/lz4-4.4.4/lz4/stream/_stream.c 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/lz4/stream/_stream.c 2025-11-03 13:29:03.000000000 +0100 @@ -931,7 +931,7 @@ context->output.len = buffer_size; total_size = context->output.len; - /* Here we cannot assert the maximal theorical decompressed chunk length + /* Here we cannot assert the maximal theoretical decompressed chunk length * will fit in one page of the double_buffer, i.e.: * assert( !(double_buffer.page_size < _LZ4_inputBound(store_max_size)) ) * @@ -1649,5 +1649,9 @@ Py_INCREF (LZ4StreamError); PyModule_AddObject (module, "LZ4StreamError", LZ4StreamError); + #ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); + #endif + return module; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4/version.py new/lz4-4.4.5/lz4/version.py --- old/lz4-4.4.4/lz4/version.py 2025-04-02 00:34:34.000000000 +0200 +++ new/lz4-4.4.5/lz4/version.py 2025-11-03 13:29:10.000000000 +0100 @@ -1,7 +1,14 @@ # file generated by setuptools-scm # don't change, don't track in version control -__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"] +__all__ = [ + "__version__", + "__version_tuple__", + "version", + "version_tuple", + "__commit_id__", + "commit_id", +] TYPE_CHECKING = False if TYPE_CHECKING: @@ -9,13 +16,19 @@ from typing import Union VERSION_TUPLE = Tuple[Union[int, str], ...] + COMMIT_ID = Union[str, None] else: VERSION_TUPLE = object + COMMIT_ID = object version: str __version__: str __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE +commit_id: COMMIT_ID +__commit_id__: COMMIT_ID -__version__ = version = '4.4.4' -__version_tuple__ = version_tuple = (4, 4, 4) +__version__ = version = '4.4.5' +__version_tuple__ = version_tuple = (4, 4, 5) + +__commit_id__ = commit_id = 'g59b2d8176' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4.egg-info/PKG-INFO new/lz4-4.4.5/lz4.egg-info/PKG-INFO --- old/lz4-4.4.4/lz4.egg-info/PKG-INFO 2025-04-02 00:34:34.000000000 +0200 +++ new/lz4-4.4.5/lz4.egg-info/PKG-INFO 2025-11-03 13:29:10.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: lz4 -Version: 4.4.4 +Version: 4.4.5 Summary: LZ4 Bindings for Python Home-page: https://github.com/python-lz4/python-lz4 Author: Jonathan Underwood diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/lz4.egg-info/SOURCES.txt new/lz4-4.4.5/lz4.egg-info/SOURCES.txt --- old/lz4-4.4.4/lz4.egg-info/SOURCES.txt 2025-04-02 00:34:34.000000000 +0200 +++ new/lz4-4.4.5/lz4.egg-info/SOURCES.txt 2025-11-03 13:29:10.000000000 +0100 @@ -8,6 +8,7 @@ setup.cfg setup.py tox.ini +.github/dependabot.yml .github/workflows/build_dist.yml docs/Makefile docs/conf.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/block/test_block_0.py new/lz4-4.4.5/tests/block/test_block_0.py --- old/lz4-4.4.4/tests/block/test_block_0.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/block/test_block_0.py 2025-11-03 13:29:03.000000000 +0100 @@ -1,6 +1,8 @@ import lz4.block from multiprocessing.pool import ThreadPool import sys +import copy +import pytest from functools import partial if sys.version_info <= (3, 2): import struct @@ -68,6 +70,13 @@ # Test single threaded usage with all valid variations of input def test_1(data, mode, store_size, c_return_bytearray, d_return_bytearray, dictionary): + if isinstance(data, memoryview): + data = memoryview(copy.deepcopy(data.obj)) + elif isinstance(data, bytearray): + data_x = bytearray() + data_x[:] = data + data = data_x + (c_kwargs, d_kwargs) = setup_kwargs( mode, store_size, c_return_bytearray, d_return_bytearray) @@ -79,10 +88,21 @@ # Test multi threaded usage with all valid variations of input [email protected]_unsafe def test_2(data, mode, store_size, dictionary): (c_kwargs, d_kwargs) = setup_kwargs(mode, store_size) - data_in = [data for i in range(32)] + def copy_buf(data): + if isinstance(data, memoryview): + data_x = memoryview(copy.deepcopy(data.obj)) + elif isinstance(data, bytearray): + data_x = bytearray() + data_x[:] = data + else: + data_x = data + return data_x + + data_in = [copy_buf(data) for i in range(32)] pool = ThreadPool(2) rt = partial(roundtrip, c_kwargs=c_kwargs, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/block/test_block_3.py new/lz4-4.4.5/tests/block/test_block_3.py --- old/lz4-4.4.4/tests/block/test_block_3.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/block/test_block_3.py 2025-11-03 13:29:03.000000000 +0100 @@ -18,6 +18,7 @@ return request.param [email protected]_unsafe def test_block_decompress_mem_usage(data): tracemalloc = pytest.importorskip('tracemalloc') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/frame/test_frame_2.py new/lz4-4.4.5/tests/frame/test_frame_2.py --- old/lz4-4.4.4/tests/frame/test_frame_2.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/frame/test_frame_2.py 2025-11-03 13:29:03.000000000 +0100 @@ -1,6 +1,7 @@ import lz4.frame as lz4frame import pytest import os +import copy import sys from . helpers import ( get_chunked, @@ -41,6 +42,13 @@ data, c_chunks, d_chunks = data + if isinstance(data, memoryview): + data = memoryview(copy.deepcopy(data.obj)) + elif isinstance(data, bytearray): + data_2 = bytearray() + data_2[:] = data + data = data_2 + c_context = lz4frame.create_compression_context() kwargs = {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/frame/test_frame_5.py new/lz4-4.4.5/tests/frame/test_frame_5.py --- old/lz4-4.4.4/tests/frame/test_frame_5.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/frame/test_frame_5.py 2025-11-03 13:29:03.000000000 +0100 @@ -8,6 +8,8 @@ (b'a' * 1024 * 1024), ] +pytestmark = pytest.mark.thread_unsafe + @pytest.fixture( params=test_data, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/frame/test_frame_6.py new/lz4-4.4.5/tests/frame/test_frame_6.py --- old/lz4-4.4.4/tests/frame/test_frame_6.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/frame/test_frame_6.py 2025-11-03 13:29:03.000000000 +0100 @@ -1,5 +1,6 @@ import os import pytest +import threading import lz4.frame as lz4frame test_data = [ @@ -33,40 +34,45 @@ return request.param -def test_lz4frame_open_write(data): - with lz4frame.open('testfile', mode='wb') as fp: +def test_lz4frame_open_write(tmp_path, data): + thread_id = threading.get_native_id() + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='wb') as fp: fp.write(data) -def test_lz4frame_open_write_read_defaults(data): - with lz4frame.open('testfile', mode='wb') as fp: +def test_lz4frame_open_write_read_defaults(tmp_path, data): + thread_id = threading.get_native_id() + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='wb') as fp: fp.write(data) - with lz4frame.open('testfile', mode='r') as fp: + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='r') as fp: data_out = fp.read() assert data_out == data -def test_lz4frame_open_write_read_text(): +def test_lz4frame_open_write_read_text(tmp_path): data = u'This is a test string' - with lz4frame.open('testfile', mode='wt') as fp: + thread_id = threading.get_native_id() + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='wt') as fp: fp.write(data) - with lz4frame.open('testfile', mode='rt') as fp: + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='rt') as fp: data_out = fp.read() assert data_out == data -def test_lz4frame_open_write_read_text_iter(): +def test_lz4frame_open_write_read_text_iter(tmp_path): data = u'This is a test string' - with lz4frame.open('testfile', mode='wt') as fp: + thread_id = threading.get_native_id() + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='wt') as fp: fp.write(data) data_out = '' - with lz4frame.open('testfile', mode='rt') as fp: + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='rt') as fp: for line in fp: data_out += line assert data_out == data def test_lz4frame_open_write_read( + tmp_path, data, compression_level, block_linked, @@ -91,29 +97,31 @@ kwargs['return_bytearray'] = return_bytearray kwargs['mode'] = 'wb' - with lz4frame.open('testfile', **kwargs) as fp: + thread_id = threading.get_native_id() + with lz4frame.open(tmp_path / f'testfile_{thread_id}', **kwargs) as fp: fp.write(data) - with lz4frame.open('testfile', mode='r') as fp: + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='r') as fp: data_out = fp.read() assert data_out == data -def test_lz4frame_flush(): +def test_lz4frame_flush(tmp_path): data_1 = b"This is a..." data_2 = b" test string!" + thread_id = threading.get_native_id() - with lz4frame.open("testfile", mode="w") as fp_write: + with lz4frame.open(tmp_path / f"testfile_{thread_id}", mode="w") as fp_write: fp_write.write(data_1) fp_write.flush() fp_write.write(data_2) - with lz4frame.open("testfile", mode="r") as fp_read: + with lz4frame.open(tmp_path / f"testfile_{thread_id}", mode="r") as fp_read: assert fp_read.read() == data_1 fp_write.flush() - with lz4frame.open("testfile", mode="r") as fp_read: + with lz4frame.open(tmp_path / f"testfile_{thread_id}", mode="r") as fp_read: assert fp_read.read() == data_1 + data_2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/frame/test_frame_8.py new/lz4-4.4.5/tests/frame/test_frame_8.py --- old/lz4-4.4.4/tests/frame/test_frame_8.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/frame/test_frame_8.py 2025-11-03 13:29:03.000000000 +0100 @@ -1,12 +1,14 @@ +import threading import lz4.frame as lz4frame -def test_lz4frame_open_write_read_text_iter(): +def test_lz4frame_open_write_read_text_iter(tmp_path): data = u'This is a test string' - with lz4frame.open('testfile', mode='wt') as fp: + thread_id = threading.get_native_id() + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='wt') as fp: fp.write(data) data_out = '' - with lz4frame.open('testfile', mode='rt') as fp: + with lz4frame.open(tmp_path / f'testfile_{thread_id}', mode='rt') as fp: for line in fp: data_out += line assert data_out == data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/frame/test_frame_9.py new/lz4-4.4.5/tests/frame/test_frame_9.py --- old/lz4-4.4.4/tests/frame/test_frame_9.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/frame/test_frame_9.py 2025-11-03 13:29:03.000000000 +0100 @@ -3,11 +3,12 @@ import io import pickle import sys +import threading import lz4.frame import pytest -def test_issue_172_1(): +def test_issue_172_1(tmp_path): """Test reproducer for issue 172 Issue 172 is a reported failure occurring on Windows 10 only. This bug was @@ -16,34 +17,38 @@ """ input_data = 8 * os.urandom(1024) - with lz4.frame.open('testfile_small', 'wb') as fp: + thread_id = threading.get_native_id() + + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'wb') as fp: bytes_written = fp.write(input_data) # noqa: F841 - with lz4.frame.open('testfile_small', 'rb') as fp: + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'rb') as fp: data = fp.read(10) assert len(data) == 10 -def test_issue_172_2(): +def test_issue_172_2(tmp_path): input_data = 9 * os.urandom(1024) - with lz4.frame.open('testfile_small', 'w') as fp: + thread_id = threading.get_native_id() + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'w') as fp: bytes_written = fp.write(input_data) # noqa: F841 - with lz4.frame.open('testfile_small', 'r') as fp: + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'r') as fp: data = fp.read(10) assert len(data) == 10 -def test_issue_172_3(): +def test_issue_172_3(tmp_path): input_data = 9 * os.urandom(1024) - with lz4.frame.open('testfile_small', 'wb') as fp: + thread_id = threading.get_native_id() + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'wb') as fp: bytes_written = fp.write(input_data) # noqa: F841 - with lz4.frame.open('testfile_small', 'rb') as fp: + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'rb') as fp: data = fp.read(10) assert len(data) == 10 - with lz4.frame.open('testfile_small', 'rb') as fp: + with lz4.frame.open(tmp_path / f'testfile_small_{thread_id}', 'rb') as fp: data = fp.read(16 * 1024 - 1) assert len(data) == 9 * 1024 assert data == input_data @@ -60,7 +65,7 @@ @pytest.mark.skipif( sys.version_info < (3, 8), - reason="PickleBuffer only availiable in Python 3.8 or greater" + reason="PickleBuffer only available in Python 3.8 or greater" ) def test_issue_227_2(): q = array.array('Q', [1, 2, 3, 4, 5]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/stream/test_stream_0.py new/lz4-4.4.5/tests/stream/test_stream_0.py --- old/lz4-4.4.4/tests/stream/test_stream_0.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/stream/test_stream_0.py 2025-11-03 13:29:03.000000000 +0100 @@ -96,6 +96,7 @@ # Test single threaded usage with all valid variations of input [email protected]_unsafe def test_1(data, strategy, mode, buffer_size, store_comp_size, c_return_bytearray, d_return_bytearray, dictionary): if buffer_size >= (1 << (8 * store_comp_size['store_comp_size'])): @@ -111,6 +112,6 @@ # Test multi threaded: # Not relevant in the lz4.stream case (the process is highly sequential, -# and re-use/share the same context from one input chunk to the next one). +# and reuse/share the same context from one input chunk to the next one). def test_2(data, strategy, mode, buffer_size, store_comp_size, dictionary): # noqa pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/stream/test_stream_1.py new/lz4-4.4.5/tests/stream/test_stream_1.py --- old/lz4-4.4.4/tests/stream/test_stream_1.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/stream/test_stream_1.py 2025-11-03 13:29:03.000000000 +0100 @@ -136,7 +136,7 @@ c_kwargs.update(store_comp_size) if store_comp_size['store_comp_size'] >= 4: - # No need for skiping this test case, since arguments check is + # No need for skipping this test case, since arguments check is # expecting to raise an error. # Make sure the page size is larger than what the input bound will be, @@ -169,7 +169,7 @@ # but still fit in 4 bytes d_kwargs['buffer_size'] -= 1 - # No failure expected during instanciation/initialization + # No failure expected during instantiation/initialization lz4.stream.LZ4StreamDecompressor(**d_kwargs) @@ -199,7 +199,7 @@ d_kwargs = {} d_kwargs['strategy'] = "double_buffer" - # No failure expected during instanciation/initialization + # No failure expected during instantiation/initialization d_kwargs['buffer_size'] = lz4.stream.LZ4_MAX_INPUT_SIZE if sys.maxsize < 0xffffffff: @@ -207,7 +207,7 @@ lz4.stream.LZ4StreamDecompressor(**d_kwargs) - # No failure expected during instanciation/initialization + # No failure expected during instantiation/initialization d_kwargs['buffer_size'] = lz4.stream.LZ4_MAX_INPUT_SIZE + 1 if sys.maxsize < 0xffffffff: @@ -215,7 +215,7 @@ lz4.stream.LZ4StreamDecompressor(**d_kwargs) - # No failure expected during instanciation/initialization + # No failure expected during instantiation/initialization d_kwargs['buffer_size'] = _4GB - 1 # 4GB - 1 (to fit in 4 bytes) if sys.maxsize < 0xffffffff: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lz4-4.4.4/tests/stream/test_stream_3.py new/lz4-4.4.5/tests/stream/test_stream_3.py --- old/lz4-4.4.4/tests/stream/test_stream_3.py 2025-04-02 00:34:29.000000000 +0200 +++ new/lz4-4.4.5/tests/stream/test_stream_3.py 2025-11-03 13:29:03.000000000 +0100 @@ -71,6 +71,7 @@ return request.param [email protected]_unsafe def test_block_decompress_mem_usage(data, buffer_size): kwargs = { 'strategy': "double_buffer",
