From 60baab0dd7a82b223c4620b6ebd0b02c6d2ee234 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:09:23 +0300 Subject: [PATCH 1/9] Remove unused imports --- src/snappy/snappy.py | 2 -- test_snappy.py | 1 - 2 files changed, 3 deletions(-) diff --git a/src/snappy/snappy.py b/src/snappy/snappy.py index 6bd2b8b..d78c1e7 100644 --- a/src/snappy/snappy.py +++ b/src/snappy/snappy.py @@ -41,8 +41,6 @@ """ from __future__ import absolute_import -import struct - import cramjam _CHUNK_MAX = 65536 diff --git a/test_snappy.py b/test_snappy.py index 68e4359..0585811 100644 --- a/test_snappy.py +++ b/test_snappy.py @@ -31,7 +31,6 @@ import sys import random import snappy -import struct from unittest import TestCase From 8be5d72938938aeae863afd01ad3799a5c1f905e Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:13:08 +0300 Subject: [PATCH 2/9] Mention required 'flush' in stream_decompress documentation --- src/snappy/snappy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/snappy/snappy.py b/src/snappy/snappy.py index d78c1e7..973d7c7 100644 --- a/src/snappy/snappy.py +++ b/src/snappy/snappy.py @@ -298,8 +298,8 @@ def stream_decompress(src, support the read method, and 'dst' should support the write method. The default blocksize is good for almost every scenario. - :param decompressor_cls: class that implements `decompress` method like - StreamDecompressor in the module + :param decompressor_cls: class that implements `decompress` and + `flush` methods like StreamDecompressor in the module :param start_chunk: start block of data that have already been read from the input stream (to detect the format, for example) """ From 3185f97d7b08e15574fee9a731d97e4da1c18cb7 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:25:59 +0300 Subject: [PATCH 3/9] Switch to HTTPS URLs in documentation --- README.rst | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 04d02ba..e3d8982 100644 --- a/README.rst +++ b/README.rst @@ -65,4 +65,4 @@ You can get help by running Snappy - compression library from Google (c) - http://google.github.io/snappy \ No newline at end of file + https://google.github.io/snappy diff --git a/setup.py b/setup.py index 3bfe8f8..42b2a85 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ long_description = """ Python bindings for the snappy compression library from Google. -More details about Snappy library: http://google.github.io/snappy +More details about Snappy library: https://google.github.io/snappy """ packages = ['snappy'] @@ -47,7 +47,7 @@ version=version, author='Andres Moreira', author_email='andres@andresmoreira.com', - url='http://github.com/intake/python-snappy', + url='https://github.com/intake/python-snappy', description='Python library for the snappy compression library from Google', long_description=long_description, keywords='snappy, compression, google', From 3b0c9f83a8637d478521ea37241e7096f91fdd22 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:29:37 +0300 Subject: [PATCH 4/9] Fix PyPI capitalization --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e3d8982..26a330b 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ Dependencies Install ======= -Install it from PyPi: +Install it from PyPI: :: From 9bbebd233db6c9bcf809d108c5e69e587523f8f8 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:30:12 +0300 Subject: [PATCH 5/9] Remove Python 2 test --- test_snappy.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test_snappy.py b/test_snappy.py index 0585811..d359d6f 100644 --- a/test_snappy.py +++ b/test_snappy.py @@ -69,12 +69,6 @@ def test_uncompress_error(self): self.assertRaises(snappy.UncompressError, snappy.uncompress, "hoa".encode('utf-8')) - if sys.version_info[0] == 2: - def test_unicode_compress(self): - text = "hello unicode world!".decode('utf-8') - compressed = snappy.compress(text) - self.assertEqual(text, snappy.uncompress(compressed)) - def test_decompress(self): # decompress == uncompress, just to support compatibility with zlib text = "hello world!".encode('utf-8') From d86448b582b4db38efc9f793e2f66a23eaf9811d Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:35:57 +0300 Subject: [PATCH 6/9] Enforce minimum Python version --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 42b2a85..0447ee4 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,7 @@ 'Programming Language :: Python :: 3.12', ], packages=packages, + python_requires=">=3.8", install_requires=install_requires, setup_requires=setup_requires, package_dir={'': 'src'}, From 73d5e0f030ca7d725b98e523fa20ddd707f05863 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Thu, 10 Oct 2024 23:38:09 +0300 Subject: [PATCH 7/9] Link to correct BSD license --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 26a330b..42b20a8 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ python-snappy Python library for the snappy compression library from Google. This library is distributed under the New BSD License -(http://www.opensource.org/licenses/bsd-license.php). +(https://opensource.org/license/bsd-3-clause). Dependencies ============ From bbb58e2021cb4ed6c7ab3d5fca3c42443da14116 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Wed, 16 Oct 2024 09:57:04 +0300 Subject: [PATCH 8/9] Update actions/upload-artifact to v4 --- .github/workflows/wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 7638402..a581491 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -41,7 +41,7 @@ jobs: run: pytest --verbose test_snappy.py - name: Archive sdist - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: wheels path: dist/python-snappy*.tar.gz From 0da0a69daa55e25b8ada4323a277729e17f0d03a Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Wed, 16 Oct 2024 16:14:14 -0400 Subject: [PATCH 9/9] another one --- .github/workflows/wheel.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index a581491..f36ea56 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -52,19 +52,19 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, macos-12, windows-2019] - architecture: ['x64'] + architecture: ["x64"] linux_archs: ["auto s390x"] include: - os: windows-2019 - architecture: 'x86' + architecture: "x86" skip: "*2*win* *win_amd64" environment_windows: INCLUDE="C:/Program Files (x86)/Snappy/include" LIB="C:/Program Files (x86)/Snappy/lib" - os: windows-2019 - architecture: 'x64' + architecture: "x64" skip: "*2*win* *win32" environment_windows: INCLUDE="C:/Program Files/Snappy/include" LIB="C:/Program Files/Snappy/lib" - os: ubuntu-20.04 - architecture: 'x64' + architecture: "x64" linux_archs: aarch64 ppc64le name: Python ${{ matrix.os }} @@ -94,7 +94,7 @@ jobs: uses: docker/setup-qemu-action@v1 with: platforms: all - + - name: Add msbuild to PATH if: runner.os == 'Windows' uses: microsoft/setup-msbuild@v1.0.2 @@ -108,7 +108,7 @@ jobs: run: | python -m pip wheel -w ./wheelhouse . - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl name: wheels @@ -116,7 +116,7 @@ jobs: upload: runs-on: ubuntu-latest name: upload wheels - needs: ['sdist', 'build'] + needs: ["sdist", "build"] if: startsWith(github.ref, 'refs/tags/0.') steps: - name: Download test data