prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  No tests in bdist
  Discussion from IRC:
  
  ```
  18:38 <ionelmc> can you stop including the tests in the installed package?
  18:39 <+justmay> Fine with me. Care to submit a PR that addresses that?
  18:39 <ionelmc> sure
  18:47 <ionelmc> justmay: is `.mailmap` a stray file?
  18:47 <ionelmc> look like your sdist is incomplete
  18:48 <ionelmc> doesn't include all the docs and test conf
  18:50 <ionelmc> justmay: oh snap. i have to move out the tests to fix this :-)
  18:51 <ionelmc> because include_package_data is used any included data file overlaying the package is going into the bdist
  18:51 <+justmay> ionelmc: .mailmap is there by design. See "Mapping Authors": https://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html
  18:52 <ionelmc> mkay
  18:52 <ionelmc> justmay: you're not going to have a problem with the tests dir at the same level as pelican package right?
  18:53 → e-Flex joined (~e-Flex@h-62-241.a259.priv.bahnhof.se)
  18:54 <+justmay> There's no other way to prevent inclusion of tests in the installed package?
  18:55 <ionelmc> justmay: there are two horrible ways
  18:55 <ionelmc> don't include it in the sdist (highly undesirable)
  18:55 <ionelmc> or
  18:55 <ionelmc> manually specify package_data 
  18:55 <ionelmc> which i can do it correctly for you know, but it will be error prone to maintain
  18:56 <ionelmc> s/know/now/
  18:56 <ionelmc> i think that's also not desirable
  18:56 <ionelmc> that's why i think moving them out is ok
  18:57 <ionelmc> i'll fix the test configuration to work that way
  18:57 <ionelmc> justmay: agree? :-)
  18:59 <+justmay> ionelmc: Quite honestly, I don't have the bandwidth this morning to dig deeply enough into this topic. Would you submit an issue so we (i.e., the community) can discuss this and come to a consensus?
  19:00 <ionelmc> justmay: there's already https://github.com/getpelican/pelican/issues/1409 - i seriously doubt a new issue will help in any way
  19:01 <winlu> ionelmc: justs prune tests and be done with it
  19:01 <ionelmc> justmay: it's either the relocation or manual package_data, make a choice :-)
  19:01 <ionelmc> winlu: pruning the tests will remove them from sdist
  ```
  
  Closes #1609. Closes #1545. Closes #1409.
  
  
  --- 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 from setuptools import setup
  3 
  4 requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils',
  5             'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4',
  6             'python-dateutil']
  7 
  8 entry_points = {
  9     'console_scripts': [
  10         'pelican = pelican:main',
  11         'pelican-import = pelican.tools.pelican_import:main',
  12         'pelican-quickstart = pelican.tools.pelican_quickstart:main',
  13         'pelican-themes = pelican.tools.pelican_themes:main'
  14     ]
  15 }
  16 
  17 
  18 README = open('README.rst').read()
  19 CHANGELOG = open('docs/changelog.rst').read()
  20 
  21 
  22 setup(
  23     name="pelican",
  24     version="3.6.1.dev",
  25     url='http://getpelican.com/',
  26     author='Alexis Metaireau',
  27     author_email='authors@getpelican.com',
  28     description="A tool to generate a static blog from reStructuredText or "
  29                 "Markdown input files.",
  30     long_description=README + '\n' + CHANGELOG,
  31     packages=['pelican', 'pelican.tools'],
  32     include_package_data=True,
  33     install_requires=requires,
  34     entry_points=entry_points,
  35     classifiers=[
  36         'Development Status :: 5 - Production/Stable',
  37          'Environment :: Console',
  38          'License :: OSI Approved :: GNU Affero General Public License v3',
  39          'Operating System :: OS Independent',
  40          'Programming Language :: Python :: 2',
  41          'Programming Language :: Python :: 2.7',
  42          'Programming Language :: Python :: 3',
  43          'Programming Language :: Python :: 3.3',
  44          'Programming Language :: Python :: 3.4',
  45          'Topic :: Internet :: WWW/HTTP',
  46          'Topic :: Software Development :: Libraries :: Python Modules',
  47     ],
  48     test_suite='pelican.tests',
  49 )
  50
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -1,4 +1,7 @@
   #!/usr/bin/env python
  +from os import walk
  +from os.path import join, relpath, dirname
  +
   from setuptools import setup
   
   requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils',
  @@ -14,11 +17,9 @@
       ]
   }
   
  -
   README = open('README.rst').read()
   CHANGELOG = open('docs/changelog.rst').read()
   
  -
   setup(
       name="pelican",
       version="3.6.1.dev",
  @@ -29,7 +30,19 @@
                   "Markdown input files.",
       long_description=README + '\n' + CHANGELOG,
       packages=['pelican', 'pelican.tools'],
  -    include_package_data=True,
  +    package_data={
  +        # we manually collect the package data, as opposed to using include_package_data=True
  +        # because we don't want the tests to be included automatically as package data
  +        # (MANIFEST.in is too greedy)
  +        'pelican': [
  +            relpath(join(root, name), 'pelican')
  +            for root, _, names in walk(join('pelican', 'themes')) for name in names
  +        ],
  +        'pelican.tools': [
  +            relpath(join(root, name), join('pelican', 'tools'))
  +            for root, _, names in walk(join('pelican', 'tools', 'templates')) for name in names
  +        ],
  +    },
       install_requires=requires,
       entry_points=entry_points,
       classifiers=[
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,4 +1,7 @@\n #!/usr/bin/env python\n+from os import walk\n+from os.path import join, relpath, dirname\n+\n from setuptools import setup\n \n requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils',\n@@ -14,11 +17,9 @@\n     ]\n }\n \n-\n README = open('README.rst').read()\n CHANGELOG = open('docs/changelog.rst').read()\n \n-\n setup(\n     name=\"pelican\",\n     version=\"3.6.1.dev\",\n@@ -29,7 +30,19 @@\n                 \"Markdown input files.\",\n     long_description=README + '\\n' + CHANGELOG,\n     packages=['pelican', 'pelican.tools'],\n-    include_package_data=True,\n+    package_data={\n+        # we manually collect the package data, as opposed to using include_package_data=True\n+        # because we don't want the tests to be included automatically as package data\n+        # (MANIFEST.in is too greedy)\n+        'pelican': [\n+            relpath(join(root, name), 'pelican')\n+            for root, _, names in walk(join('pelican', 'themes')) for name in names\n+        ],\n+        'pelican.tools': [\n+            relpath(join(root, name), join('pelican', 'tools'))\n+            for root, _, names in walk(join('pelican', 'tools', 'templates')) for name in names\n+        ],\n+    },\n     install_requires=requires,\n     entry_points=entry_points,\n     classifiers=[\n", "issue": "No tests in bdist\nDiscussion from IRC:\n\n```\n18:38 <ionelmc> can you stop including the tests in the installed package?\n18:39 <+justmay> Fine with me. Care to submit a PR that addresses that?\n18:39 <ionelmc> sure\n18:47 <ionelmc> justmay: is `.mailmap` a stray file?\n18:47 <ionelmc> look like your sdist is incomplete\n18:48 <ionelmc> doesn't include all the docs and test conf\n18:50 <ionelmc> justmay: oh snap. i have to move out the tests to fix this :-)\n18:51 <ionelmc> because include_package_data is used any included data file overlaying the package is going into the bdist\n18:51 <+justmay> ionelmc: .mailmap is there by design. See \"Mapping Authors\": https://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html\n18:52 <ionelmc> mkay\n18:52 <ionelmc> justmay: you're not going to have a problem with the tests dir at the same level as pelican package right?\n18:53 \u2192 e-Flex joined (~e-Flex@h-62-241.a259.priv.bahnhof.se)\n18:54 <+justmay> There's no other way to prevent inclusion of tests in the installed package?\n18:55 <ionelmc> justmay: there are two horrible ways\n18:55 <ionelmc> don't include it in the sdist (highly undesirable)\n18:55 <ionelmc> or\n18:55 <ionelmc> manually specify package_data \n18:55 <ionelmc> which i can do it correctly for you know, but it will be error prone to maintain\n18:56 <ionelmc> s/know/now/\n18:56 <ionelmc> i think that's also not desirable\n18:56 <ionelmc> that's why i think moving them out is ok\n18:57 <ionelmc> i'll fix the test configuration to work that way\n18:57 <ionelmc> justmay: agree? :-)\n18:59 <+justmay> ionelmc: Quite honestly, I don't have the bandwidth this morning to dig deeply enough into this topic. Would you submit an issue so we (i.e., the community) can discuss this and come to a consensus?\n19:00 <ionelmc> justmay: there's already https://github.com/getpelican/pelican/issues/1409 - i seriously doubt a new issue will help in any way\n19:01 <winlu> ionelmc: justs prune tests and be done with it\n19:01 <ionelmc> justmay: it's either the relocation or manual package_data, make a choice :-)\n19:01 <ionelmc> winlu: pruning the tests will remove them from sdist\n```\n\nCloses #1609. Closes #1545. Closes #1409.\n\n", "before_files": [{"content": "#!/usr/bin/env python\nfrom setuptools import setup\n\nrequires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils',\n            'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4',\n            'python-dateutil']\n\nentry_points = {\n    'console_scripts': [\n        'pelican = pelican:main',\n        'pelican-import = pelican.tools.pelican_import:main',\n        'pelican-quickstart = pelican.tools.pelican_quickstart:main',\n        'pelican-themes = pelican.tools.pelican_themes:main'\n    ]\n}\n\n\nREADME = open('README.rst').read()\nCHANGELOG = open('docs/changelog.rst').read()\n\n\nsetup(\n    name=\"pelican\",\n    version=\"3.6.1.dev\",\n    url='http://getpelican.com/',\n    author='Alexis Metaireau',\n    author_email='authors@getpelican.com',\n    description=\"A tool to generate a static blog from reStructuredText or \"\n                \"Markdown input files.\",\n    long_description=README + '\\n' + CHANGELOG,\n    packages=['pelican', 'pelican.tools'],\n    include_package_data=True,\n    install_requires=requires,\n    entry_points=entry_points,\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n         'Environment :: Console',\n         'License :: OSI Approved :: GNU Affero General Public License v3',\n         'Operating System :: OS Independent',\n         'Programming Language :: Python :: 2',\n         'Programming Language :: Python :: 2.7',\n         'Programming Language :: Python :: 3',\n         'Programming Language :: Python :: 3.3',\n         'Programming Language :: Python :: 3.4',\n         'Topic :: Internet :: WWW/HTTP',\n         'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    test_suite='pelican.tests',\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nfrom os import walk\nfrom os.path import join, relpath, dirname\n\nfrom setuptools import setup\n\nrequires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils',\n            'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4',\n            'python-dateutil']\n\nentry_points = {\n    'console_scripts': [\n        'pelican = pelican:main',\n        'pelican-import = pelican.tools.pelican_import:main',\n        'pelican-quickstart = pelican.tools.pelican_quickstart:main',\n        'pelican-themes = pelican.tools.pelican_themes:main'\n    ]\n}\n\nREADME = open('README.rst').read()\nCHANGELOG = open('docs/changelog.rst').read()\n\nsetup(\n    name=\"pelican\",\n    version=\"3.6.1.dev\",\n    url='http://getpelican.com/',\n    author='Alexis Metaireau',\n    author_email='authors@getpelican.com',\n    description=\"A tool to generate a static blog from reStructuredText or \"\n                \"Markdown input files.\",\n    long_description=README + '\\n' + CHANGELOG,\n    packages=['pelican', 'pelican.tools'],\n    package_data={\n        # we manually collect the package data, as opposed to using include_package_data=True\n        # because we don't want the tests to be included automatically as package data\n        # (MANIFEST.in is too greedy)\n        'pelican': [\n            relpath(join(root, name), 'pelican')\n            for root, _, names in walk(join('pelican', 'themes')) for name in names\n        ],\n        'pelican.tools': [\n            relpath(join(root, name), join('pelican', 'tools'))\n            for root, _, names in walk(join('pelican', 'tools', 'templates')) for name in names\n        ],\n    },\n    install_requires=requires,\n    entry_points=entry_points,\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n         'Environment :: Console',\n         'License :: OSI Approved :: GNU Affero General Public License v3',\n         'Operating System :: OS Independent',\n         'Programming Language :: Python :: 2',\n         'Programming Language :: Python :: 2.7',\n         'Programming Language :: Python :: 3',\n         'Programming Language :: Python :: 3.3',\n         'Programming Language :: Python :: 3.4',\n         'Topic :: Internet :: WWW/HTTP',\n         'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    test_suite='pelican.tests',\n)\n", "path": "setup.py"}]}