import os
from setuptools import setup, find_packages, Extension

import sys

is_pypy = '__pypy__' in sys.builtin_module_names
py_version = sys.version_info[:2]

if py_version < (2, 7):
    raise RuntimeError('On Python 2, offset requires Python 2.7 or better')



REQUIREMENTS = []

if not is_pypy:
    REQUIREMENTS.append("python-fibers")

if py_version == (2, 7):
    REQUIREMENTS.append('futures')



CLASSIFIERS = [
    'Development Status :: 4 - Beta',
    'Environment :: Web Environment',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.0',
    'Programming Language :: Python :: 3.1',
    'Programming Language :: Python :: 3.2',
    'Topic :: Software Development :: Libraries']


# read long description
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
    long_description = f.read()

DATA_FILES = [
        ('flower', ["LICENSE", "MANIFEST.in", "NOTICE", "README.rst",
                        "THANKS", "UNLICENSE"])
        ]


setup(name='offset',
      version='0.1.0',
      description = 'collection of modules to build distributed and reliable concurrent systems',
      long_description = long_description,
      classifiers = CLASSIFIERS,
      license = 'BSD',
      url = 'http://github.com/benoitc/offset',
      author = 'Benoit Chesneau',
      author_email = 'benoitc@e-engura.org',
      packages=find_packages(),
      install_requires = REQUIREMENTS,
      data_files = DATA_FILES)

import os
from setuptools import setup, find_packages, Extension

import sys

is_pypy = '__pypy__' in sys.builtin_module_names
py_version = sys.version_info[:2]

if py_version < (2, 7):
    raise RuntimeError('On Python 2, offset requires Python 2.7 or better')



REQUIREMENTS = []

if not is_pypy:
    REQUIREMENTS.append("python-fibers")

if py_version == (2, 7):
    REQUIREMENTS.append('futures')



CLASSIFIERS = [
    'Development Status :: 4 - Beta',
    'Environment :: Web Environment',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.0',
    'Programming Language :: Python :: 3.1',
    'Programming Language :: Python :: 3.2',
    'Topic :: Software Development :: Libraries']


# read long description
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
    long_description = f.read()

DATA_FILES = [
        ('flower', ["LICENSE", "MANIFEST.in", "NOTICE", "README.rst",
                        "THANKS"])
        ]


setup(name='offset',
      version='0.1.0',
      description = 'collection of modules to build distributed and reliable concurrent systems',
      long_description = long_description,
      classifiers = CLASSIFIERS,
      license = 'BSD',
      url = 'http://github.com/benoitc/offset',
      author = 'Benoit Chesneau',
      author_email = 'benoitc@e-engura.org',
      packages=find_packages(),
      install_requires = REQUIREMENTS,
      data_files = DATA_FILES)

fix setup.py