Skip to content

Commit

Permalink
ENH: add contextlib2 as py2 only dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Jevnik committed Feb 17, 2016
1 parent a77fc84 commit 2060fe8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ recursive-include blaze *.py
recursive-include docs *.rst

include requirements-strict.txt
include requirements-py2.txt
include setup.py
include README.rst
include LICENSE.txt
Expand Down
2 changes: 2 additions & 0 deletions blaze/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def boundmethod(func, instance):
return MethodType(func, instance, type(instance))

from itertools import izip_longest as zip_longest
from contextlib2 import ExitStack
else:
_inttypes = (int,)
_strtypes = (str,)
Expand All @@ -68,6 +69,7 @@ def boundmethod(func, instance):
boundmethod = MethodType

from itertools import zip_longest
from contextlib import ExitStack


import io
Expand Down
2 changes: 2 additions & 0 deletions requirements-py2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# backport of ExitStack
contextlib2
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def find_data_files(exts, where='blaze'):
longdesc = f.read()

with open('requirements-strict.txt') as f:
install_requires = f.read().strip().split('\n')
install_requires = f.read().strip().splitlines()


if sys.version_info[0] == 2:
with open('requirements-py2.txt') as f:
install_requires.extend(f.read().strip().splitlines())


setup(
Expand Down

0 comments on commit 2060fe8

Please sign in to comment.