Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from learningequality/install-requires
Browse files Browse the repository at this point in the history
Add python 2 backports dependencies
  • Loading branch information
benjaoming authored May 26, 2017
2 parents 119710a + 94197ff commit 5abe076
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

from setuptools import find_packages, setup


sys.path.append(
os.path.join(os.path.dirname(__file__), 'src')
)

# noqa
from barbequeue import __version__ # isort:skip # noqa

IS_PYTHON_2 = sys.version_info < (3,)

def read_file(fname):
"""
Read file and decode in py2k
"""
if sys.version_info < (3,):
if IS_PYTHON_2:
return open(fname).read().decode("utf-8")
return open(fname).read()

Expand All @@ -34,11 +34,6 @@ def read_file(fname):
description = ("""A queueing library with support for Windows and Unix.""")


######################################
# STATIC AND DYNAMIC BUILD SPECIFICS #
######################################


def enable_log_to_stdout(logname):
"""Given a log name, outputs > INFO to stdout."""
log = logging.getLogger(logname)
Expand All @@ -54,6 +49,12 @@ def enable_log_to_stdout(logname):
log.addHandler(ch)


PYTHON_2_BACKPORTS = [
"futures>=3.1.1",
]

INSTALL_REQUIRES = PYTHON_2_BACKPORTS if IS_PYTHON_2 else []

setup(
name=dist_name,
version=__version__,
Expand All @@ -67,6 +68,7 @@ def enable_log_to_stdout(logname):
include_package_data=True,
license='MIT',
zip_safe=False,
install_requires=INSTALL_REQUIRES,
keywords=('queue', 'async'),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
Expand Down

0 comments on commit 5abe076

Please sign in to comment.