Skip to content

Commit

Permalink
Merge pull request #149 from salty-horse/cleanup
Browse files Browse the repository at this point in the history
Various small cleanup changes
  • Loading branch information
martindurant authored Oct 16, 2024
2 parents 6075461 + 0da0a69 commit e1c7c12
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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/[email protected]
Expand All @@ -108,15 +108,15 @@ jobs:
run: |
python -m pip wheel -w ./wheelhouse .
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheels

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
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
============
Expand All @@ -15,7 +15,7 @@ Dependencies
Install
=======

Install it from PyPi:
Install it from PyPI:

::

Expand Down Expand Up @@ -65,4 +65,4 @@ You can get help by running


Snappy - compression library from Google (c)
http://google.github.io/snappy
https://google.github.io/snappy
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -47,7 +47,7 @@
version=version,
author='Andres Moreira',
author_email='[email protected]',
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',
Expand All @@ -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'},
Expand Down
6 changes: 2 additions & 4 deletions src/snappy/snappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
"""
from __future__ import absolute_import

import struct

import cramjam

_CHUNK_MAX = 65536
Expand Down Expand Up @@ -300,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)
"""
Expand Down
7 changes: 0 additions & 7 deletions test_snappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import sys
import random
import snappy
import struct
from unittest import TestCase


Expand Down Expand Up @@ -70,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')
Expand Down

0 comments on commit e1c7c12

Please sign in to comment.