From 432f0ad5a561b5e14bddfd94c259b75276945da0 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Wed, 17 Oct 2018 22:45:46 +0200 Subject: [PATCH 1/6] don't test for 2.6 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d7e0a6ce..07ef1e34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: false language: python python: - - 2.6 - 2.7 - 3.4 - 3.5 From d38cc1185da4329cc30d81487eb4cfff1e48fe86 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Wed, 17 Oct 2018 22:46:07 +0200 Subject: [PATCH 2/6] update list of supported versions in README --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f5937a56..c7b83a4f 100644 --- a/README.rst +++ b/README.rst @@ -50,8 +50,7 @@ Numpy arrays. Dependencies ------------ -* Python 2.6 (requires packages listed in ``setup.py``) or Pythons - 2.7, 3.4, 3.5, 3.6 +* Pythons 2.7, 3.4, 3.5, 3.6 * `python-blosc `_ (provides Blosc) and `Numpy `_ (as listed in ``requirements.txt`` for running the code From 5df46371833c28148b5c17ee4748f18954085d37 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Wed, 17 Oct 2018 22:46:36 +0200 Subject: [PATCH 3/6] remove 2.6 dependencies from setup.py --- setup.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup.py b/setup.py index 70ffded6..92312d45 100644 --- a/setup.py +++ b/setup.py @@ -17,10 +17,6 @@ 'six', ] -# Dependencies for 2.6 -if sys.version_info[:2] < (2, 7): - install_requires += ['ordereddict', 'argparse', 'unittest2'] - tests_require = [ 'nose', 'cram>=0.6', From c3b09a59f734d13a5a6025322770d3908ea3788e Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Wed, 17 Oct 2018 22:47:13 +0200 Subject: [PATCH 4/6] update supported python versions in setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 92312d45..a63a47f5 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,6 @@ 'Topic :: System :: Archiving :: Compression', 'Topic :: Utilities', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', From 5794732152d3b11ab0161b778412fce35bc4c628 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Wed, 17 Oct 2018 22:47:28 +0200 Subject: [PATCH 5/6] update dependencies in test_requirements.txt --- test_requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/test_requirements.txt b/test_requirements.txt index 73f86c4e..2614608b 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -5,6 +5,3 @@ coverage coveralls twine wheel -unittest2; python_version == '2.6' -ordereddict; python_version =='2.6' -argparse; python_version =='2.6' From 261f4fa6299fcb4e913cdb5d307b7700b49cb599 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Wed, 17 Oct 2018 22:47:43 +0200 Subject: [PATCH 6/6] remove 2.6 compatability hacks --- bloscpack/append.py | 5 +---- bloscpack/file_io.py | 8 ++------ bloscpack/testutil.py | 5 +---- bloscpack/util.py | 7 ------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/bloscpack/append.py b/bloscpack/append.py index 7e2eeedb..5ffac81d 100644 --- a/bloscpack/append.py +++ b/bloscpack/append.py @@ -56,8 +56,6 @@ ) from .pretty import (double_pretty_size, ) -from .util import (open_two_file, - ) from . import log @@ -216,8 +214,7 @@ def append(orig_file, new_file, blosc_args=None): double_pretty_size(orig_size_before)) log.verbose('new file size: %s' % double_pretty_size(new_size)) - with open_two_file(open(orig_file, 'r+b'), open(new_file, 'rb')) as \ - (orig_fp, new_fp): + with open(orig_file, 'r+b') as orig_fp, open(new_file, 'rb') as new_fp: append_fp(orig_fp, new_fp, new_size, blosc_args) orig_size_after = path.getsize(orig_file) log.verbose('orig file size after append: %s' % diff --git a/bloscpack/file_io.py b/bloscpack/file_io.py index 4e29964c..c37273c3 100644 --- a/bloscpack/file_io.py +++ b/bloscpack/file_io.py @@ -48,8 +48,6 @@ ) from .serializers import (SERIALIZERS_LOOKUP, ) -from .util import (open_two_file, - ) from .abstract_io import (PlainSource, PlainSink, CompressedSource, @@ -455,8 +453,7 @@ def pack_file(in_file, out_file, chunk_size=DEFAULT_CHUNK_SIZE, metadata=None, # calculate chunk sizes nchunks, chunk_size, last_chunk_size = \ calculate_nchunks(in_file_size, chunk_size) - with open_two_file(open(in_file, 'rb'), open(out_file, 'wb')) as \ - (input_fp, output_fp): + with open(in_file, 'rb') as input_fp, open(out_file, 'wb') as output_fp: source = PlainFPSource(input_fp) sink = CompressedFPSink(output_fp) pack(source, sink, @@ -495,8 +492,7 @@ def unpack_file(in_file, out_file): """ in_file_size = path.getsize(in_file) log.verbose('input file size: %s' % pretty_size(in_file_size)) - with open_two_file(open(in_file, 'rb'), open(out_file, 'wb')) as \ - (input_fp, output_fp): + with open(in_file, 'rb') as input_fp, open(out_file, 'wb') as output_fp: source = CompressedFPSource(input_fp) sink = PlainFPSink(output_fp, source.nchunks) unpack(source, sink) diff --git a/bloscpack/testutil.py b/bloscpack/testutil.py index ae1f8051..e4fe79ca 100644 --- a/bloscpack/testutil.py +++ b/bloscpack/testutil.py @@ -19,8 +19,6 @@ from .defaults import (DEFAULT_CHUNK_SIZE, ) -from .util import (open_two_file, - ) from .pretty import (reverse_pretty ) @@ -71,8 +69,7 @@ def create_tmp_files(): def cmp_file(file1, file2): """ File comparison utility with a small chunksize """ - with open_two_file(open(file1, 'rb'), open(file2, 'rb')) as \ - (fp1, fp2): + with open(file1, 'rb') as fp1, open(file2, 'rb') as fp2: cmp_fp(fp1, fp2) diff --git a/bloscpack/util.py b/bloscpack/util.py index 2367b9d9..02ad0f02 100644 --- a/bloscpack/util.py +++ b/bloscpack/util.py @@ -7,13 +7,6 @@ import sys -@contextlib.contextmanager -def open_two_file(input_fp, output_fp): - """ Hack for making with statement work on two files with 2.6. """ - yield input_fp, output_fp - input_fp.close() - output_fp.close() - PYTHON_VERSION = sys.version_info[0:3] if sys.version_info < (2, 7, 5): # pragma: no cover memoryview = lambda x: x