We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Extend Makefile with installation and test targets
**Information**
- Solaar version: 1.1.11rc4

**Is your feature request related to a problem? Please describe.**
The Solaar installation with all its dependencies (pip, apt, udev etc.) is cumbersome. Although some setup steps for GItHub CI exists, they are not usable for local setup of Solaar. 

**Describe the solution you'd like**
Move the setup commands into a Makefile and use the targets in GitHub workflow files. Thus, the commands are in a single place and also usable for local setups.

**Additional context**
This extends #2263 


--- 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 import subprocess
3 
4 from glob import glob as _glob
5 
6 try:
7     from setuptools import setup
8 except ImportError:
9     from distutils.core import setup
10 
11 NAME = 'Solaar'
12 
13 with open('lib/solaar/version', 'r') as vfile:
14     version = vfile.read().strip()
15 
16 try:  # get commit from git describe
17     commit = subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.DEVNULL).strip().decode()
18     with open('lib/solaar/commit', 'w') as vfile:
19         vfile.write(f'{commit}\n')
20 except Exception:  # get commit from Ubuntu dpkg-parsechangelog
21     try:
22         commit = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],
23                                          stderr=subprocess.DEVNULL).strip().decode()
24         commit = commit.split('~')
25         with open('lib/solaar/commit', 'w') as vfile:
26             vfile.write(f'{commit[0]}\n')
27     except Exception as e:
28         print('Exception using dpkg-parsechangelog', e)
29 
30 
31 def _data_files():
32     from os.path import dirname as _dirname
33 
34     yield 'share/icons/hicolor/scalable/apps', _glob('share/solaar/icons/solaar*.svg')
35     yield 'share/icons/hicolor/32x32/apps', _glob('share/solaar/icons/solaar-light_*.png')
36 
37     for mo in _glob('share/locale/*/LC_MESSAGES/solaar.mo'):
38         yield _dirname(mo), [mo]
39 
40     yield 'share/applications', ['share/applications/solaar.desktop']
41     yield 'lib/udev/rules.d', ['rules.d/42-logitech-unify-permissions.rules']
42     yield 'share/metainfo', ['share/solaar/io.github.pwr_solaar.solaar.metainfo.xml']
43 
44     del _dirname
45 
46 
47 setup(
48     name=NAME.lower(),
49     version=version,
50     description='Linux device manager for Logitech receivers, keyboards, mice, and tablets.',
51     long_description='''
52 Solaar is a Linux device manager for many Logitech peripherals that connect through
53 Unifying and other receivers or via USB or Bluetooth.
54 Solaar is able to pair/unpair devices with receivers and show and modify some of the
55 modifiable features of devices.
56 For instructions on installing Solaar see https://pwr-solaar.github.io/Solaar/installation'''.strip(),
57     author='Daniel Pavel',
58     license='GPLv2',
59     url='http://pwr-solaar.github.io/Solaar/',
60     classifiers=[
61         'Development Status :: 4 - Beta',
62         'Environment :: X11 Applications :: GTK',
63         'Environment :: Console',
64         'Intended Audience :: End Users/Desktop',
65         'License :: DFSG approved',
66         'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
67         'Natural Language :: English',
68         'Programming Language :: Python :: 3 :: Only',
69         'Operating System :: POSIX :: Linux',
70         'Topic :: Utilities',
71     ],
72     platforms=['linux'],
73 
74     # sudo apt install python-gi python3-gi \
75     #        gir1.2-gtk-3.0 gir1.2-notify-0.7 gir1.2-ayatanaappindicator3-0.1
76     # os_requires=['gi.repository.GObject (>= 2.0)', 'gi.repository.Gtk (>= 3.0)'],
77     python_requires='>=3.7',
78     install_requires=[
79         'evdev (>= 1.1.2) ; platform_system=="Linux"',
80         'pyudev (>= 0.13)',
81         'PyYAML (>= 3.12)',
82         'python-xlib (>= 0.27)',
83         'psutil (>= 5.4.3)',
84         'dbus-python ; platform_system=="Linux"',
85     ],
86     extras_require={
87         'report-descriptor': ['hid-parser'],
88         'desktop-notifications': ['Notify (>= 0.7)'],
89         'git-commit': ['python-git-info'],
90         'test': ['pytest'],
91     },
92     package_dir={'': 'lib'},
93     packages=['keysyms', 'hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],
94     data_files=list(_data_files()),
95     include_package_data=True,
96     scripts=_glob('bin/*'),
97 )
98
```
--- 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
@@ -87,7 +87,7 @@
         'report-descriptor': ['hid-parser'],
         'desktop-notifications': ['Notify (>= 0.7)'],
         'git-commit': ['python-git-info'],
-        'test': ['pytest'],
+        'test': ['pytest', 'pytest-cov'],
     },
     package_dir={'': 'lib'},
     packages=['keysyms', 'hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -87,7 +87,7 @@\n         'report-descriptor': ['hid-parser'],\n         'desktop-notifications': ['Notify (>= 0.7)'],\n         'git-commit': ['python-git-info'],\n-        'test': ['pytest'],\n+        'test': ['pytest', 'pytest-cov'],\n     },\n     package_dir={'': 'lib'},\n     packages=['keysyms', 'hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],\n", "issue": "Extend Makefile with installation and test targets\n**Information**\r\n- Solaar version: 1.1.11rc4\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\nThe Solaar installation with all its dependencies (pip, apt, udev etc.) is cumbersome. Although some setup steps for GItHub CI exists, they are not usable for local setup of Solaar. \r\n\r\n**Describe the solution you'd like**\r\nMove the setup commands into a Makefile and use the targets in GitHub workflow files. Thus, the commands are in a single place and also usable for local setups.\r\n\r\n**Additional context**\r\nThis extends #2263 \r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\nimport subprocess\n\nfrom glob import glob as _glob\n\ntry:\n    from setuptools import setup\nexcept ImportError:\n    from distutils.core import setup\n\nNAME = 'Solaar'\n\nwith open('lib/solaar/version', 'r') as vfile:\n    version = vfile.read().strip()\n\ntry:  # get commit from git describe\n    commit = subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.DEVNULL).strip().decode()\n    with open('lib/solaar/commit', 'w') as vfile:\n        vfile.write(f'{commit}\\n')\nexcept Exception:  # get commit from Ubuntu dpkg-parsechangelog\n    try:\n        commit = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],\n                                         stderr=subprocess.DEVNULL).strip().decode()\n        commit = commit.split('~')\n        with open('lib/solaar/commit', 'w') as vfile:\n            vfile.write(f'{commit[0]}\\n')\n    except Exception as e:\n        print('Exception using dpkg-parsechangelog', e)\n\n\ndef _data_files():\n    from os.path import dirname as _dirname\n\n    yield 'share/icons/hicolor/scalable/apps', _glob('share/solaar/icons/solaar*.svg')\n    yield 'share/icons/hicolor/32x32/apps', _glob('share/solaar/icons/solaar-light_*.png')\n\n    for mo in _glob('share/locale/*/LC_MESSAGES/solaar.mo'):\n        yield _dirname(mo), [mo]\n\n    yield 'share/applications', ['share/applications/solaar.desktop']\n    yield 'lib/udev/rules.d', ['rules.d/42-logitech-unify-permissions.rules']\n    yield 'share/metainfo', ['share/solaar/io.github.pwr_solaar.solaar.metainfo.xml']\n\n    del _dirname\n\n\nsetup(\n    name=NAME.lower(),\n    version=version,\n    description='Linux device manager for Logitech receivers, keyboards, mice, and tablets.',\n    long_description='''\nSolaar is a Linux device manager for many Logitech peripherals that connect through\nUnifying and other receivers or via USB or Bluetooth.\nSolaar is able to pair/unpair devices with receivers and show and modify some of the\nmodifiable features of devices.\nFor instructions on installing Solaar see https://pwr-solaar.github.io/Solaar/installation'''.strip(),\n    author='Daniel Pavel',\n    license='GPLv2',\n    url='http://pwr-solaar.github.io/Solaar/',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: X11 Applications :: GTK',\n        'Environment :: Console',\n        'Intended Audience :: End Users/Desktop',\n        'License :: DFSG approved',\n        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',\n        'Natural Language :: English',\n        'Programming Language :: Python :: 3 :: Only',\n        'Operating System :: POSIX :: Linux',\n        'Topic :: Utilities',\n    ],\n    platforms=['linux'],\n\n    # sudo apt install python-gi python3-gi \\\n    #        gir1.2-gtk-3.0 gir1.2-notify-0.7 gir1.2-ayatanaappindicator3-0.1\n    # os_requires=['gi.repository.GObject (>= 2.0)', 'gi.repository.Gtk (>= 3.0)'],\n    python_requires='>=3.7',\n    install_requires=[\n        'evdev (>= 1.1.2) ; platform_system==\"Linux\"',\n        'pyudev (>= 0.13)',\n        'PyYAML (>= 3.12)',\n        'python-xlib (>= 0.27)',\n        'psutil (>= 5.4.3)',\n        'dbus-python ; platform_system==\"Linux\"',\n    ],\n    extras_require={\n        'report-descriptor': ['hid-parser'],\n        'desktop-notifications': ['Notify (>= 0.7)'],\n        'git-commit': ['python-git-info'],\n        'test': ['pytest'],\n    },\n    package_dir={'': 'lib'},\n    packages=['keysyms', 'hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],\n    data_files=list(_data_files()),\n    include_package_data=True,\n    scripts=_glob('bin/*'),\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python3\nimport subprocess\n\nfrom glob import glob as _glob\n\ntry:\n    from setuptools import setup\nexcept ImportError:\n    from distutils.core import setup\n\nNAME = 'Solaar'\n\nwith open('lib/solaar/version', 'r') as vfile:\n    version = vfile.read().strip()\n\ntry:  # get commit from git describe\n    commit = subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.DEVNULL).strip().decode()\n    with open('lib/solaar/commit', 'w') as vfile:\n        vfile.write(f'{commit}\\n')\nexcept Exception:  # get commit from Ubuntu dpkg-parsechangelog\n    try:\n        commit = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],\n                                         stderr=subprocess.DEVNULL).strip().decode()\n        commit = commit.split('~')\n        with open('lib/solaar/commit', 'w') as vfile:\n            vfile.write(f'{commit[0]}\\n')\n    except Exception as e:\n        print('Exception using dpkg-parsechangelog', e)\n\n\ndef _data_files():\n    from os.path import dirname as _dirname\n\n    yield 'share/icons/hicolor/scalable/apps', _glob('share/solaar/icons/solaar*.svg')\n    yield 'share/icons/hicolor/32x32/apps', _glob('share/solaar/icons/solaar-light_*.png')\n\n    for mo in _glob('share/locale/*/LC_MESSAGES/solaar.mo'):\n        yield _dirname(mo), [mo]\n\n    yield 'share/applications', ['share/applications/solaar.desktop']\n    yield 'lib/udev/rules.d', ['rules.d/42-logitech-unify-permissions.rules']\n    yield 'share/metainfo', ['share/solaar/io.github.pwr_solaar.solaar.metainfo.xml']\n\n    del _dirname\n\n\nsetup(\n    name=NAME.lower(),\n    version=version,\n    description='Linux device manager for Logitech receivers, keyboards, mice, and tablets.',\n    long_description='''\nSolaar is a Linux device manager for many Logitech peripherals that connect through\nUnifying and other receivers or via USB or Bluetooth.\nSolaar is able to pair/unpair devices with receivers and show and modify some of the\nmodifiable features of devices.\nFor instructions on installing Solaar see https://pwr-solaar.github.io/Solaar/installation'''.strip(),\n    author='Daniel Pavel',\n    license='GPLv2',\n    url='http://pwr-solaar.github.io/Solaar/',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: X11 Applications :: GTK',\n        'Environment :: Console',\n        'Intended Audience :: End Users/Desktop',\n        'License :: DFSG approved',\n        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',\n        'Natural Language :: English',\n        'Programming Language :: Python :: 3 :: Only',\n        'Operating System :: POSIX :: Linux',\n        'Topic :: Utilities',\n    ],\n    platforms=['linux'],\n\n    # sudo apt install python-gi python3-gi \\\n    #        gir1.2-gtk-3.0 gir1.2-notify-0.7 gir1.2-ayatanaappindicator3-0.1\n    # os_requires=['gi.repository.GObject (>= 2.0)', 'gi.repository.Gtk (>= 3.0)'],\n    python_requires='>=3.7',\n    install_requires=[\n        'evdev (>= 1.1.2) ; platform_system==\"Linux\"',\n        'pyudev (>= 0.13)',\n        'PyYAML (>= 3.12)',\n        'python-xlib (>= 0.27)',\n        'psutil (>= 5.4.3)',\n        'dbus-python ; platform_system==\"Linux\"',\n    ],\n    extras_require={\n        'report-descriptor': ['hid-parser'],\n        'desktop-notifications': ['Notify (>= 0.7)'],\n        'git-commit': ['python-git-info'],\n        'test': ['pytest', 'pytest-cov'],\n    },\n    package_dir={'': 'lib'},\n    packages=['keysyms', 'hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],\n    data_files=list(_data_files()),\n    include_package_data=True,\n    scripts=_glob('bin/*'),\n)\n", "path": "setup.py"}]}