Skip to content

Commit

Permalink
Merge pull request #77 from esc/remove_26_support
Browse files Browse the repository at this point in the history
Remove 2.6 support
  • Loading branch information
esc committed Oct 17, 2018
2 parents 19d7aac + 261f4fa commit a1f54c4
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 32 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sudo: false
language: python
python:
- 2.6
- 2.7
- 3.4
- 3.5
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/Blosc/python-blosc>`_ (provides Blosc) and
`Numpy <http://www.numpy.org/>`_ (as listed in ``requirements.txt`` for
running the code
Expand Down
5 changes: 1 addition & 4 deletions bloscpack/append.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
)
from .pretty import (double_pretty_size,
)
from .util import (open_two_file,
)
from . import log


Expand Down Expand Up @@ -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' %
Expand Down
8 changes: 2 additions & 6 deletions bloscpack/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
)
from .serializers import (SERIALIZERS_LOOKUP,
)
from .util import (open_two_file,
)
from .abstract_io import (PlainSource,
PlainSink,
CompressedSource,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions bloscpack/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

from .defaults import (DEFAULT_CHUNK_SIZE,
)
from .util import (open_two_file,
)
from .pretty import (reverse_pretty
)

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


Expand Down
7 changes: 0 additions & 7 deletions bloscpack/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -60,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',
Expand Down
3 changes: 0 additions & 3 deletions test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ coverage
coveralls
twine
wheel
unittest2; python_version == '2.6'
ordereddict; python_version =='2.6'
argparse; python_version =='2.6'

0 comments on commit a1f54c4

Please sign in to comment.