prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  0.16.0: impossible to build from github sources (to run tests)
  <!--
  Please do not ask general questions here! There are [community
  contact](https://github.com/qtile/qtile#community) options for that.
  -->
  
  # Issue description
  
  Hi! I package qtile for Arch Linux. I'm currently trying to build 0.16.0.
  Usually I also run the test suite against the release (although there are still problems: #1352 and #1130) to be able to at least ensure some kind of compatibility with the Arch Linux provided python3 ecosystem.
  However, running tests is only possible with the github source tarballs (because the test files are included), which unfortunately is not the case for the pypi tarballs.
  
  When running `python setup.py build` for 0.16.0 I am now getting this:
  
  ```
  Traceback (most recent call last):
    File "setup.py", line 91, in <module>
      setup(
    File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.8/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 429, in __init__
      _Distribution.__init__(self, {
    File "/usr/lib/python3.8/distutils/dist.py", line 292, in __init__
      self.finalize_options()
    File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 721, in finalize_options
      ep(self)
    File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 728, in _finalize_setup_keywords
      ep.load()(self, ep.name, value)
    File "/usr/lib/python3.8/site-packages/setuptools_scm/integration.py", line 17, in version_keyword
      dist.metadata.version = _get_version(config)
    File "/usr/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 148, in _get_version
      parsed_version = _do_parse(config)
    File "/usr/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 110, in _do_parse
      raise LookupError(
  LookupError: setuptools-scm was unable to detect version for '/build/qtile/src/qtile-0.16.0'.
  
  Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
  
  For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
  ```
  
  It seems that setuptools_scm has been introduced. Unfortunately, this breaks the build for me.
  
  It would be great to either include the tests in the pypi sdist tarballs or to start using [signed tags](https://github.com/qtile/qtile/tags) again, as then I can rely upon signed tags and a git repository (note: the latter might not help other distributions, as they have different policies).
  If you choose the latter (both would be great too), please make sure to have @flacjacket sign the key of @tych0 so that a clear chain of trust can be established.
  
  # Qtile version
  
  0.16.0
  
  # Stack traces
  
  n/a
  
  # Configuration
  
  n/a
  
  --- 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 python3
  2 
  3 # Copyright (c) 2008 Aldo Cortesi
  4 # Copyright (c) 2011 Mounier Florian
  5 # Copyright (c) 2012 dmpayton
  6 # Copyright (c) 2014 Sean Vig
  7 # Copyright (c) 2014 roger
  8 # Copyright (c) 2014 Pedro Algarvio
  9 # Copyright (c) 2014-2015 Tycho Andersen
  10 #
  11 # Permission is hereby granted, free of charge, to any person obtaining a copy
  12 # of this software and associated documentation files (the "Software"), to deal
  13 # in the Software without restriction, including without limitation the rights
  14 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15 # copies of the Software, and to permit persons to whom the Software is
  16 # furnished to do so, subject to the following conditions:
  17 #
  18 # The above copyright notice and this permission notice shall be included in
  19 # all copies or substantial portions of the Software.
  20 #
  21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  24 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  25 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  26 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  27 # SOFTWARE.
  28 
  29 import sys
  30 import textwrap
  31 
  32 from setuptools import setup
  33 from setuptools.command.install import install
  34 
  35 
  36 class CheckCairoXcb(install):
  37     def cairo_xcb_check(self):
  38         try:
  39             from cairocffi import cairo
  40             cairo.cairo_xcb_surface_create
  41             return True
  42         except AttributeError:
  43             return False
  44 
  45     def finalize_options(self):
  46         if not self.cairo_xcb_check():
  47 
  48             print(textwrap.dedent("""
  49 
  50             It looks like your cairocffi was not built with xcffib support.  To fix this:
  51 
  52               - Ensure a recent xcffib is installed (pip install 'xcffib>=0.5.0')
  53               - The pip cache is cleared (remove ~/.cache/pip, if it exists)
  54               - Reinstall cairocffi, either:
  55 
  56                   pip install --no-deps --ignore-installed cairocffi
  57 
  58                 or
  59 
  60                   pip uninstall cairocffi && pip install cairocffi
  61             """))
  62 
  63             sys.exit(1)
  64         install.finalize_options(self)
  65 
  66 
  67 def get_cffi_modules():
  68     cffi_modules = [
  69         'libqtile/pango_ffi_build.py:pango_ffi',
  70         'libqtile/backend/x11/xcursors_ffi_build.py:xcursors_ffi',
  71     ]
  72     try:
  73         from cffi.error import PkgConfigError
  74         from cffi.pkgconfig import call
  75     except ImportError:
  76         # technically all ffi defined above wont be built
  77         print('CFFI package is missing')
  78     else:
  79         try:
  80             call('libpulse', '--libs')
  81         except PkgConfigError:
  82             print('Failed to find pulseaudio headers. '
  83                   'PulseVolume widget will be unavailable')
  84         else:
  85             cffi_modules.append(
  86                 'libqtile/widget/pulseaudio_ffi.py:pulseaudio_ffi'
  87             )
  88     return cffi_modules
  89 
  90 
  91 setup(
  92     cmdclass={'install': CheckCairoXcb},
  93     use_scm_version=True,
  94     cffi_modules=get_cffi_modules(),
  95     install_requires=["cffi>=1.0.0"],
  96 )
  97
  ```
  --- 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
  @@ -93,4 +93,5 @@
       use_scm_version=True,
       cffi_modules=get_cffi_modules(),
       install_requires=["cffi>=1.0.0"],
  +    include_package_data=True,
   )
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -93,4 +93,5 @@\n     use_scm_version=True,\n     cffi_modules=get_cffi_modules(),\n     install_requires=[\"cffi>=1.0.0\"],\n+    include_package_data=True,\n )\n", "issue": "0.16.0: impossible to build from github sources (to run tests)\n<!--\r\nPlease do not ask general questions here! There are [community\r\ncontact](https://github.com/qtile/qtile#community) options for that.\r\n-->\r\n\r\n# Issue description\r\n\r\nHi! I package qtile for Arch Linux. I'm currently trying to build 0.16.0.\r\nUsually I also run the test suite against the release (although there are still problems: #1352 and #1130) to be able to at least ensure some kind of compatibility with the Arch Linux provided python3 ecosystem.\r\nHowever, running tests is only possible with the github source tarballs (because the test files are included), which unfortunately is not the case for the pypi tarballs.\r\n\r\nWhen running `python setup.py build` for 0.16.0 I am now getting this:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"setup.py\", line 91, in <module>\r\n    setup(\r\n  File \"/usr/lib/python3.8/site-packages/setuptools/__init__.py\", line 165, in setup\r\n    return distutils.core.setup(**attrs)\r\n  File \"/usr/lib/python3.8/distutils/core.py\", line 108, in setup\r\n    _setup_distribution = dist = klass(attrs)\r\n  File \"/usr/lib/python3.8/site-packages/setuptools/dist.py\", line 429, in __init__\r\n    _Distribution.__init__(self, {\r\n  File \"/usr/lib/python3.8/distutils/dist.py\", line 292, in __init__\r\n    self.finalize_options()\r\n  File \"/usr/lib/python3.8/site-packages/setuptools/dist.py\", line 721, in finalize_options\r\n    ep(self)\r\n  File \"/usr/lib/python3.8/site-packages/setuptools/dist.py\", line 728, in _finalize_setup_keywords\r\n    ep.load()(self, ep.name, value)\r\n  File \"/usr/lib/python3.8/site-packages/setuptools_scm/integration.py\", line 17, in version_keyword\r\n    dist.metadata.version = _get_version(config)\r\n  File \"/usr/lib/python3.8/site-packages/setuptools_scm/__init__.py\", line 148, in _get_version\r\n    parsed_version = _do_parse(config)\r\n  File \"/usr/lib/python3.8/site-packages/setuptools_scm/__init__.py\", line 110, in _do_parse\r\n    raise LookupError(\r\nLookupError: setuptools-scm was unable to detect version for '/build/qtile/src/qtile-0.16.0'.\r\n\r\nMake sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.\r\n\r\nFor example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj\r\n```\r\n\r\nIt seems that setuptools_scm has been introduced. Unfortunately, this breaks the build for me.\r\n\r\nIt would be great to either include the tests in the pypi sdist tarballs or to start using [signed tags](https://github.com/qtile/qtile/tags) again, as then I can rely upon signed tags and a git repository (note: the latter might not help other distributions, as they have different policies).\r\nIf you choose the latter (both would be great too), please make sure to have @flacjacket sign the key of @tych0 so that a clear chain of trust can be established.\r\n\r\n# Qtile version\r\n\r\n0.16.0\r\n\r\n# Stack traces\r\n\r\nn/a\r\n\r\n# Configuration\r\n\r\nn/a\n", "before_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) 2008 Aldo Cortesi\n# Copyright (c) 2011 Mounier Florian\n# Copyright (c) 2012 dmpayton\n# Copyright (c) 2014 Sean Vig\n# Copyright (c) 2014 roger\n# Copyright (c) 2014 Pedro Algarvio\n# Copyright (c) 2014-2015 Tycho Andersen\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\nimport sys\nimport textwrap\n\nfrom setuptools import setup\nfrom setuptools.command.install import install\n\n\nclass CheckCairoXcb(install):\n    def cairo_xcb_check(self):\n        try:\n            from cairocffi import cairo\n            cairo.cairo_xcb_surface_create\n            return True\n        except AttributeError:\n            return False\n\n    def finalize_options(self):\n        if not self.cairo_xcb_check():\n\n            print(textwrap.dedent(\"\"\"\n\n            It looks like your cairocffi was not built with xcffib support.  To fix this:\n\n              - Ensure a recent xcffib is installed (pip install 'xcffib>=0.5.0')\n              - The pip cache is cleared (remove ~/.cache/pip, if it exists)\n              - Reinstall cairocffi, either:\n\n                  pip install --no-deps --ignore-installed cairocffi\n\n                or\n\n                  pip uninstall cairocffi && pip install cairocffi\n            \"\"\"))\n\n            sys.exit(1)\n        install.finalize_options(self)\n\n\ndef get_cffi_modules():\n    cffi_modules = [\n        'libqtile/pango_ffi_build.py:pango_ffi',\n        'libqtile/backend/x11/xcursors_ffi_build.py:xcursors_ffi',\n    ]\n    try:\n        from cffi.error import PkgConfigError\n        from cffi.pkgconfig import call\n    except ImportError:\n        # technically all ffi defined above wont be built\n        print('CFFI package is missing')\n    else:\n        try:\n            call('libpulse', '--libs')\n        except PkgConfigError:\n            print('Failed to find pulseaudio headers. '\n                  'PulseVolume widget will be unavailable')\n        else:\n            cffi_modules.append(\n                'libqtile/widget/pulseaudio_ffi.py:pulseaudio_ffi'\n            )\n    return cffi_modules\n\n\nsetup(\n    cmdclass={'install': CheckCairoXcb},\n    use_scm_version=True,\n    cffi_modules=get_cffi_modules(),\n    install_requires=[\"cffi>=1.0.0\"],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) 2008 Aldo Cortesi\n# Copyright (c) 2011 Mounier Florian\n# Copyright (c) 2012 dmpayton\n# Copyright (c) 2014 Sean Vig\n# Copyright (c) 2014 roger\n# Copyright (c) 2014 Pedro Algarvio\n# Copyright (c) 2014-2015 Tycho Andersen\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\nimport sys\nimport textwrap\n\nfrom setuptools import setup\nfrom setuptools.command.install import install\n\n\nclass CheckCairoXcb(install):\n    def cairo_xcb_check(self):\n        try:\n            from cairocffi import cairo\n            cairo.cairo_xcb_surface_create\n            return True\n        except AttributeError:\n            return False\n\n    def finalize_options(self):\n        if not self.cairo_xcb_check():\n\n            print(textwrap.dedent(\"\"\"\n\n            It looks like your cairocffi was not built with xcffib support.  To fix this:\n\n              - Ensure a recent xcffib is installed (pip install 'xcffib>=0.5.0')\n              - The pip cache is cleared (remove ~/.cache/pip, if it exists)\n              - Reinstall cairocffi, either:\n\n                  pip install --no-deps --ignore-installed cairocffi\n\n                or\n\n                  pip uninstall cairocffi && pip install cairocffi\n            \"\"\"))\n\n            sys.exit(1)\n        install.finalize_options(self)\n\n\ndef get_cffi_modules():\n    cffi_modules = [\n        'libqtile/pango_ffi_build.py:pango_ffi',\n        'libqtile/backend/x11/xcursors_ffi_build.py:xcursors_ffi',\n    ]\n    try:\n        from cffi.error import PkgConfigError\n        from cffi.pkgconfig import call\n    except ImportError:\n        # technically all ffi defined above wont be built\n        print('CFFI package is missing')\n    else:\n        try:\n            call('libpulse', '--libs')\n        except PkgConfigError:\n            print('Failed to find pulseaudio headers. '\n                  'PulseVolume widget will be unavailable')\n        else:\n            cffi_modules.append(\n                'libqtile/widget/pulseaudio_ffi.py:pulseaudio_ffi'\n            )\n    return cffi_modules\n\n\nsetup(\n    cmdclass={'install': CheckCairoXcb},\n    use_scm_version=True,\n    cffi_modules=get_cffi_modules(),\n    install_requires=[\"cffi>=1.0.0\"],\n    include_package_data=True,\n)\n", "path": "setup.py"}]}