Skip to content

Commit d9af7fc

Browse files
committed
Update CI tests configuration and release info
1 parent 08bce2e commit d9af7fc

6 files changed

Lines changed: 25 additions & 23 deletions

File tree

.github/workflows/test-elementpath.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
os: [ubuntu-latest, macos-latest, windows-latest]
17-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14.0", "3.15.0-alpha.3", "pypy-3.10"]
17+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14.0", "3.15.0-beta.2", "pypy-3.10", "pypy-3.11"]
1818
exclude:
1919
- os: macos-latest
2020
python-version: 3.10
@@ -35,18 +35,13 @@ jobs:
3535
run: |
3636
pip install flake8
3737
flake8 elementpath --max-line-length=100 --statistics
38-
- name: Lint with mypy==1.18.2
39-
if: ${{ matrix.python-version == '3.15.0-alpha.3' || matrix.python-version == 'pypy-3.10' }}
38+
- name: Lint with mypy==2.1.0
39+
if: ${{ matrix.python-version != 'pypy-3.10' && matrix.python-version != 'pypy-3.11' }}
4040
run: |
41-
pip install mypy==1.18.2 xmlschema lxml-stubs
42-
mypy --show-error-codes --strict elementpath
43-
- name: Lint with mypy==1.19.1
44-
if: ${{ matrix.python-version != '3.15.0-alpha.3' && matrix.python-version != 'pypy-3.10' }}
45-
run: |
46-
pip install mypy==1.19.1 xmlschema lxml-stubs
41+
pip install mypy==2.1.0 xmlschema lxml-stubs
4742
mypy --show-error-codes --strict elementpath
4843
- name: Install optional dependencies
49-
if: ${{ matrix.python-version != '3.15.0-alpha.3' }}
44+
if: ${{ matrix.python-version != '3.15.0-beta.2' }}
5045
run: pip install lxml
5146
- name: Test with unittest
5247
run: |

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
CHANGELOG
33
*********
44

5+
`v5.1.2`_ (2026-06-08)
6+
======================
7+
* Include PR #101 (invalid sequence type error code for external functions)
8+
* Fix issues #100 and #102
9+
510
`v5.1.1`_ (2026-01-20)
611
======================
712
* Fix external function registrations (issue #099)
@@ -537,3 +542,4 @@ CHANGELOG
537542
.. _v5.0.4: https://github.com/sissaschool/elementpath/compare/v5.0.3...v5.0.4
538543
.. _v5.1.0: https://github.com/sissaschool/elementpath/compare/v5.0.4...v5.1.0
539544
.. _v5.1.1: https://github.com/sissaschool/elementpath/compare/v5.1.0...v5.1.1
545+
.. _v5.1.2: https://github.com/sissaschool/elementpath/compare/v5.1.1...v5.1.2

elementpath/xpath_tokens/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ def child_axis(self) -> bool:
154154
return True
155155
return not self._items[1].label.endswith('function')
156156

157+
def is_reference(self) -> bool:
158+
"""Is `True` if the token is a function reference, `False` otherwise."""
159+
return False
160+
157161
###
158162
# Tokens tree analysis methods
159163
def iter_leaf_elements(self) -> Iterator[str]:
@@ -321,7 +325,7 @@ def get_argument(self, context: ta.ContextType,
321325
else:
322326
return default
323327
else:
324-
if isinstance(token, XPathToken) and callable(token) and token.is_reference():
328+
if token.is_reference():
325329
return token # It's a function reference
326330

327331
item = None

elementpath/xpath_tokens/functions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,8 @@ def max_args(self) -> Optional[int]:
227227
else:
228228
return None
229229

230-
def is_reference(self) -> int:
231-
if not isinstance(self.nargs, int):
232-
return False
233-
return self.nargs and not len(self._items)
230+
def is_reference(self) -> bool:
231+
return isinstance(self.nargs, int) and self.nargs != 0 and not self._items
234232

235233
def nud(self) -> 'XPathFunction':
236234
if not self.parser.parse_arguments:

publiccode.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ publiccodeYmlVersion: '0.4'
66
name: elementpath
77
url: 'https://github.com/sissaschool/elementpath'
88
landingURL: 'https://github.com/sissaschool/elementpath'
9-
releaseDate: '2025-01-20'
10-
softwareVersion: v5.1.1
9+
releaseDate: '2025-06-08'
10+
softwareVersion: v5.1.2
1111
developmentStatus: stable
1212
platforms:
1313
- linux

tox.ini

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
[tox]
77
min_version = 4.0
88
envlist =
9-
py{310,311,312,313,314,314,314-opt,315,315-lxml,py310,py311}, docs, flake8,
10-
mypy-py{310,311,312,313,314,315,py3}, pytest, coverage,
9+
flake8, py{310,311,312,313,314,314,314-opt,315,315-lxml,py310,py311},
10+
docs, mypy-py{310,311,312,313,314,315}, pytest, coverage,
1111
xmlschema{401,410}, w3c-xsdtests, w3c-qt3tests
1212
skip_missing_interpreters = true
1313
work_dir = {tox_root}/../.tox/elementpath
@@ -60,10 +60,9 @@ commands =
6060
flake8 elementpath
6161
flake8 tests
6262

63-
[testenv:mypy-py{310,311,312,313,314,315,py3}]
63+
[testenv:mypy-py{310,311,312,313,314,315}]
6464
deps =
65-
mypy==1.19.1; platform_python_implementation != 'PyPy'
66-
mypy==1.18.2; platform_python_implementation == 'PyPy'
65+
mypy==2.1.0
6766
xmlschema~=4.2.0
6867
lxml-stubs
6968
commands =
@@ -95,7 +94,7 @@ set_env =
9594
xmlschema420: VERSION = 4.2.0
9695
change_dir = {env_tmp_dir}
9796
deps =
98-
mypy==1.19.1
97+
mypy==2.1.0
9998
lxml
10099
lxml-stubs
101100
jinja2

0 commit comments

Comments
 (0)