Skip to content

Commit e1c7c12

Browse files
authored
Merge pull request intake#149 from salty-horse/cleanup
Various small cleanup changes
2 parents 6075461 + 0da0a69 commit e1c7c12

File tree

5 files changed

+16
-24
lines changed

5 files changed

+16
-24
lines changed

.github/workflows/wheel.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: pytest --verbose test_snappy.py
4242

4343
- name: Archive sdist
44-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v4
4545
with:
4646
name: wheels
4747
path: dist/python-snappy*.tar.gz
@@ -52,19 +52,19 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
os: [ubuntu-20.04, macos-12, windows-2019]
55-
architecture: ['x64']
55+
architecture: ["x64"]
5656
linux_archs: ["auto s390x"]
5757
include:
5858
- os: windows-2019
59-
architecture: 'x86'
59+
architecture: "x86"
6060
skip: "*2*win* *win_amd64"
6161
environment_windows: INCLUDE="C:/Program Files (x86)/Snappy/include" LIB="C:/Program Files (x86)/Snappy/lib"
6262
- os: windows-2019
63-
architecture: 'x64'
63+
architecture: "x64"
6464
skip: "*2*win* *win32"
6565
environment_windows: INCLUDE="C:/Program Files/Snappy/include" LIB="C:/Program Files/Snappy/lib"
6666
- os: ubuntu-20.04
67-
architecture: 'x64'
67+
architecture: "x64"
6868
linux_archs: aarch64 ppc64le
6969

7070
name: Python ${{ matrix.os }}
@@ -94,7 +94,7 @@ jobs:
9494
uses: docker/setup-qemu-action@v1
9595
with:
9696
platforms: all
97-
97+
9898
- name: Add msbuild to PATH
9999
if: runner.os == 'Windows'
100100
uses: microsoft/[email protected]
@@ -108,15 +108,15 @@ jobs:
108108
run: |
109109
python -m pip wheel -w ./wheelhouse .
110110
111-
- uses: actions/upload-artifact@v2
111+
- uses: actions/upload-artifact@v4
112112
with:
113113
path: ./wheelhouse/*.whl
114114
name: wheels
115115

116116
upload:
117117
runs-on: ubuntu-latest
118118
name: upload wheels
119-
needs: ['sdist', 'build']
119+
needs: ["sdist", "build"]
120120
if: startsWith(github.ref, 'refs/tags/0.')
121121
steps:
122122
- name: Download test data

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ python-snappy
33

44
Python library for the snappy compression library from Google.
55
This library is distributed under the New BSD License
6-
(http://www.opensource.org/licenses/bsd-license.php).
6+
(https://opensource.org/license/bsd-3-clause).
77

88
Dependencies
99
============
@@ -15,7 +15,7 @@ Dependencies
1515
Install
1616
=======
1717

18-
Install it from PyPi:
18+
Install it from PyPI:
1919

2020
::
2121

@@ -65,4 +65,4 @@ You can get help by running
6565

6666

6767
Snappy - compression library from Google (c)
68-
http://google.github.io/snappy
68+
https://google.github.io/snappy

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
long_description = """
3636
Python bindings for the snappy compression library from Google.
3737
38-
More details about Snappy library: http://google.github.io/snappy
38+
More details about Snappy library: https://google.github.io/snappy
3939
"""
4040

4141
packages = ['snappy']
@@ -47,7 +47,7 @@
4747
version=version,
4848
author='Andres Moreira',
4949
author_email='[email protected]',
50-
url='http://github.com/intake/python-snappy',
50+
url='https://github.com/intake/python-snappy',
5151
description='Python library for the snappy compression library from Google',
5252
long_description=long_description,
5353
keywords='snappy, compression, google',
@@ -71,6 +71,7 @@
7171
'Programming Language :: Python :: 3.12',
7272
],
7373
packages=packages,
74+
python_requires=">=3.8",
7475
install_requires=install_requires,
7576
setup_requires=setup_requires,
7677
package_dir={'': 'src'},

src/snappy/snappy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
"""
4242
from __future__ import absolute_import
4343

44-
import struct
45-
4644
import cramjam
4745

4846
_CHUNK_MAX = 65536
@@ -300,8 +298,8 @@ def stream_decompress(src,
300298
support the read method, and 'dst' should support the write method.
301299
302300
The default blocksize is good for almost every scenario.
303-
:param decompressor_cls: class that implements `decompress` method like
304-
StreamDecompressor in the module
301+
:param decompressor_cls: class that implements `decompress` and
302+
`flush` methods like StreamDecompressor in the module
305303
:param start_chunk: start block of data that have already been read from
306304
the input stream (to detect the format, for example)
307305
"""

test_snappy.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import sys
3232
import random
3333
import snappy
34-
import struct
3534
from unittest import TestCase
3635

3736

@@ -70,12 +69,6 @@ def test_uncompress_error(self):
7069
self.assertRaises(snappy.UncompressError, snappy.uncompress,
7170
"hoa".encode('utf-8'))
7271

73-
if sys.version_info[0] == 2:
74-
def test_unicode_compress(self):
75-
text = "hello unicode world!".decode('utf-8')
76-
compressed = snappy.compress(text)
77-
self.assertEqual(text, snappy.uncompress(compressed))
78-
7972
def test_decompress(self):
8073
# decompress == uncompress, just to support compatibility with zlib
8174
text = "hello world!".encode('utf-8')

0 commit comments

Comments
 (0)