Skip to content

Commit cab300a

Browse files
committed
tox: fix lint target on python 3.13
Update all packages used in the lint target to their latest release. Explicitly bump the ubuntu image version in all GitHub action jobs. Fix errors reported by new pylint/black versions. Signed-off-by: Robin Jarry <[email protected]>
1 parent 727927b commit cab300a

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on: [push, pull_request]
77

88
jobs:
99
lint:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1111
steps:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-python@v4
@@ -36,11 +36,11 @@ jobs:
3636
- run: make check-commits
3737

3838
test:
39-
runs-on: ubuntu-20.04
39+
runs-on: ubuntu-24.04
4040
strategy:
4141
matrix:
4242
include:
43-
- python: 3.9
43+
- python: "3.9"
4444
toxenv: py39
4545
- python: "3.10"
4646
toxenv: py310
@@ -56,7 +56,7 @@ jobs:
5656
- uses: actions/checkout@v3
5757
- uses: actions/setup-python@v4
5858
with:
59-
python-version: ${{ matrix.python }}
59+
python-version: "${{ matrix.python }}"
6060
- uses: actions/cache@v3
6161
with:
6262
path: ~/.cache/pip
@@ -86,7 +86,7 @@ jobs:
8686
deploy:
8787
needs: [lint, test]
8888
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
89-
runs-on: ubuntu-latest
89+
runs-on: ubuntu-24.03
9090
steps:
9191
- uses: actions/checkout@v3
9292
- uses: actions/setup-python@v4

libyang/schema.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,9 +1542,7 @@ def defaults(self) -> Iterator[Union[None, bool, int, str, float]]:
15421542

15431543
def max_elements(self) -> Optional[int]:
15441544
return (
1545-
self.cdata_leaflist.max
1546-
if self.cdata_leaflist.max != (2**32 - 1)
1547-
else None
1545+
self.cdata_leaflist.max if self.cdata_leaflist.max != (2**32 - 1) else None
15481546
)
15491547

15501548
def min_elements(self) -> int:

libyang/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,6 @@ def data_load(in_type, in_data, data, data_keepalive, encode=True):
121121
c_str = str2c(in_data, encode=encode)
122122
data_keepalive.append(c_str)
123123
ret = lib.ly_in_new_memory(c_str, data)
124+
else:
125+
raise ValueError("invalid input")
124126
return ret

libyang/xpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def xpath_split(xpath: str) -> Iterator[Tuple[str, str, List[Tuple[str, str]]]]:
8585

8686
# -------------------------------------------------------------------------------------
8787
def _xpath_keys_to_key_name(
88-
keys: List[Tuple[str, str]]
88+
keys: List[Tuple[str, str]],
8989
) -> Optional[Union[str, Tuple[str, ...]]]:
9090
"""
9191
Extract key name from parsed xpath keys returned by xpath_split. The return value

pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ disable=
7474
too-many-branches,
7575
too-many-lines,
7676
too-many-locals,
77+
too-many-positional-arguments,
7778
too-many-return-statements,
7879
too-many-statements,
7980
unused-argument,

tox.ini

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ basepython = python3
3636
description = Format python code using isort and black.
3737
changedir = .
3838
deps =
39-
black~=23.12.1
40-
isort~=5.13.2
39+
black~=25.1.0
40+
isort~=6.0.0
4141
skip_install = true
4242
install_command = python3 -m pip install {opts} {packages}
4343
allowlist_externals =
@@ -52,14 +52,14 @@ basepython = python3
5252
description = Run coding style checks.
5353
changedir = .
5454
deps =
55-
astroid~=3.0.2
56-
black~=23.12.1
57-
flake8~=7.0.0
58-
isort~=5.13.2
59-
pycodestyle~=2.11.1
55+
astroid~=3.3.8
56+
black~=25.1.0
57+
flake8~=7.1.1
58+
isort~=6.0.0
59+
pycodestyle~=2.12.1
6060
pyflakes~=3.2.0
61-
pylint~=3.0.3
62-
setuptools~=69.0.3
61+
pylint~=3.3.4
62+
setuptools~=75.8.0
6363
allowlist_externals =
6464
/bin/sh
6565
/usr/bin/sh

0 commit comments

Comments
 (0)