We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Gathering data_files in setup.py is broken (affects current wheel on PyPI)
The `setup.py` file in this package uses the `data_files` argument to install "data files" on setup. Looking at the code that's responsible for gathering those files in
https://github.com/celery/kombu/blob/v4.2.0/setup.py#L71-L80
one can assume that the intention was to add every file which name is not ending with `.py` under the `kombu` directory. But the code there actually generates a list of _every_ file in the given directory when it encounters at least one file that's not ending with `.py`. It can get tricky if the environment is not clean - for example when there are some `.pyc` files.

Now, when creating packages from the source files we have a discrepancy when it comes to wheel format and tar.gz one (the actual cause for it is not yet clear to me). 

I have tried to install both wheel and source packages on two separate virtualenvs from the following "unclean" state of this repo:
```sh
$ git status --short
$ git clean -nx
Would remove kombu/utils/functional.pyc
``` 

I have done it like that:
```sh
$ python setup.py sdist
$ python setup.py bdist_wheel
$ /tmp/kombutests-wheel/bin/pip install dist/kombu-4.2.0-py2.py3-none-any.whl
$ /tmp/kombutests-targz/bin/pip install dist/kombu-4.2.0.tar.gz
$ tree /tmp/kombutests-wheel/kombu/
/tmp/kombutests-wheel/kombu/
└── utils
    ├── __init__.py
    ├── __init__.pyc
    ├── amq_manager.py
    ├── amq_manager.pyc
    ...
    ├── uuid.py
    └── uuid.pyc
$ tree /tmp/kombutests-targz/kombu
/tmp/kombutests-targz/kombu [error opening dir]

0 directories, 0 files
```
where `/tmp/kombutests-targz` and `/tmp/kombutests-wheel` are the virtualenvs I've mentioned.
This shows that there's an additional `kombu/utils` directory "installed" in the virtualenv's base directory only because we had one additional `.pyc` file in the repo (`kombu/utils/functional.pyc`).

Now, on top of that, it seems that the wheel that's published on PyPi is broken because (I suspect) it was created from a non-clean repo clone.

When downloading the wheel from https://files.pythonhosted.org/packages/2f/0d/416d396ee75b7e47e620005ef81a5b8a36c53c85bb148bd82459e8e61b6b/kombu-4.2.0-py2.py3-none-any.whl (found on https://pypi.org/project/kombu/#files) and unpacking it with `wheel unpack` we can find `kombu-4.2.0/kombu-4.2.0.data/data/kombu` directory. This directory gets copied into the virtualenv base directory. The contents of that directory look similar to what actually gets installed inside `lib/python2.7/site-packages/kombu`, but there are some substantial differences. 
For example there's still an old `async` directory there (it was renamed in https://github.com/celery/kombu/commit/75695205f6e7af8e7e9178e010debc3871b19106) and `asynchronous` dir has only `.pyc` files inside `__pycache__` directories. 
I've pasted the contents of that directory in http://dpaste.com/1C2C7D5

This has bitten us quite hard since we run our processes from the virtualenv base directory so we've used that incomplete version of kombu from that data directory and encountered some "unexplainable" `ImportError`s. 

As I've mentioned I'm not sure what's the original reason for such difference when installing from wheel and from .tar.gz package. Although I'm pretty sure the `data_files` argument from setup is not used correctly here. 

Our current workaround for this issue is to put
```
--no-binary kombu
```
on top of our `requirements.txt` file.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import os
4 import re
5 import sys
6 import codecs
7 
8 import setuptools
9 import setuptools.command.test
10 
11 from distutils.command.install import INSTALL_SCHEMES
12 
13 if sys.version_info < (2, 7):
14     raise Exception('Kombu 4.0 requires Python 2.7 or higher.')
15 
16 try:
17     from setuptools import setup
18 except ImportError:
19     from distutils.core import setup  # noqa
20 
21 # -- Parse meta
22 re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)')
23 re_doc = re.compile(r'^"""(.+?)"""')
24 
25 
26 def add_default(m):
27     attr_name, attr_value = m.groups()
28     return ((attr_name, attr_value.strip("\"'")),)
29 
30 
31 def add_doc(m):
32     return (('doc', m.groups()[0]),)
33 
34 pats = {re_meta: add_default, re_doc: add_doc}
35 here = os.path.abspath(os.path.dirname(__file__))
36 meta_fh = open(os.path.join(here, 'kombu/__init__.py'))
37 try:
38     meta = {}
39     for line in meta_fh:
40         if line.strip() == '# -eof meta-':
41             break
42         for pattern, handler in pats.items():
43             m = pattern.match(line.strip())
44             if m:
45                 meta.update(handler(m))
46 finally:
47     meta_fh.close()
48 # --
49 
50 data_files = []
51 root_dir = os.path.dirname(__file__)
52 if root_dir != '':
53     os.chdir(root_dir)
54 src_dir = 'kombu'
55 
56 
57 def fullsplit(path, result=None):
58     if result is None:
59         result = []
60     head, tail = os.path.split(path)
61     if head == '':
62         return [tail] + result
63     if head == path:
64         return result
65     return fullsplit(head, [tail] + result)
66 
67 
68 for scheme in list(INSTALL_SCHEMES.values()):
69     scheme['data'] = scheme['purelib']
70 
71 for dirpath, dirnames, filenames in os.walk(src_dir):
72     # Ignore dirnames that start with '.'
73     for i, dirname in enumerate(dirnames):
74         if dirname.startswith('.'):
75             del dirnames[i]
76     for filename in filenames:
77         if not filename.endswith('.py'):
78             data_files.append(
79                 [dirpath, [os.path.join(dirpath, f) for f in filenames]],
80             )
81 
82 if os.path.exists('README.rst'):
83     long_description = codecs.open('README.rst', 'r', 'utf-8').read()
84 else:
85     long_description = 'See https://pypi.python.org/pypi/kombu'
86 
87 # -*- Installation Requires -*-
88 py_version = sys.version_info
89 is_jython = sys.platform.startswith('java')
90 is_pypy = hasattr(sys, 'pypy_version_info')
91 
92 
93 def strip_comments(l):
94     return l.split('#', 1)[0].strip()
95 
96 
97 def reqs(*f):
98     return [
99         r for r in (
100             strip_comments(l) for l in open(
101                 os.path.join(os.getcwd(), 'requirements', *f)).readlines()
102         ) if r]
103 
104 
105 def extras(*p):
106     return reqs('extras', *p)
107 
108 
109 class pytest(setuptools.command.test.test):
110     user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
111 
112     def initialize_options(self):
113         setuptools.command.test.test.initialize_options(self)
114         self.pytest_args = []
115 
116     def run_tests(self):
117         import pytest
118         sys.exit(pytest.main(self.pytest_args))
119 
120 setup(
121     name='kombu',
122     packages=setuptools.find_packages(exclude=['t', 't.*']),
123     version=meta['version'],
124     description=meta['doc'],
125     long_description=long_description,
126     keywords='messaging message amqp rabbitmq redis actor producer consumer',
127     author=meta['author'],
128     author_email=meta['contact'],
129     url=meta['homepage'],
130     platforms=['any'],
131     data_files=data_files,
132     zip_safe=False,
133     license='BSD',
134     cmdclass={'test': pytest},
135     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
136     install_requires=reqs('default.txt'),
137     tests_require=reqs('test.txt'),
138     extras_require={
139         'msgpack': extras('msgpack.txt'),
140         'yaml': extras('yaml.txt'),
141         'redis': extras('redis.txt'),
142         'mongodb': extras('mongodb.txt'),
143         'sqs': extras('sqs.txt'),
144         'zookeeper': extras('zookeeper.txt'),
145         'sqlalchemy': extras('sqlalchemy.txt'),
146         'librabbitmq': extras('librabbitmq.txt'),
147         'pyro': extras('pyro.txt'),
148         'slmq': extras('slmq.txt'),
149         'qpid': extras('qpid.txt'),
150         'consul': extras('consul.txt'),
151     },
152     classifiers=[
153         'Development Status :: 5 - Production/Stable',
154         'License :: OSI Approved :: BSD License',
155         'Operating System :: OS Independent',
156         'Programming Language :: Python',
157         'Programming Language :: Python :: 3',
158         'Programming Language :: Python :: 3.4',
159         'Programming Language :: Python :: 3.5',
160         'Programming Language :: Python :: 3.6',
161         'Programming Language :: Python :: 2.7',
162         'Programming Language :: Python :: 2',
163         'Programming Language :: Python :: Implementation :: CPython',
164         'Programming Language :: Python :: Implementation :: PyPy',
165         'Programming Language :: Python :: Implementation :: Jython',
166         'Intended Audience :: Developers',
167         'Topic :: Communications',
168         'Topic :: System :: Distributed Computing',
169         'Topic :: System :: Networking',
170         'Topic :: Software Development :: Libraries :: Python Modules',
171     ],
172 )
173
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,7 @@
 def add_doc(m):
     return (('doc', m.groups()[0]),)
 
+
 pats = {re_meta: add_default, re_doc: add_doc}
 here = os.path.abspath(os.path.dirname(__file__))
 meta_fh = open(os.path.join(here, 'kombu/__init__.py'))
@@ -47,12 +48,6 @@
     meta_fh.close()
 # --
 
-data_files = []
-root_dir = os.path.dirname(__file__)
-if root_dir != '':
-    os.chdir(root_dir)
-src_dir = 'kombu'
-
 
 def fullsplit(path, result=None):
     if result is None:
@@ -68,17 +63,6 @@
 for scheme in list(INSTALL_SCHEMES.values()):
     scheme['data'] = scheme['purelib']
 
-for dirpath, dirnames, filenames in os.walk(src_dir):
-    # Ignore dirnames that start with '.'
-    for i, dirname in enumerate(dirnames):
-        if dirname.startswith('.'):
-            del dirnames[i]
-    for filename in filenames:
-        if not filename.endswith('.py'):
-            data_files.append(
-                [dirpath, [os.path.join(dirpath, f) for f in filenames]],
-            )
-
 if os.path.exists('README.rst'):
     long_description = codecs.open('README.rst', 'r', 'utf-8').read()
 else:
@@ -117,6 +101,7 @@
         import pytest
         sys.exit(pytest.main(self.pytest_args))
 
+
 setup(
     name='kombu',
     packages=setuptools.find_packages(exclude=['t', 't.*']),
@@ -128,7 +113,6 @@
     author_email=meta['contact'],
     url=meta['homepage'],
     platforms=['any'],
-    data_files=data_files,
     zip_safe=False,
     license='BSD',
     cmdclass={'test': pytest},

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -31,6 +31,7 @@\n def add_doc(m):\n     return (('doc', m.groups()[0]),)\n \n+\n pats = {re_meta: add_default, re_doc: add_doc}\n here = os.path.abspath(os.path.dirname(__file__))\n meta_fh = open(os.path.join(here, 'kombu/__init__.py'))\n@@ -47,12 +48,6 @@\n     meta_fh.close()\n # --\n \n-data_files = []\n-root_dir = os.path.dirname(__file__)\n-if root_dir != '':\n-    os.chdir(root_dir)\n-src_dir = 'kombu'\n-\n \n def fullsplit(path, result=None):\n     if result is None:\n@@ -68,17 +63,6 @@\n for scheme in list(INSTALL_SCHEMES.values()):\n     scheme['data'] = scheme['purelib']\n \n-for dirpath, dirnames, filenames in os.walk(src_dir):\n-    # Ignore dirnames that start with '.'\n-    for i, dirname in enumerate(dirnames):\n-        if dirname.startswith('.'):\n-            del dirnames[i]\n-    for filename in filenames:\n-        if not filename.endswith('.py'):\n-            data_files.append(\n-                [dirpath, [os.path.join(dirpath, f) for f in filenames]],\n-            )\n-\n if os.path.exists('README.rst'):\n     long_description = codecs.open('README.rst', 'r', 'utf-8').read()\n else:\n@@ -117,6 +101,7 @@\n         import pytest\n         sys.exit(pytest.main(self.pytest_args))\n \n+\n setup(\n     name='kombu',\n     packages=setuptools.find_packages(exclude=['t', 't.*']),\n@@ -128,7 +113,6 @@\n     author_email=meta['contact'],\n     url=meta['homepage'],\n     platforms=['any'],\n-    data_files=data_files,\n     zip_safe=False,\n     license='BSD',\n     cmdclass={'test': pytest},\n", "issue": "Gathering data_files in setup.py is broken (affects current wheel on PyPI)\nThe `setup.py` file in this package uses the `data_files` argument to install \"data files\" on setup. Looking at the code that's responsible for gathering those files in\r\nhttps://github.com/celery/kombu/blob/v4.2.0/setup.py#L71-L80\r\none can assume that the intention was to add every file which name is not ending with `.py` under the `kombu` directory. But the code there actually generates a list of _every_ file in the given directory when it encounters at least one file that's not ending with `.py`. It can get tricky if the environment is not clean - for example when there are some `.pyc` files.\r\n\r\nNow, when creating packages from the source files we have a discrepancy when it comes to wheel format and tar.gz one (the actual cause for it is not yet clear to me). \r\n\r\nI have tried to install both wheel and source packages on two separate virtualenvs from the following \"unclean\" state of this repo:\r\n```sh\r\n$ git status --short\r\n$ git clean -nx\r\nWould remove kombu/utils/functional.pyc\r\n``` \r\n\r\nI have done it like that:\r\n```sh\r\n$ python setup.py sdist\r\n$ python setup.py bdist_wheel\r\n$ /tmp/kombutests-wheel/bin/pip install dist/kombu-4.2.0-py2.py3-none-any.whl\r\n$ /tmp/kombutests-targz/bin/pip install dist/kombu-4.2.0.tar.gz\r\n$ tree /tmp/kombutests-wheel/kombu/\r\n/tmp/kombutests-wheel/kombu/\r\n\u2514\u2500\u2500 utils\r\n    \u251c\u2500\u2500 __init__.py\r\n    \u251c\u2500\u2500 __init__.pyc\r\n    \u251c\u2500\u2500 amq_manager.py\r\n    \u251c\u2500\u2500 amq_manager.pyc\r\n    ...\r\n    \u251c\u2500\u2500 uuid.py\r\n    \u2514\u2500\u2500 uuid.pyc\r\n$ tree /tmp/kombutests-targz/kombu\r\n/tmp/kombutests-targz/kombu [error opening dir]\r\n\r\n0 directories, 0 files\r\n```\r\nwhere `/tmp/kombutests-targz` and `/tmp/kombutests-wheel` are the virtualenvs I've mentioned.\r\nThis shows that there's an additional `kombu/utils` directory \"installed\" in the virtualenv's base directory only because we had one additional `.pyc` file in the repo (`kombu/utils/functional.pyc`).\r\n\r\nNow, on top of that, it seems that the wheel that's published on PyPi is broken because (I suspect) it was created from a non-clean repo clone.\r\n\r\nWhen downloading the wheel from https://files.pythonhosted.org/packages/2f/0d/416d396ee75b7e47e620005ef81a5b8a36c53c85bb148bd82459e8e61b6b/kombu-4.2.0-py2.py3-none-any.whl (found on https://pypi.org/project/kombu/#files) and unpacking it with `wheel unpack` we can find `kombu-4.2.0/kombu-4.2.0.data/data/kombu` directory. This directory gets copied into the virtualenv base directory. The contents of that directory look similar to what actually gets installed inside `lib/python2.7/site-packages/kombu`, but there are some substantial differences. \r\nFor example there's still an old `async` directory there (it was renamed in https://github.com/celery/kombu/commit/75695205f6e7af8e7e9178e010debc3871b19106) and `asynchronous` dir has only `.pyc` files inside `__pycache__` directories. \r\nI've pasted the contents of that directory in http://dpaste.com/1C2C7D5\r\n\r\nThis has bitten us quite hard since we run our processes from the virtualenv base directory so we've used that incomplete version of kombu from that data directory and encountered some \"unexplainable\" `ImportError`s. \r\n\r\nAs I've mentioned I'm not sure what's the original reason for such difference when installing from wheel and from .tar.gz package. Although I'm pretty sure the `data_files` argument from setup is not used correctly here. \r\n\r\nOur current workaround for this issue is to put\r\n```\r\n--no-binary kombu\r\n```\r\non top of our `requirements.txt` file.\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport re\nimport sys\nimport codecs\n\nimport setuptools\nimport setuptools.command.test\n\nfrom distutils.command.install import INSTALL_SCHEMES\n\nif sys.version_info < (2, 7):\n    raise Exception('Kombu 4.0 requires Python 2.7 or higher.')\n\ntry:\n    from setuptools import setup\nexcept ImportError:\n    from distutils.core import setup  # noqa\n\n# -- Parse meta\nre_meta = re.compile(r'__(\\w+?)__\\s*=\\s*(.*)')\nre_doc = re.compile(r'^\"\"\"(.+?)\"\"\"')\n\n\ndef add_default(m):\n    attr_name, attr_value = m.groups()\n    return ((attr_name, attr_value.strip(\"\\\"'\")),)\n\n\ndef add_doc(m):\n    return (('doc', m.groups()[0]),)\n\npats = {re_meta: add_default, re_doc: add_doc}\nhere = os.path.abspath(os.path.dirname(__file__))\nmeta_fh = open(os.path.join(here, 'kombu/__init__.py'))\ntry:\n    meta = {}\n    for line in meta_fh:\n        if line.strip() == '# -eof meta-':\n            break\n        for pattern, handler in pats.items():\n            m = pattern.match(line.strip())\n            if m:\n                meta.update(handler(m))\nfinally:\n    meta_fh.close()\n# --\n\ndata_files = []\nroot_dir = os.path.dirname(__file__)\nif root_dir != '':\n    os.chdir(root_dir)\nsrc_dir = 'kombu'\n\n\ndef fullsplit(path, result=None):\n    if result is None:\n        result = []\n    head, tail = os.path.split(path)\n    if head == '':\n        return [tail] + result\n    if head == path:\n        return result\n    return fullsplit(head, [tail] + result)\n\n\nfor scheme in list(INSTALL_SCHEMES.values()):\n    scheme['data'] = scheme['purelib']\n\nfor dirpath, dirnames, filenames in os.walk(src_dir):\n    # Ignore dirnames that start with '.'\n    for i, dirname in enumerate(dirnames):\n        if dirname.startswith('.'):\n            del dirnames[i]\n    for filename in filenames:\n        if not filename.endswith('.py'):\n            data_files.append(\n                [dirpath, [os.path.join(dirpath, f) for f in filenames]],\n            )\n\nif os.path.exists('README.rst'):\n    long_description = codecs.open('README.rst', 'r', 'utf-8').read()\nelse:\n    long_description = 'See https://pypi.python.org/pypi/kombu'\n\n# -*- Installation Requires -*-\npy_version = sys.version_info\nis_jython = sys.platform.startswith('java')\nis_pypy = hasattr(sys, 'pypy_version_info')\n\n\ndef strip_comments(l):\n    return l.split('#', 1)[0].strip()\n\n\ndef reqs(*f):\n    return [\n        r for r in (\n            strip_comments(l) for l in open(\n                os.path.join(os.getcwd(), 'requirements', *f)).readlines()\n        ) if r]\n\n\ndef extras(*p):\n    return reqs('extras', *p)\n\n\nclass pytest(setuptools.command.test.test):\n    user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]\n\n    def initialize_options(self):\n        setuptools.command.test.test.initialize_options(self)\n        self.pytest_args = []\n\n    def run_tests(self):\n        import pytest\n        sys.exit(pytest.main(self.pytest_args))\n\nsetup(\n    name='kombu',\n    packages=setuptools.find_packages(exclude=['t', 't.*']),\n    version=meta['version'],\n    description=meta['doc'],\n    long_description=long_description,\n    keywords='messaging message amqp rabbitmq redis actor producer consumer',\n    author=meta['author'],\n    author_email=meta['contact'],\n    url=meta['homepage'],\n    platforms=['any'],\n    data_files=data_files,\n    zip_safe=False,\n    license='BSD',\n    cmdclass={'test': pytest},\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*\",\n    install_requires=reqs('default.txt'),\n    tests_require=reqs('test.txt'),\n    extras_require={\n        'msgpack': extras('msgpack.txt'),\n        'yaml': extras('yaml.txt'),\n        'redis': extras('redis.txt'),\n        'mongodb': extras('mongodb.txt'),\n        'sqs': extras('sqs.txt'),\n        'zookeeper': extras('zookeeper.txt'),\n        'sqlalchemy': extras('sqlalchemy.txt'),\n        'librabbitmq': extras('librabbitmq.txt'),\n        'pyro': extras('pyro.txt'),\n        'slmq': extras('slmq.txt'),\n        'qpid': extras('qpid.txt'),\n        'consul': extras('consul.txt'),\n    },\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Programming Language :: Python :: Implementation :: Jython',\n        'Intended Audience :: Developers',\n        'Topic :: Communications',\n        'Topic :: System :: Distributed Computing',\n        'Topic :: System :: Networking',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport re\nimport sys\nimport codecs\n\nimport setuptools\nimport setuptools.command.test\n\nfrom distutils.command.install import INSTALL_SCHEMES\n\nif sys.version_info < (2, 7):\n    raise Exception('Kombu 4.0 requires Python 2.7 or higher.')\n\ntry:\n    from setuptools import setup\nexcept ImportError:\n    from distutils.core import setup  # noqa\n\n# -- Parse meta\nre_meta = re.compile(r'__(\\w+?)__\\s*=\\s*(.*)')\nre_doc = re.compile(r'^\"\"\"(.+?)\"\"\"')\n\n\ndef add_default(m):\n    attr_name, attr_value = m.groups()\n    return ((attr_name, attr_value.strip(\"\\\"'\")),)\n\n\ndef add_doc(m):\n    return (('doc', m.groups()[0]),)\n\n\npats = {re_meta: add_default, re_doc: add_doc}\nhere = os.path.abspath(os.path.dirname(__file__))\nmeta_fh = open(os.path.join(here, 'kombu/__init__.py'))\ntry:\n    meta = {}\n    for line in meta_fh:\n        if line.strip() == '# -eof meta-':\n            break\n        for pattern, handler in pats.items():\n            m = pattern.match(line.strip())\n            if m:\n                meta.update(handler(m))\nfinally:\n    meta_fh.close()\n# --\n\n\ndef fullsplit(path, result=None):\n    if result is None:\n        result = []\n    head, tail = os.path.split(path)\n    if head == '':\n        return [tail] + result\n    if head == path:\n        return result\n    return fullsplit(head, [tail] + result)\n\n\nfor scheme in list(INSTALL_SCHEMES.values()):\n    scheme['data'] = scheme['purelib']\n\nif os.path.exists('README.rst'):\n    long_description = codecs.open('README.rst', 'r', 'utf-8').read()\nelse:\n    long_description = 'See https://pypi.python.org/pypi/kombu'\n\n# -*- Installation Requires -*-\npy_version = sys.version_info\nis_jython = sys.platform.startswith('java')\nis_pypy = hasattr(sys, 'pypy_version_info')\n\n\ndef strip_comments(l):\n    return l.split('#', 1)[0].strip()\n\n\ndef reqs(*f):\n    return [\n        r for r in (\n            strip_comments(l) for l in open(\n                os.path.join(os.getcwd(), 'requirements', *f)).readlines()\n        ) if r]\n\n\ndef extras(*p):\n    return reqs('extras', *p)\n\n\nclass pytest(setuptools.command.test.test):\n    user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]\n\n    def initialize_options(self):\n        setuptools.command.test.test.initialize_options(self)\n        self.pytest_args = []\n\n    def run_tests(self):\n        import pytest\n        sys.exit(pytest.main(self.pytest_args))\n\n\nsetup(\n    name='kombu',\n    packages=setuptools.find_packages(exclude=['t', 't.*']),\n    version=meta['version'],\n    description=meta['doc'],\n    long_description=long_description,\n    keywords='messaging message amqp rabbitmq redis actor producer consumer',\n    author=meta['author'],\n    author_email=meta['contact'],\n    url=meta['homepage'],\n    platforms=['any'],\n    zip_safe=False,\n    license='BSD',\n    cmdclass={'test': pytest},\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*\",\n    install_requires=reqs('default.txt'),\n    tests_require=reqs('test.txt'),\n    extras_require={\n        'msgpack': extras('msgpack.txt'),\n        'yaml': extras('yaml.txt'),\n        'redis': extras('redis.txt'),\n        'mongodb': extras('mongodb.txt'),\n        'sqs': extras('sqs.txt'),\n        'zookeeper': extras('zookeeper.txt'),\n        'sqlalchemy': extras('sqlalchemy.txt'),\n        'librabbitmq': extras('librabbitmq.txt'),\n        'pyro': extras('pyro.txt'),\n        'slmq': extras('slmq.txt'),\n        'qpid': extras('qpid.txt'),\n        'consul': extras('consul.txt'),\n    },\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Programming Language :: Python :: Implementation :: Jython',\n        'Intended Audience :: Developers',\n        'Topic :: Communications',\n        'Topic :: System :: Distributed Computing',\n        'Topic :: System :: Networking',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n)\n", "path": "setup.py"}]}