Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: "windows-2022"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10'
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,3.14,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10'

strategy:
fail-fast: False
Expand All @@ -35,6 +35,7 @@ jobs:
- {python-version: "3.11", testenvs: "py311,build", experimental: False}
- {python-version: "3.12", testenvs: "py312,build", experimental: False}
- {python-version: "3.13", testenvs: "py313,build", experimental: False}
- {python-version: "3.14", testenvs: "py314,build", experimental: False}
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False}
- {python-version: "pypy-3.8", testenvs: "pypy38", experimental: False}
- {python-version: "pypy-3.9-v7.3.15", testenvs: "pypy39", experimental: True}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: "ubuntu-22.04"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10'
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,3.14,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10'

strategy:
fail-fast: False
Expand All @@ -36,6 +36,7 @@ jobs:
- {python-version: "3.11", testenvs: "py311,build", experimental: False}
- {python-version: "3.12", testenvs: "py312,build", experimental: False}
- {python-version: "3.13", testenvs: "py313,build", experimental: False}
- {python-version: "3.14", testenvs: "py314,build", experimental: False}
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False}
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False}
- {python-version: "pypy-3.9", testenvs: "pypy39,build", experimental: True}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: "macos-${{ matrix.config.os-ver }}"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10'
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,3.14,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10'

strategy:
fail-fast: False
Expand All @@ -35,6 +35,7 @@ jobs:
- {python-version: "3.11", os-ver: "14", testenvs: "py311,build", experimental: False}
- {python-version: "3.12", os-ver: "14", testenvs: "py312,build", experimental: False}
- {python-version: "3.13", os-ver: "14", testenvs: "py313,build", experimental: False}
- {python-version: "3.14", os-ver: "14", testenvs: "py314,build", experimental: False}
- {python-version: "pypy-3.7", os-ver: "15-intel", testenvs: "pypy37,build", experimental: False}
- {python-version: "pypy-3.8", os-ver: "14", testenvs: "pypy38,build", experimental: False}
- {python-version: "pypy-3.9", os-ver: "14", testenvs: "pypy39,build", experimental: True}
Expand Down
15 changes: 7 additions & 8 deletions domdf_python_tools/words.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,13 @@ def alpha_sort(

alphabet_ = list(alphabet)

try:
return sorted(iterable, key=lambda attr: [alphabet_.index(letter) for letter in attr], reverse=reverse)
except ValueError as e:
m = re.match(r"'(.*)' is not in list", str(e))
if m:
raise ValueError(f"The character {m.group(1)!r} was not found in the alphabet.") from None
else: # pragma: no cover
raise e
def _alphabet_index(letter: str) -> int:
try:
return alphabet_.index(letter)
except ValueError:
raise ValueError(f"The character {letter!r} was not found in the alphabet.") from None

return sorted(iterable, key=lambda attr: [_alphabet_index(letter) for letter in attr], reverse=reverse)


class Font(Dict[str, str]):
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down Expand Up @@ -142,7 +143,7 @@ base-classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
python-versions = [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13",]
python-versions = [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14",]
python-implementations = [ "CPython", "PyPy",]
platforms = [ "Windows", "macOS", "Linux",]
license-key = "MIT"
Expand Down
1 change: 1 addition & 0 deletions repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ python_versions:
"3.11":
"3.12":
"3.13":
"3.14":
pypy37:
pypy38:
pypy39:
Expand Down
10 changes: 8 additions & 2 deletions tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# 3rd party
import pytest
from coincidence.regressions import AdvancedDataRegressionFixture
from coincidence.selectors import not_pypy, not_windows, only_windows
from coincidence.selectors import max_version, not_pypy, not_windows, only_windows

# this package
from domdf_python_tools import paths
Expand Down Expand Up @@ -925,7 +925,13 @@ def test_sort_paths():


@pytest.mark.parametrize("path", _from_uri_paths)
@pytest.mark.parametrize("left_type", [pathlib.PurePath, pathlib.Path, PathPlus])
@pytest.mark.parametrize(
"left_type", [
pytest.param(pathlib.PurePath, marks=max_version((3, 13))),
pathlib.Path,
PathPlus,
]
)
def test_pathplus_from_uri(path: str, left_type: Type):
assert PathPlus.from_uri(left_type(path).as_uri()).as_posix() == path

Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_printr(obj, expects, capsys):
assert re.match(expects, stdout[0])


if sys.version_info >= (3, 13):
if sys.version_info[:2] == (3, 13):
pure_posix_path_expected = "<class 'pathlib._local.PurePosixPath'>"
else:
pure_posix_path_expected = "<class 'pathlib.PurePosixPath'>"
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ envlist =
py311
py312
py313
py314
pypy37
pypy38
pypy39
Expand All @@ -52,6 +53,7 @@ test =
py311
py312
py313
py314
pypy37
pypy38
pypy39
Expand Down
Loading