Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 6 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [ "3.9", "3.13", "pypy-3.9", "pypy-3.10"]
python-version: [ "3.9", "3.13", "pypy-3.9", "pypy-3.11"] # "3.14.0-beta.4"

steps:
- uses: actions/checkout@v4
Expand All @@ -33,9 +33,13 @@ jobs:
else
uv pip install --system -e ".[dev]"
fi
- name: Lint with ruff
run: |
if [ "${{ matrix.python-version }}" == "3.9" ]; then uv pip install --system ruff; fi
if [ "${{ matrix.python-version }}" == "3.9" ]; then ruff check src/reynir_correct; fi
- name: Typecheck with mypy
run: |
if [ "${{ matrix.python-version }}" == "3.9" ]; then python -m pip install mypy; fi
if [ "${{ matrix.python-version }}" == "3.9" ]; then uv pip install --system mypy; fi
if [ "${{ matrix.python-version }}" == "3.9" ]; then mypy --ignore-missing-imports --python-version=3.9 src/reynir_correct; fi
- name: Test with pytest
run: |
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "reynir-correct"
version = "4.1.0"
version = "4.1.1"
description = "Spelling and grammar correction for Icelandic"
authors = [{ name = "Miðeind ehf.", email = "mideind@mideind.is" }]
readme = { file = "README.rst", content-type = "text/x-rst" }
Expand All @@ -22,6 +22,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 @@ -61,11 +62,16 @@ filterwarnings = [
[tool.ruff]
line-length = 120

[tool.black]
line-length = 120
[tool.ruff.lint]
#select = ["ALL"] # We use default rules for now
# extend-select = ["E501"] # Complain about line length
# Ignore specific rules
# (we should aim to have these as few as possible)
ignore = [
"E731", # 'E731: Do not assign a lambda expression, use a def'
]

[tool.isort]
# This forces these imports to placed at the top
known_future_library = ["__future__", "typing", "typing_extensions"]
profile = "black"
line_length = 120
6 changes: 3 additions & 3 deletions src/reynir_correct/errtokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def word(

def __repr__(self) -> str:
return "<CorrectToken(kind: {0}, txt: '{1}', val: {2}, original: '{3}')>".format(
TOK.descr[self.kind], self.txt, self.val, self.original
TOK.descr[self.kind], self.txt, self.val, self.original # type: ignore
)

__str__ = __repr__
Expand All @@ -383,7 +383,7 @@ def concatenate(self, other: Tok, *, separator: str = "", metadata_from_other: b
self_txt = self.txt or ""
other_txt = other.txt or ""
new_txt = self_txt + separator + other_txt
self_original = self.original or ""
self_original = self.original or "" # type: ignore
other_original = other.original or ""
new_original = self_original + other_original

Expand Down Expand Up @@ -433,7 +433,7 @@ def copy(self, other: Union[Tok, Sequence[Tok]], coalesce: bool = False) -> bool
from another CorrectToken instance"""
if isinstance(other, CorrectToken):
self._err = other._err
self.original = other.original
self.original = other.original # type: ignore
if coalesce and other.error_span > 1:
# The original token had an associated error
# spanning more than one token; now we're creating
Expand Down