Skip to content

Commit 24925a4

Browse files
authored
Merge pull request #52 from pycompression/release_0.6.1
Release 0.6.1
2 parents 707b145 + 32c8b9e commit 24925a4

File tree

7 files changed

+23
-12
lines changed

7 files changed

+23
-12
lines changed

.github/release_checklist.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ Release checklist
66
- [ ] Change current development version in `CHANGELOG.rst` to stable version.
77
- [ ] Change the version in `__init__.py`
88
- [ ] Merge the release branch into `main`.
9-
- [ ] Create a test pypi package from the main branch. ([Instructions.](
10-
https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives
11-
))
12-
- [ ] Install the packages from the test pypi repository to see if they work.
139
- [ ] Created an annotated tag with the stable version number. Include changes
1410
from CHANGELOG.rst.
15-
- [ ] Push tag to remote.
16-
- [ ] Push tested packages to pypi.
11+
- [ ] Push tag to remote. This triggers the wheel/sdist build on github CI.
1712
- [ ] merge `main` branch back into `develop`.
18-
- [ ] Add updated version number to develop.
13+
- [ ] Add updated version number to develop. (`setup.py` and `src/isal/__init__.py`)
1914
- [ ] Build the new tag on readthedocs. Only build the last patch version of
2015
each minor version. So `1.1.1` and `1.2.0` but not `1.1.0`, `1.1.1` and `1.2.0`.
2116
- [ ] Create a new release on github.

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version 0.6.1
11+
-----------------
12+
+ Fix a crash that occurs when opening a file that did not end in ``.gz`` while
13+
outputting to stdout using ``python -m isal.igzip``.
14+
1015
version 0.6.0
1116
-----------------
1217
+ ``python -m gzip``'s behaviour has been changed since fixing bug:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def build_isa_l():
152152

153153
setup(
154154
name="isal",
155-
version="0.6.0",
155+
version="0.6.1",
156156
description="Faster zlib and gzip compatible compression and "
157157
"decompression by providing python bindings for the ISA-L "
158158
"library.",

src/isal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"__version__"
4040
]
4141

42-
__version__ = "0.6.0"
42+
__version__ = "0.6.1"

src/isal/igzip.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ def main():
294294
in_file = IGzipFile(mode="rb", fileobj=sys.stdin.buffer)
295295
elif not args.compress and args.file is not None:
296296
base, extension = os.path.splitext(args.file)
297-
if extension != ".gz":
298-
sys.exit(f"filename doesn't end in .gz: {args.file!r}")
297+
if extension != ".gz" and not args.stdout:
298+
sys.exit(f"filename doesn't end in .gz: {args.file!r}. "
299+
f"Cannot determine output filename.")
299300
in_file = open(args.file, "rb")
300301

301302
# Determine output file

tests/test_gzip_compliance.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,8 @@ def test_decompress_infile_outfile(self):
823823
def test_decompress_infile_outfile_error(self):
824824
rc, out, err = assert_python_failure('-m', 'isal.igzip', '-d',
825825
'thisisatest.out')
826-
self.assertEqual(b"filename doesn't end in .gz: 'thisisatest.out'",
826+
self.assertEqual(b"filename doesn't end in .gz: 'thisisatest.out'. "
827+
b"Cannot determine output filename.",
827828
err.strip())
828829
self.assertEqual(rc, 1)
829830
self.assertEqual(out, b'')

tests/test_igzip.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ def test_decompress_infile_outfile_error(capsysbinary):
118118
assert out == b''
119119

120120

121+
def test_decompress_infile_stdout_noerror(capsysbinary, tmp_path):
122+
test_file = tmp_path / "test"
123+
test_file.write_bytes(COMPRESSED_DATA)
124+
sys.argv = ['', '-cd', str(tmp_path / 'test')]
125+
igzip.main()
126+
result = capsysbinary.readouterr()
127+
assert DATA == result.out
128+
129+
121130
def test_decompress_infile_stdout(capsysbinary, tmp_path):
122131
test_gz = tmp_path / "test.gz"
123132
test_gz.write_bytes(gzip.compress(DATA))

0 commit comments

Comments
 (0)