From e768f46af2ff35df5ce0c01bd1ebfa11ebc8a351 Mon Sep 17 00:00:00 2001 From: Lokendra Singh Date: Tue, 9 Mar 2021 23:49:46 +0530 Subject: [PATCH 1/4] update deformatter (apertium-destxt) escape chars --- apertium/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apertium/utils.py b/apertium/utils.py index 423e710..e513f7a 100644 --- a/apertium/utils.py +++ b/apertium/utils.py @@ -21,7 +21,7 @@ from apertium.iso639 import iso_639_codes iso639_codes_inverse = {v: k for k, v in iso_639_codes.items()} -escape_chars = b'[]{}?^$@\\' +escape_chars = b'[]{}?^$@\\/<>' special_chars_map = {i: '\\' + chr(i) for i in escape_chars} initialized_wrappers = {} # type: Dict[Union[List[str], Tuple[str, ...]], Union[FSTProc, LRX, Any]] From cf4c53cb014852695828463249a467a46e3ef849 Mon Sep 17 00:00:00 2001 From: Lokendra Singh Date: Wed, 10 Mar 2021 01:08:55 +0530 Subject: [PATCH 2/4] fix kaz-tat: install nightly builds --- setup.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/setup.py b/setup.py index a03bb84..b9d842c 100755 --- a/setup.py +++ b/setup.py @@ -17,18 +17,7 @@ def install_binaries() -> None: apertium.installer.install_apertium() apertium.installer.install_module('eng') apertium.installer.install_module('eng-spa') - - def kaz_tat_install(): - apertium.installer.nightly = False - ubuntu = apertium.installer.Debian() - if platform.system() == 'Linux': - ubuntu._install_package_source() - apertium.installer.install_module('kaz-tat') - apertium.installer.nightly = True - if platform.system() == 'Linux': - ubuntu._install_package_source() - kaz_tat_install() - + apertium.installer.install_module('kaz-tat') apertium.installer.install_wrapper('python3-apertium-core') apertium.installer.install_wrapper('python3-apertium-lex-tools') apertium.installer.install_wrapper('python3-cg3') From 6eb1eeb5bb62f658168474c75897f8fd289b545e Mon Sep 17 00:00:00 2001 From: Lokendra Singh Date: Wed, 10 Mar 2021 00:55:12 +0530 Subject: [PATCH 3/4] add: github workflow --- .github/workflows/build.yaml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..15f5145 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,39 @@ +name: apertium-python CI Build + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipenv + python3 setup.py install + pipenv install --dev --system + - name: Flake8 checks + run: | + flake8 --verbose apertium + - name: mypy checks + run: | + mypy apertium --strict --any-exprs-report .mypy_coverage --ignore-missing-imports + cat .mypy_coverage/any-exprs.txt + coverage=$(tail -1 .mypy_coverage/any-exprs.txt | grep -Eo '[0-9\.]+%' | sed 's/%$//') + if (( $(echo "$coverage < 95" | bc -l) )); then + exit 1 + fi + - name: code coverage and unittest + run: | + coverage run -m unittest --verbose --buffer tests + coverage report --show-missing --fail-under 90 --include 'apertium/*' From 2981a3cbb7fb96475c0a75cb1323f281b9a10eb3 Mon Sep 17 00:00:00 2001 From: Lokendra Singh Date: Wed, 10 Mar 2021 10:47:38 +0530 Subject: [PATCH 4/4] Revert "add: github workflow" This reverts commit 6eb1eeb5bb62f658168474c75897f8fd289b545e. --- .github/workflows/build.yaml | 39 ------------------------------------ 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 15f5145..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: apertium-python CI Build - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.6, 3.7, 3.8] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pipenv - python3 setup.py install - pipenv install --dev --system - - name: Flake8 checks - run: | - flake8 --verbose apertium - - name: mypy checks - run: | - mypy apertium --strict --any-exprs-report .mypy_coverage --ignore-missing-imports - cat .mypy_coverage/any-exprs.txt - coverage=$(tail -1 .mypy_coverage/any-exprs.txt | grep -Eo '[0-9\.]+%' | sed 's/%$//') - if (( $(echo "$coverage < 95" | bc -l) )); then - exit 1 - fi - - name: code coverage and unittest - run: | - coverage run -m unittest --verbose --buffer tests - coverage report --show-missing --fail-under 90 --include 'apertium/*'