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

Add python 2 backports dependencies #10

Merged
merged 1 commit into from
May 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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