internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pwr-Solaar/Solaar

Issue:
Add git information in about and console
**Information**
Installed version of solaar::  1.1.7+git1897-9c361c4~ubuntu22.10.1
Distribution: Ubuntu 22.10 + https://launchpad.net/~solaar-unifying/+archive/ubuntu/ppa (git)
Kernel version: Linux 6.1.0-060100rc5-generic x86_64 GNU/Linux

Example:
a)
![image](https://user-images.githubusercontent.com/48624942/202720677-1d1257ab-3113-429b-b29c-78765161e1c4.png)

b)
$ solaar show
Solaar version 1.1.7-9c361c4

[...]


Discussion:
This would be useful, but how is it done?

I don't think that PR #1853 points out the way.

It looks as if that project has a compile phase, which can be run when git information is available.  Python doesn't work quite that way.  But perhaps the setup process can do something.
There are some methods that may do this, but the one I found was for Python 2, which makes it old.

https://gist.github.com/jpmens/6248478
I found this:
https://www.geeksforgeeks.org/automate-the-conversion-from-python2-to-python3/
The big problem is not Python 2 but the probable age.  I don't want to include something that uses old notions of what to do in setup.py (which is the code that prepares Python code for distribution).

Resolving patch:
diff --git a/lib/solaar/__init__.py b/lib/solaar/__init__.py
--- a/lib/solaar/__init__.py
+++ b/lib/solaar/__init__.py
@@ -16,5 +16,11 @@
 ## with this program; if not, write to the Free Software Foundation, Inc.,
 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-__version__ = '1.1.7'
+__version_short__ = '1.1.7'
 NAME = 'Solaar'
+
+try:
+    import gitinfo
+    __version__ = __version_short__ + '-' + gitinfo.get_git_info()['commit'][:8]
+except Exception:
+    __version__ = __version_short__
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@
 with open('lib/solaar/__init__.py') as ver_file:
     exec(ver_file.read(), main_ns)
 NAME = main_ns['NAME']
-__version__ = main_ns['__version__']
+__version__ = main_ns['__version_short__']
 
 
 def _data_files():
@@ -72,6 +72,7 @@ def _data_files():
     extras_require={
         'report-descriptor': ['hid-parser'],
         'desktop-notifications': ['Notify (>= 0.7)'],
+        'git-commit': ['python-git-info'],
     },
     package_dir={'': 'lib'},
     packages=['keysyms', 'hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Improved presentation of the Solaar version
**Information**
- Solaar version: 1.1.7+git1905-17c30a2~ubuntu22.10.1
- Distribution: Ubuntu 22.10 + https://launchpad.net/~solaar-unifying/+archive/ubuntu/ppa
- Kernel version: Linux 6.1.0-060100rc5-generic x86_64 GNU/Linux
- Output of `solaar show`

**I suggest:**

Current:
1.1.7-12345678; 1.1.7-12345679; 1.1.7-12345680; 1.1.7-12345681

Gets better:
1.1.7-stable; 1.1.7-12345679; 1.1.7-12345680; 1.1.8-stable


Discussion:
I would have to add more programming here: https://github.com/pwr-Solaar/Solaar/commit/b0f5e2e8fdec58865892afbd3b01e97a8c7dca59 ?



Resolving patch:
diff --git a/lib/solaar/__init__.py b/lib/solaar/__init__.py
--- a/lib/solaar/__init__.py
+++ b/lib/solaar/__init__.py
@@ -16,11 +16,15 @@
 ## with this program; if not, write to the Free Software Foundation, Inc.,
 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-__version_short__ = '1.1.7'
-NAME = 'Solaar'
+import subprocess as _subprocess
+import sys as _sys
+
+from solaar.version import NAME as _NAME
+from solaar.version import version as _version
 
 try:
-    import gitinfo
-    __version__ = __version_short__ + '-' + gitinfo.get_git_info()['commit'][:8]
+    __version__ = _subprocess.check_output(['git', 'describe', '--always'], cwd=_sys.path[0],
+                                           stderr=_subprocess.DEVNULL).strip().decode()
 except Exception:
-    __version__ = __version_short__
+    __version__ = _version
+NAME = _NAME
diff --git a/lib/solaar/version.py b/lib/solaar/version.py
new file mode 100644
--- /dev/null
+++ b/lib/solaar/version.py
@@ -0,0 +1,2 @@
+NAME = 'Solaar'
+version = '1.1.7-19-gcf26ac6e'
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,7 @@
 #!/usr/bin/env python3
 
+import subprocess
+
 from glob import glob as _glob
 
 try:
@@ -7,11 +9,16 @@
 except ImportError:
     from distutils.core import setup
 
-main_ns = {}
-with open('lib/solaar/__init__.py') as ver_file:
-    exec(ver_file.read(), main_ns)
-NAME = main_ns['NAME']
-__version__ = main_ns['__version_short__']
+NAME = 'Solaar'
+version = '1.1.7'
+
+try:
+    cver = max(version, subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.DEVNULL).strip().decode())
+except Exception:
+    cver = version
+with open('lib/solaar/version.py', 'w') as vfile:
+    vfile.write(f'NAME = \'{NAME}\'\n')
+    vfile.write(f'version = \'{cver}\'\n')
 
 
 def _data_files():
@@ -33,7 +40,7 @@ def _data_files():
 
 setup(
     name=NAME.lower(),
-    version=__version__,
+    version=version,
     description='Linux device manager for Logitech receivers, keyboards, mice, and tablets.',
     long_description='''
 Solaar is a Linux device manager for many Logitech peripherals that connect through


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Solaar exits with RC 1 when terminated
**Information**
<!-- Make sure that your issue is not one of the known issues in the Solaar documentation at https://pwr-solaar.github.io/Solaar/ -->
<!-- Do not bother opening an issue for a version older than 1.1.0.  Upgrade to the latest version and see if your issue persists. -->
<!-- If you not running the current version of Solaar, strongly consider upgrading to the newest version. -->
- Solaar version (`solaar --version` or `git describe --tags` if cloned from this repository): solaar 1.1.8+dfsg-2
- Distribution: Debian testing
- Kernel version (ex. `uname -srmo`): `Linux 6.1.0-3-amd64 x86_64 GNU/Linux`
- Output of `solaar show`: 

<details>

```

```
</details>

- Contents of `~/.config/solaar/config.yaml` (or `~/.config/solaar/config.json` if `~/.config/solaar/config.yaml` not present):

<details>

```
CONTENTS HERE
```
</details>


- Errors or warrnings from Solaar:
<!-- Under normal operation Solaar keeps a log of warning and error messages in ~/.tmp
while it is running as a file starting with 'Solaar'.
If this file is not available or does not have useful information you can
run Solaar as `solaar -dd`, after killing any running Solaar processes to
have Solaar log informational, warning, and error messages to stdout. -->


**Describe the bug**
When terminated, solaar exits with RC 1. This results in a failed unit if systemd is managing XDG autostart. No log warnings or stderr messages produced.

**To Reproduce**
Steps to reproduce the behavior: 
1. run `solaar ; echo $?`
2. run `killall solaar`
3. see rc 1 printed

Workaround:
```
cat << EOF > ~/.config/systemd/user/app-solaar@autostart.service.d/exit-tweak.conf 
[Service]
SuccessExitStatus=0 1
EOF
systemctl --user daemon-reload
```


Discussion:

Resolving patch:
diff --git a/lib/solaar/gtk.py b/lib/solaar/gtk.py
--- a/lib/solaar/gtk.py
+++ b/lib/solaar/gtk.py
@@ -133,7 +133,7 @@ def _handlesig(signl, stack):
             faulthandler.dump_traceback()
         sys.exit('%s: exit due to keyboard interrupt' % (NAME.lower()))
     else:
-        sys.exit('')
+        sys.exit(0)
 
 
 def main():


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
rules file with no rules causes exception in Solaar
See #2222 for an example.


Discussion:

Resolving patch:
diff --git a/lib/logitech_receiver/diversion.py b/lib/logitech_receiver/diversion.py
--- a/lib/logitech_receiver/diversion.py
+++ b/lib/logitech_receiver/diversion.py
@@ -1545,7 +1545,8 @@ def convert(elem):
             _log.info('saving %d rule(s) to %s', len(rules_to_save), file_name)
         try:
             with open(file_name, 'w') as f:
-                f.write('%YAML 1.3\n')  # Write version manually
+                if rules_to_save:
+                    f.write('%YAML 1.3\n')  # Write version manually
                 _yaml_dump_all(convert([r['Rule'] for r in rules_to_save]), f, **dump_settings)
         except Exception as e:
             _log.error('failed to save to %s\n%s', file_name, e)
diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py
--- a/lib/solaar/cli/show.py
+++ b/lib/solaar/cli/show.py
@@ -86,7 +86,7 @@ def _print_device(dev, num=None):
     try:
         dev.ping()
     except _base.NoSuchDevice:
-        print('  %d: Device not found' % num or dev.number)
+        print('  %s: Device not found' % num or dev.number)
         return
 
     print('  %d: %s' % (num or dev.number, dev.name))


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
GUI: Add padding to devices scrollable view
**Information**
<!-- The version of Solaar in this repository has more features than released vesions.  Update to this version before asking for a new feature. -->
- Solaar version: solaar 1.1.11rc1-3-ge1ac8b5
- Distribution: Ubuntu 20.04

**Is your feature request related to a problem? Please describe.**
The latest GUI misses some whitespace on the scrollable view visible on the screenshot below. The

1. The text 'Backlight' has no whitespace to the left side of the surrounding rectangle.
2. It misses some top and bottom padding. On the screenshot shows the lack of padding on top. This leads to the impression, that there should be more content above, but there isn't. The same issue applies to the bottom padding, where input selections directly hit the surrounding rectangle too.

![Screenshot from 2024-02-11](https://github.com/pwr-Solaar/Solaar/assets/16444067/469e94b1-f4dd-4c8d-a8be-c070ce4c3537)

**Describe the solution you'd like**

- 'Backlight' etc should get a little spacing padding between the border.
- The scrollable view should get top and bottom padding. Thus, the viewer can see that the top or bottom end is reached.




Discussion:

Resolving patch:
diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py
--- a/lib/solaar/ui/config_panel.py
+++ b/lib/solaar/ui/config_panel.py
@@ -740,13 +740,13 @@ def _disable_listbox_highlight_bg(lb):
 def create():
     global _box
     assert _box is None
-    _box = Gtk.VBox(homogeneous=False, spacing=8)
+    _box = Gtk.VBox(homogeneous=False, spacing=4)
     _box._last_device = None
 
     config_scroll = Gtk.ScrolledWindow()
     config_scroll.add(_box)
     config_scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
-    config_scroll.set_shadow_type(Gtk.ShadowType.IN)
+    config_scroll.set_shadow_type(Gtk.ShadowType.NONE)  # was IN
     config_scroll.set_size_request(0, 350)  # ask for enough vertical space for about eight settings
 
     return config_scroll
diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py
--- a/lib/solaar/ui/window.py
+++ b/lib/solaar/ui/window.py
@@ -134,7 +134,7 @@ def _status_line(label_text):
     p._lux = _status_line(_('Lighting'))
     p.pack_start(p._lux, False, False, 0)
 
-    #    p.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), False, False, 0)  # spacer
+    p.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), False, False, 0)  # spacer
 
     p._config = _config_panel.create()
     p.pack_end(p._config, True, True, 4)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
PNG icons installed as scalable icons
The 1.1.11 pre-releases install various PNG icons in `/usr/share/icons/hicolor/scalable/apps/`, but the `scalable` hierarchy is reserved for scalable (SVG) icons.


Discussion:
Hmm.  I think that this has been the case for quite some time, but it should be fixed.
The solution is to convert them to svg.  The result is not great, but the png images are also not great and the png files are only used for some old hardware that might be used by any user of Solaar.  As well, the names of these icons have been changed to include `solaar` as should have been done.

Resolving patch:
diff --git a/lib/solaar/ui/icons.py b/lib/solaar/ui/icons.py
--- a/lib/solaar/ui/icons.py
+++ b/lib/solaar/ui/icons.py
@@ -101,7 +101,7 @@ def _battery_icon_name(level, charging):
 def lux(level=None):
     if level is None or level < 0:
         return 'light_unknown'
-    return 'light_%03d' % (20 * ((level + 50) // 100))
+    return 'solaar-light_%03d' % (20 * ((level + 50) // 100))
 
 
 #
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ def _data_files():
     from os.path import dirname as _dirname
 
     yield 'share/icons/hicolor/scalable/apps', _glob('share/solaar/icons/solaar*.svg')
-    yield 'share/icons/hicolor/scalable/apps', _glob('share/solaar/icons/light_*.png')
+    yield 'share/icons/hicolor/32x32/apps', _glob('share/solaar/icons/light_*.png')
 
     for mo in _glob('share/locale/*/LC_MESSAGES/solaar.mo'):
         yield _dirname(mo), [mo]


Test patch:
Repository: pwr-Solaar/Solaar

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 



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -87,7 +87,7 @@ def _data_files():
         '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'],


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -3,7 +3,7 @@ name: tests
 on: [push, pull_request]
 
 jobs:
-  build:
+  ubuntu-tests:
     runs-on: ubuntu-latest
 
     strategy:
@@ -11,28 +11,27 @@ jobs:
         python-version: [3.7, 3.12]
 
     steps:
-    - uses: actions/checkout@v3
+    - name: Checkout
+      uses: actions/checkout@v4
 
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v4.3.0
+      uses: actions/setup-python@v5
       with:
         python-version: ${{ matrix.python-version }}
 
     - name: Install Ubuntu dependencies
       run: |
-        sudo apt update
-        sudo apt install libdbus-1-dev libglib2.0-dev
+        make install_apt
 
     - name: Install Python dependencies
       run: |
-        python -m pip install --upgrade pip
-        pip install -e .[test]
+        make install_pip PIP_ARGS='.["test"]'
 
     - name: Run tests on Ubuntu
       run: |
-        pytest
+        make test
 
-  macos-build:
+  macos-tests:
     runs-on: macos-latest
 
     strategy:
@@ -40,23 +39,22 @@ jobs:
         python-version: [3.7, 3.12]
 
     steps:
-    - name: Checkout code
-      uses: actions/checkout@v3
+    - name: Checkout
+      uses: actions/checkout@v4
 
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v4.3.0
+      uses: actions/setup-python@v5
       with:
         python-version: ${{ matrix.python-version }}
 
     - name: Set up macOS dependencies
       run: |
-        brew install hidapi gtk+3 pygobject3
+        make install_brew
 
     - name: Install Python dependencies
       run: |
-        python -m pip install --upgrade pip
-        pip install ."[test]"
+        make install_pip PIP_ARGS='.["test"]'
 
     - name: Run tests on macOS
       run: |
-        pytest
+        make test
Repository: pwr-Solaar/Solaar

Issue:
Drop support for EOL Python 3.7
**Information**
- Solaar version: 1.1.12

**Describe the solution you'd like**
Drop support for Python 3.7, which is end-of-life since June 2023 and increase minimum supported version to Python 3.8, which is the oldest maintained version till October 2024.

Python 3.8 brought many improvements regarding type hints, which are used for new Solaar code.

https://devguide.python.org/versions/


Discussion:

Resolving patch:
diff --git a/lib/hid_parser/__init__.py b/lib/hid_parser/__init__.py
--- a/lib/hid_parser/__init__.py
+++ b/lib/hid_parser/__init__.py
@@ -14,17 +14,13 @@
 from typing import Iterable
 from typing import Iterator
 from typing import List
+from typing import Literal
 from typing import Optional
 from typing import Sequence
 from typing import TextIO
 from typing import Tuple
 from typing import Union
 
-if sys.version_info >= (3, 8):
-    from typing import Literal
-else:  # pragma: no cover
-    from typing_extensions import Literal
-
 import hid_parser.data
 
 __version__ = "0.0.3"
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,7 @@ def _data_files():
     # sudo apt install python-gi python3-gi \
     #        gir1.2-gtk-3.0 gir1.2-notify-0.7 gir1.2-ayatanaappindicator3-0.1
     # os_requires=['gi.repository.GObject (>= 2.0)', 'gi.repository.Gtk (>= 3.0)'],
-    python_requires=">=3.7",
+    python_requires=">=3.8",
     install_requires=[
         'evdev (>= 1.1.2) ; platform_system=="Linux"',
         "pyudev (>= 0.13)",


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -8,7 +8,7 @@ jobs:
 
     strategy:
       matrix:
-        python-version: [3.7, 3.12]
+        python-version: [3.8, 3.12]
 
     steps:
     - name: Checkout
@@ -36,7 +36,7 @@ jobs:
 #
 #    strategy:
 #      matrix:
-#        python-version: [3.7, 3.12]
+#        python-version: [3.8, 3.12]
 #
 #    steps:
 #    - name: Checkout
Repository: Anselmoo/spectrafit

Issue:
[Docs]: Using builtin release drafter
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Missing Information in the Docs

https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes

### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.


Resolving patch:
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py
--- a/spectrafit/__init__.py
+++ b/spectrafit/__init__.py
@@ -1,2 +1,2 @@
 """SpectraFit, fast command line tool for fitting data."""
-__version__ = "0.16.4"
+__version__ = "1.0.0a0"


Test patch:
Repository: Anselmoo/spectrafit

Issue:
[Docs]: Update release drafter
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Missing Information in the Docs

- Link to the complete changes of the latest release.
- Exclude auto commits in the contributor list

### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py
--- a/spectrafit/__init__.py
+++ b/spectrafit/__init__.py
@@ -1,2 +1,2 @@
 """SpectraFit, fast command line tool for fitting data."""
-__version__ = "1.0.0a0"
+__version__ = "1.0.0a1"


Test patch:
Repository: Anselmoo/spectrafit

Issue:
[Docs]: Using mike for versioning docs
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Missing Information in the Docs

https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/

### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py
--- a/spectrafit/__init__.py
+++ b/spectrafit/__init__.py
@@ -1,2 +1,2 @@
 """SpectraFit, fast command line tool for fitting data."""
-__version__ = "1.0.0a2"
+__version__ = "1.0.0a3"


Test patch:
Repository: Anselmoo/spectrafit

Issue:
[Docs]: Update labeled criteria for CHANGELOG
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Missing Information in the Docs

Update the labeler criteria for avoiding double labels in `CHANGELOG.md`

### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py
--- a/spectrafit/__init__.py
+++ b/spectrafit/__init__.py
@@ -1,2 +1,2 @@
 """SpectraFit, fast command line tool for fitting data."""
-__version__ = "1.0.0a7"
+__version__ = "1.0.0a8"


Test patch:
Repository: Anselmoo/spectrafit

Issue:
[Bug]: ASCII Char in creating branch
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

Is crashing

### Expected Behavior

Is realising a change in changeling

### Steps To Reproduce

_No response_

### ⚙️ Environment

```markdown
- OS:
- Python:
- spectrafit:
```


### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py
--- a/spectrafit/__init__.py
+++ b/spectrafit/__init__.py
@@ -1,2 +1,2 @@
 """SpectraFit, fast command line tool for fitting data."""
-__version__ = "1.0.0b1"
+__version__ = "1.0.0b2"


Test patch:
Repository: Anselmoo/spectrafit

Issue:
[Feature]: Add python 3.11 support
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Missing Feature

Add python 3.11 support

### Possible Solution

_No response_

### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py
--- a/spectrafit/__init__.py
+++ b/spectrafit/__init__.py
@@ -1,2 +1,2 @@
 """SpectraFit, fast command line tool for fitting data."""
-__version__ = "0.16.6"
+__version__ = "0.16.7"


Test patch: