Repository: autokey/autokey (language: python)

Issue:
Bump action versions in workflow files
### AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?

Xorg

### Has this issue already been reported?

- [X] I have searched through the existing issues.

### Is this a question rather than an issue?

- [X] This is not a question.

### What type of issue is this?

Enhancement

### Choose one or more terms that describe this issue:

- [ ] autokey triggers
- [ ] autokey-gtk
- [ ] autokey-qt
- [ ] beta
- [ ] bug
- [ ] critical
- [X] development
- [ ] documentation
- [ ] enhancement
- [ ] installation/configuration
- [ ] phrase expansion
- [ ] scripting
- [ ] technical debt
- [ ] user interface

### Other terms that describe this issue if not provided above:

update

### Which Linux distribution did you use?

_No response_

### Which AutoKey GUI did you use?

None

### Which AutoKey version did you use?

_No response_

### How did you install AutoKey?

_No response_

### Can you briefly describe the issue?

Update the action versions in the [pages.yml](https://github.com/autokey/autokey/blob/master/.github/workflows/pages.yml) file, the [build.yml](https://github.com/autokey/autokey/blob/master/.github/workflows/build.yml) file, and the [python-test.yml](https://github.com/autokey/autokey/blob/master/.github/workflows/python-test.yml) file.



### Can the issue be reproduced?

None

### What are the steps to reproduce the issue?

_No response_

### What should have happened?

_No response_

### What actually happened?

_No response_

### Do you have screenshots?

_No response_

### Can you provide the output of the AutoKey command?

_No response_

### Anything else?

_No response_
<br/>
<hr/>

<details><summary>This repo is using Opire - what does it mean? 👇</summary><br/>💵 Everyone can add rewards for this issue commenting <code>/reward 100</code> (replace <code>100</code> with the amount).<br/>🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment <code>/try</code> to let everyone know!<br/>🙌 And when they open the PR, they can comment <code>/claim #963</code> either in the PR description or in a PR's comment.<br/><br/>🪙 Also, everyone can tip any user commenting <code>/tip 20 @Elliria</code> (replace <code>20</code> with the amount, and <code>@Elliria</code> with the user to tip).<br/><br/>📖 If you want to learn more, check out our <a href="https://docs.opire.dev">documentation</a>.</details>
Help requested with lint and pytest errors in workflows
### AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?

Xorg

### Has this issue already been reported?

- [X] I have searched through the existing issues.

### Is this a question rather than an issue?

- [X] This is not a question.

### What type of issue is this?

Enhancement

### Choose one or more terms that describe this issue:

- [ ] autokey triggers
- [ ] autokey-gtk
- [ ] autokey-qt
- [ ] beta
- [ ] bug
- [ ] critical
- [X] development
- [ ] documentation
- [ ] enhancement
- [ ] installation/configuration
- [ ] phrase expansion
- [ ] scripting
- [ ] technical debt
- [ ] user interface

### Other terms that describe this issue if not provided above:

update

### Which Linux distribution did you use?

_No response_

### Which AutoKey GUI did you use?

None

### Which AutoKey version did you use?

_No response_

### How did you install AutoKey?

_No response_

### Can you briefly describe the issue?

We're getting two errors when pull requests are merged:

## Lint error:
The [lint error](https://github.com/autokey/autokey/actions/runs/10863552720/job/30147823053?pr=958) has this complaint:
```python
Running: flake8 --count --select=E9,F63,F7,F82 --show-source --statistics --builtins=_ --max-complexity=10 --max-line-length=127 lib/autokey tests
lib/autokey/uinput_interface.py:174:35: F821 undefined name 'IoMediator'
        self.mediator = mediator  # type: IoMediator
                                  ^
lib/autokey/uinput_interface.py:827:79: F821 undefined name 'keyName'
            logger.warning("Error sending modified key %r %r: %s", modifiers, keyName, str(e))
                                                                              ^
2     F821 undefined name 'IoMediator'
2
Flake8 error
```
It's complaining about [line 174](https://github.com/autokey/autokey/blob/b51c6bab269b6c4381f737d1d7ddd733cf6b0638/lib/autokey/uinput_interface.py#L174) of the `uinput_interface.py` file. Interestingly, that file only exists on the **develop** branch.

[Line 174](https://github.com/autokey/autokey/blob/b51c6bab269b6c4381f737d1d7ddd733cf6b0638/lib/autokey/uinput_interface.py#L174) of that file looks like this:
```python
        self.mediator = mediator  # type: IoMediator
```
It seems that a comment on that line is causing the trouble. What I don't know is whether the comment should be edited (and if so, to what?) or deleted and whether there would be any negative consequences to either of those. Google isn't very forthcoming when asked for information on "IoMediator". Any help with this would be appreciated.

## pytest error:
The [pytest error](https://github.com/autokey/autokey/actions/runs/10863552720/job/30147822981?pr=958) looks like this:
```python
report: commands[2]> coverage html
/home/runner/work/autokey/autokey/.tox/report/lib/python3.10/site-packages/coverage/html.py:123: CoverageWarning: No contexts were measured
  self.coverage._warn("No contexts were measured")
Wrote HTML report to test_coverage_report_html/index.html
  clean: OK (2.21=setup[1.95]+cmd[0.26] seconds)
  coverage: FAIL code 2 (18.21=setup[11.63]+cmd[6.57] seconds)
  report: OK (6.21=setup[1.72]+cmd[0.10,1.25,3.15] seconds)
  evaluation failed :( (26.83 seconds)
Error: Process completed with exit code 255.
```
It's complaining about **code 2**, which means invalid use of a shell built-in command, and it's exiting with **code 255**, which means there's an environment issue.

[This WordPress page](https://dotjoeblog.wordpress.com/2021/03/14/github-actions-aws-error-exit-code-255/) suggests that this is an AWS error due to a change in `ubuntu-latest`, which our project does use. That page makes these recommendations for us to pick from:
```
The quick, guaranteed-to-break-later workaround is to change the actions runner to ubuntu-18.04.

A better solution is to add AWS_DEFAULT_REGION to the action’s environment. 
```
The second one sounds better to me, but I'm not sure how to implement it. Some Googling suggested that we need to put the **AWS_DEFAULT_REGION** environment variable into the `AWS` config file. We don't have an `AWS` config file, so we'd need to find out where to put it and whether we would **just** put **AWS_DEFAULT_REGION** into it to solve that problem or whether it would need more contents (and what they would need to be). I'm assuming the file would go into the [.github/workflows](https://github.com/autokey/autokey/tree/master/.github/workflows) directory, but maybe it goes into the [config](https://github.com/autokey/autokey/tree/master/config) directory or elsewhere entirely.

Any help with this would be appreciated.


### Can the issue be reproduced?

None

### What are the steps to reproduce the issue?

1. Submit a pull request.
2. Merge the pull request.


### What should have happened?

The pull request should go through with no errors.

### What actually happened?

A [lint error](https://github.com/autokey/autokey/actions/runs/10863552720/job/30147823053?pr=958) and a [pytest error](https://github.com/autokey/autokey/actions/runs/10863552720/job/30147822981?pr=958) are produced.

### Do you have screenshots?

_No response_

### Can you provide the output of the AutoKey command?

_No response_

### Anything else?

_No response_
<br/>
<hr/>

<details><summary>This repo is using Opire - what does it mean? 👇</summary><br/>💵 Everyone can add rewards for this issue commenting <code>/reward 100</code> (replace <code>100</code> with the amount).<br/>🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment <code>/try</code> to let everyone know!<br/>🙌 And when they open the PR, they can comment <code>/claim #965</code> either in the PR description or in a PR's comment.<br/><br/>🪙 Also, everyone can tip any user commenting <code>/tip 20 @Elliria</code> (replace <code>20</code> with the amount, and <code>@Elliria</code> with the user to tip).<br/><br/>📖 If you want to learn more, check out our <a href="https://docs.opire.dev">documentation</a>.</details>
Bump action versions in workflow files
### AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?

Xorg

### Has this issue already been reported?

- [X] I have searched through the existing issues.

### Is this a question rather than an issue?

- [X] This is not a question.

### What type of issue is this?

Enhancement

### Choose one or more terms that describe this issue:

- [ ] autokey triggers
- [ ] autokey-gtk
- [ ] autokey-qt
- [ ] beta
- [ ] bug
- [ ] critical
- [X] development
- [ ] documentation
- [ ] enhancement
- [ ] installation/configuration
- [ ] phrase expansion
- [ ] scripting
- [ ] technical debt
- [ ] user interface

### Other terms that describe this issue if not provided above:

update

### Which Linux distribution did you use?

_No response_

### Which AutoKey GUI did you use?

None

### Which AutoKey version did you use?

_No response_

### How did you install AutoKey?

_No response_

### Can you briefly describe the issue?

Update the action versions in the [pages.yml](https://github.com/autokey/autokey/blob/master/.github/workflows/pages.yml) file, the [build.yml](https://github.com/autokey/autokey/blob/master/.github/workflows/build.yml) file, and the [python-test.yml](https://github.com/autokey/autokey/blob/master/.github/workflows/python-test.yml) file.



### Can the issue be reproduced?

None

### What are the steps to reproduce the issue?

_No response_

### What should have happened?

_No response_

### What actually happened?

_No response_

### Do you have screenshots?

_No response_

### Can you provide the output of the AutoKey command?

_No response_

### Anything else?

_No response_
<br/>
<hr/>

<details><summary>This repo is using Opire - what does it mean? 👇</summary><br/>💵 Everyone can add rewards for this issue commenting <code>/reward 100</code> (replace <code>100</code> with the amount).<br/>🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment <code>/try</code> to let everyone know!<br/>🙌 And when they open the PR, they can comment <code>/claim #963</code> either in the PR description or in a PR's comment.<br/><br/>🪙 Also, everyone can tip any user commenting <code>/tip 20 @Elliria</code> (replace <code>20</code> with the amount, and <code>@Elliria</code> with the user to tip).<br/><br/>📖 If you want to learn more, check out our <a href="https://docs.opire.dev">documentation</a>.</details>


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5ced7781..606188f7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -18,16 +18,16 @@ jobs:
       matrix:
         python-version: [3.10.1]
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
       with:
         fetch-depth: 0
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v4
+      uses: actions/setup-python@v5
       with:
         python-version: ${{ matrix.python-version }}
 
     - name: Cache pip
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       with:
         # This path is specific to Ubuntu
         path: ~/.cache/pip
@@ -53,7 +53,7 @@ jobs:
         mv ../*.deb debs
 
     - name: Upload built debs as artifacts
-      uses: actions/upload-artifact@master
+      uses: actions/upload-artifact@v4
       with:
         name: debs
         path: debs
@@ -66,14 +66,14 @@ jobs:
       matrix:
         python-version: [3.10.1]
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v4
+      uses: actions/setup-python@v5
       with:
         python-version: ${{ matrix.python-version }}
 
     - name: Cache pip
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       with:
         # This path is specific to Ubuntu
         path: ~/.cache/pip
@@ -99,7 +99,7 @@ jobs:
         --outdir dist/
 
     - name: Upload built dist as artifact
-      uses: actions/upload-artifact@master
+      uses: actions/upload-artifact@v4
       with:
         name: dist
         path: dist/
@@ -113,7 +113,7 @@ jobs:
         python-version: [3.10.1]
     needs: [build_pypi_wheel, build_deb]
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
       with:
         # Fetch all history so that we get tags.
         fetch-depth: 0
@@ -128,12 +128,12 @@ jobs:
         check-name: 'pytest (3.10.1)'
 
     - name: Download built dist as artifact
-      uses: actions/download-artifact@master
+      uses: actions/download-artifact@v4
       with:
         name: dist
         path: dist/
     - name: Download built debs as artifacts
-      uses: actions/download-artifact@master
+      uses: actions/download-artifact@v4
       with:
         name: debs
         path: ../debs
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index 3a0ff947..e5d9ab3d 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -14,9 +14,9 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: checkout repo
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
       - name: Upload artifact
-        uses: actions/upload-pages-artifact@v2
+        uses: actions/upload-pages-artifact@v3
         with:
           path: doc/scripting
   deploy:
@@ -29,5 +29,5 @@ jobs:
     steps:
       - name: Deploy to GitHub Pages
         id: deployment
-        uses: actions/deploy-pages@v2
+        uses: actions/deploy-pages@v4
           
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 9963d7ca..2a34f4c1 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,13 @@ Changelog
 
 Next Version
 ============================
+
+Important misc changes
+----------------------
+- Bump action versions in pages.yml to satisfy part of issue #963.
+- Bump action versions in build.yml to satisfy part of issue #963.
+- Bump action versions in python-test.yml to satisfy part of issue #963.
+
 Other
 +++++
 - Add `show_recent_script_errors_dialog` to display errors with millisecond precision.


Test patch:
diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml
index 306b3bb2..3e3b257a 100644
--- a/.github/workflows/python-test.yml
+++ b/.github/workflows/python-test.yml
@@ -24,14 +24,14 @@ jobs:
         python-version: ["3.7", "3.10"]
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "${{ matrix.python-version }}"
 
       - name: Cache pip
-        uses: actions/cache@v3
+        uses: actions/cache@v4
         with:
           # This path is specific to Ubuntu
           path: ~/.cache/pip
@@ -86,16 +86,16 @@ jobs:
         python-version: ["3.7", "3.10"]
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
         with:
           fetch-depth: 0
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "${{ matrix.python-version }}"
 
       - name: Cache pip
-        uses: actions/cache@v3
+        uses: actions/cache@v4
         with:
           # This path is specific to Ubuntu
           path: ~/.cache/pip
@@ -117,7 +117,7 @@ jobs:
         run: tox -e clean,coverage,report
 
       - name: Upload pytest test results
-        uses: actions/upload-artifact@v3
+        uses: actions/upload-artifact@v4
         with:
           name: pytest-results-${{ matrix.python-version }}
           path: junit/test-results-${{ matrix.python-version }}.xml
@@ -128,7 +128,7 @@ jobs:
         run: tar -cvzf test_coverage_report-${{ matrix.python-version }}.tar.gz test_coverage_report_html/
 
       - name: Upload test coverage report
-        uses: actions/upload-artifact@v3
+        uses: actions/upload-artifact@v4
         with:
           name: test_coverage_report-${{ matrix.python-version }}.tar.gz
           path: test_coverage_report-${{ matrix.python-version }}.tar.gz
@@ -145,9 +145,9 @@ jobs:
         python-version: ["3.7", "3.10"]
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "${{ matrix.python-version }}"