Skip to content

Commit ff81fa6

Browse files
Copilotdhondta
andcommitted
Fix workflow warnings: update action versions and fix pytest warnings
Co-authored-by: dhondta <9108102+dhondta@users.noreply.github.com> Agent-Logs-Url: https://github.com/dhondta/python-tinyscript/sessions/2f38b644-3913-42e3-96f9-5d9f140e5037
1 parent f4e6c4e commit ff81fa6

5 files changed

Lines changed: 20 additions & 14 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
os: [ubuntu-latest]
2626
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Install pandoc
@@ -47,9 +47,9 @@ jobs:
4747
env:
4848
cov_badge_path: docs/coverage.svg
4949
steps:
50-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v4
5151
- name: Set up Python ${{ matrix.python-version }}
52-
uses: actions/setup-python@v4
52+
uses: actions/setup-python@v5
5353
with:
5454
python-version: "3.13"
5555
- name: Install pandoc
@@ -66,7 +66,7 @@ jobs:
6666
pytest --cov=$package --cov-report=xml
6767
genbadge coverage -i coverage.xml -o $cov_badge_path
6868
- name: Verify Changed files
69-
uses: tj-actions/verify-changed-files@v17
69+
uses: tj-actions/verify-changed-files@v20
7070
id: changed_files
7171
with:
7272
files: ${{ env.cov_badge_path }}
@@ -79,19 +79,19 @@ jobs:
7979
git commit -m "Updated coverage.svg"
8080
- name: Push changes
8181
if: steps.changed_files.outputs.files_changed == 'true'
82-
uses: ad-m/github-push-action@master
82+
uses: ad-m/github-push-action@v1.0.0
8383
with:
8484
github_token: ${{ secrets.github_token }}
8585
branch: ${{ github.ref }}
8686
deploy:
8787
runs-on: ubuntu-latest
8888
needs: coverage
8989
steps:
90-
- uses: actions/checkout@v3
90+
- uses: actions/checkout@v4
9191
with:
9292
fetch-depth: 0
9393
- name: Check for version change
94-
uses: dorny/paths-filter@v2
94+
uses: dorny/paths-filter@v4
9595
id: filter
9696
with:
9797
filters: |

pytest.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
[pytest]
22
pythonpath = src
3+
filterwarnings =
4+
ignore::UserWarning:plyer
5+
ignore:.*multi-threaded.*fork.*:DeprecationWarning:multiprocessing
6+
ignore::UserWarning:_distutils_hack
7+
ignore:.*crypt.*:DeprecationWarning:codext

src/tinyscript/helpers/fexec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _read(pipe, queue):
101101
finally:
102102
queue.put(None)
103103

104-
bs, out, err = kwargs.pop('bufsize', 1), b"", b""
104+
bs, out, err = kwargs.pop('bufsize', -1), b"", b""
105105
patterns = [b(x) for x in (patterns or [])]
106106
p = subprocess.Popen(__set_cmd(cmd, **kwargs), stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=bs, **kwargs)
107107
q = Queue()

tests/test_helpers_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@ def test_deprecation(self):
9595
def test_func(): pass
9696
deprecate(test_func, "new_test_func")
9797
self.assertIsNone(test_func())
98-
deprecate("old.module", "new.module")
98+
with self.assertWarns(DeprecationWarning):
99+
deprecate("old.module", "new.module")
99100

tests/test_helpers_fexec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919

2020
@process
21-
def test1():
21+
def _proc():
2222
pass
2323

2424

2525
@thread
26-
def test2():
26+
def _thrd():
2727
pass
2828

2929

@@ -57,8 +57,8 @@ def test_execution_functions(self):
5757
self.assertIn(b"PATTERN1", err)
5858
self.assertNotEqual(retc, 0)
5959
self.assertIsNotNone(filter_bin("cat", "id", "netstat", "whoami"))
60-
self.assertIsNotNone(test1())
61-
self.assertIsNotNone(test2())
60+
self.assertIsNotNone(_proc())
61+
self.assertIsNotNone(_thrd())
6262
self.assertIsNone(processes_clean())
6363
self.assertIsNone(threads_clean())
6464
self.assertEqual(apply([lambda x: x+1, lambda x: x+2], (1, )), [2, 3])

0 commit comments

Comments
 (0)