From c26878af0bcbc5029cf8db8f35ac62c64e6ac15d Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Mon, 20 Nov 2023 11:57:44 +0100 Subject: [PATCH] Bump min Python version to 3.7. Because I do no longer have a 3.6 on my machine to test it. --- .github/FUNDING.yml | 1 - .github/workflows/tests.yml | 44 ------------------------------------- pospell.py | 5 +++-- pyproject.toml | 2 +- tox.ini | 4 ++-- 5 files changed, 6 insertions(+), 50 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index bb90c53..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: JulienPalard diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index a3a3157..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- - -name: Tests - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - test: - name: Run tox - runs-on: ubuntu-latest - strategy: - matrix: - tox: - - py_version: '3.6' - env: py36 - - py_version: '3.7' - env: py37 - - py_version: '3.8' - env: py38,flake8,mypy,black,pylint,pydocstyle,coverage - - py_version: '3.9' - env: py39 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.tox.py_version }} - - uses: actions/cache@v2 - with: - path: .tox - key: ${{ matrix.tox.python-version }}-${{ hashFiles('tox.ini') }} - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y hunspell - - name: Install tox - run: python3 -m pip install tox - - name: Run tox - run: tox -q -p all -e ${{ matrix.tox.env }} diff --git a/pospell.py b/pospell.py index 7d1f1dd..6ee064b 100644 --- a/pospell.py +++ b/pospell.py @@ -28,6 +28,7 @@ __version__ = "1.3" DEFAULT_DROP_CAPITALIZED = {"fr": True, "fr_FR": True} +Error = Tuple[str, int, str] input_line = collections.namedtuple("input_line", "filename line text") @@ -326,7 +327,7 @@ def look_like_a_word(word): return True -def run_hunspell(language, personal_dict, input_lines): +def run_hunspell(language, personal_dict, input_lines) -> List[Error]: """Run hunspell over the given input lines.""" personal_dict_arg = ["-p", personal_dict] if personal_dict else [] try: @@ -399,7 +400,7 @@ def spell_check( return len(errors) -def parse_hunspell_output(inputs, outputs) -> List[Tuple[str, int, str]]: +def parse_hunspell_output(inputs, outputs) -> List[Error]: """Parse `hunspell -a` output and collect all errors.""" # skip first line of hunspell output (it's the banner) outputs = iter(outputs[1:]) diff --git a/pyproject.toml b/pyproject.toml index 7bafa93..d618fec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Natural Language :: English", "Programming Language :: Python :: 3", ] -requires-python = ">= 3.6" +requires-python = ">= 3.7" dependencies = [ "polib", "docutils>=0.18", diff --git a/tox.ini b/tox.ini index 4e16da0..00c254d 100644 --- a/tox.ini +++ b/tox.ini @@ -23,7 +23,7 @@ exclude_lines = [tox] -envlist = py37, py38, py39, py310, py311, flake8, mypy, black, pylint, pydocstyle, coverage +envlist = py37, py38, py39, py310, py311, py312, flake8, mypy, black, pylint, pydocstyle, coverage isolated_build = True skip_missing_interpreters = True @@ -36,7 +36,7 @@ setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname} [testenv:coverage] -depends = py36, py37, py38, py39 +depends = py37, py38, py39, py310, py312 parallel_show_output = True deps = coverage skip_install = True