From e3f38e6f9e8513dec1001330d96eb2bf618cad6f Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 08:41:27 +0000 Subject: [PATCH 01/38] Python 3.9 --- .github/workflows/deploy-docs.yml | 6 +++--- .github/workflows/lint.yml | 2 +- .github/workflows/pypi-publish.yml | 4 ++-- .github/workflows/pypi-test.yml | 2 +- .github/workflows/unittest-macos.yml | 6 +++--- .github/workflows/unittest-windows.yml | 4 ++-- .github/workflows/unitttest-ubuntu.yml | 4 ++-- Dockerfile | 2 +- pyproject.toml | 2 +- tox.ini | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 8884a1b6c..d4229d3ad 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -10,13 +10,13 @@ on: jobs: release: name: Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: "3.9" - name: Install dependencies env: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e50bae84b..5214a7437 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ on: jobs: ruff: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index adaccf97e..f39d03446 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -7,10 +7,10 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.9"] steps: - name: Checkout diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 90d579dec..507442f80 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.8] + python-version: ["3.9"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 30a2047ca..56d1557a9 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [macos-latest, self-hosted] - python-version: [3.8] + python-version: ["3.9"] steps: - name: Checkout @@ -47,8 +47,8 @@ jobs: shell: bash -l {0} run: | source ~/miniconda3/etc/profile.d/conda.sh - conda create -y -n pythainlpwork38 python=3.8 - conda activate pythainlpwork38 + conda create -y -n pythainlpwork python=3.9 + conda activate pythainlpwork conda info conda list python -m pip install --upgrade pip diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 5f9a71ceb..23fa5eacb 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: [3.8] + python-version: ["3.9"] steps: - name: Checkout @@ -52,7 +52,7 @@ jobs: python -m pip --version python -m pip install pytest coverage coveralls conda install -y -c conda-forge fairseq - python -m pip install https://www.dropbox.com/s/o6p2sj5z50iim1e/PyICU-2.3.1-cp38-cp38-win_amd64.whl?dl=1 + python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" python -m pip install -r docker_requirements.txt python -m pip install .[full] python -m nltk.downloader omw-1.4 diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 3a94a4e62..cc3f6e563 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -15,10 +15,10 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: - python-version: [3.9] + python-version: ["3.9"] steps: - name: Checkout diff --git a/Dockerfile b/Dockerfile index dc8162af7..549848b45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project # SPDX-License-Identifier: Apache-2.0 -FROM python:3.8-slim-buster +FROM python:3.9-slim COPY . . diff --git a/pyproject.toml b/pyproject.toml index faa102a79..27e9c4d4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [tool.ruff] line-length = 79 indent-width = 4 -target-version = "py38" +target-version = "py39" [tool.ruff.format] quote-style = "double" diff --git a/tox.ini b/tox.ini index 010ec9dc1..8e8803df7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py{36,37,38,py3},flake8 +envlist=py{39,310,py3},flake8 skip_missing_interpreters = true [testenv] From 31ee9b2398d09825baa78b0753423f55e3fa896b Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:05:18 +0000 Subject: [PATCH 02/38] Remove backports.zoneinfo --- .github/workflows/unittest-macos.yml | 64 +++++++------------------- .github/workflows/unittest-windows.yml | 19 ++++---- .github/workflows/unitttest-ubuntu.yml | 20 ++++---- pythainlp/util/date.py | 2 +- setup.py | 2 - 5 files changed, 40 insertions(+), 67 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 56d1557a9..e3030689d 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, self-hosted] + os: [macos-latest] python-version: ["3.9"] steps: @@ -33,63 +33,32 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false auto-update-conda: true - if: matrix.os == 'macos-latest' -# - name: Install mac m1 -# run: | -# mkdir -p ~/miniconda3 -# wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-MacOSX-arm64.sh -# chmod +x Miniconda3-py38_4.12.0-MacOSX-arm64.sh -# bash Miniconda3-py38_4.12.0-MacOSX-arm64.sh -b -u -p ~/miniconda3 -# ~/miniconda3/bin/conda init bash -# ~/miniconda3/bin/conda init zsh -# if: matrix.os == 'self-hosted' - - name: Test PyThaiNLP - M1 - shell: bash -l {0} - run: | - source ~/miniconda3/etc/profile.d/conda.sh - conda create -y -n pythainlpwork python=3.9 - conda activate pythainlpwork - conda info - conda list - python -m pip install --upgrade pip - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt - conda install -y -c conda-forge protobuf - pip install pytest coverage coveralls typing_extensions==4.5.0 - pip install ssg epitran - pip install fastai==1.0.61 - pip install fairseq==0.10.2 - conda install -y -c conda-forge icu - conda install -y -c conda-forge pyicu - pip install deepcut tltk - pip install .[full] - python -m nltk.downloader omw-1.4 - python -m pip cache purge - python -m unittest discover - if: matrix.os == 'self-hosted' - name: Show environment - shell: bash -l {0} + shell: powershell run: | conda info conda list - if: matrix.os == 'self-hosted' + - name: Install build tools + run: | + python -m pip install --upgrade pip setuptools + python -m pip install coverage coveralls pytest + conda install -c conda-forge icu + conda install -c conda-forge pyicu - name: Install PyTorch shell: bash -l {0} run: | - pip install torch==1.10.0 - if: matrix.os != 'self-hosted' + python -m pip install torch==1.10.0 - name: Install dependencies + shell: bash -l {0} + env: + SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True + run: | + python -m pip install -r docker_requirements.txt + - name: Install PyThaiNLP shell: bash -l {0} run: | - python -m pip install --upgrade pip - pip install pytest coverage coveralls - conda install -c conda-forge icu - conda install -c conda-forge pyicu - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt - pip install deepcut tltk - pip install .[full] + python -m pip install .[full] python -m nltk.downloader omw-1.4 - python -m pip cache purge - if: matrix.os != 'self-hosted' - name: Test shell: bash -l {0} env: @@ -98,4 +67,3 @@ jobs: run: | coverage run -m unittest discover coveralls - if: matrix.os != 'self-hosted' diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 23fa5eacb..2475d59b5 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -38,25 +38,28 @@ jobs: run: | conda info conda list + - name: Install build tools + shell: powershell + run: | + python -m pip install --disable-pip-version-check --user --upgrade pip setuptools + python -m pip install coverage coveralls pytest + python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" - name: Install PyTorch shell: powershell run: | - pip install torch==1.8.1 + python -m pip install torch==1.8.1 - name: Install dependencies shell: powershell env: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True run: | - python -m pip install --disable-pip-version-check --user --upgrade pip setuptools - python -m pip install backports.zoneinfo[tzdata] - python -m pip --version - python -m pip install pytest coverage coveralls - conda install -y -c conda-forge fairseq - python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" + conda install -y -c conda-forge fairseq || exit 1 python -m pip install -r docker_requirements.txt + - name: Install PyThaiNLP + shell: powershell + run: | python -m pip install .[full] python -m nltk.downloader omw-1.4 - python -m pip install spacy deepcut tltk - name: Test shell: powershell env: diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index cc3f6e563..95fa5479c 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -27,17 +27,21 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install build tools + run: | + python -m pip install --upgrade pip setuptools + python -m pip install coverage coveralls pytest - name: Install dependencies + env: + SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True + run: | + python -m pip install --upgrade pip setuptools + python -m pip install pytest coverage coveralls + python -m pip install -r docker_requirements.txt + - name: Install PyThaiNLP run: | - python -m pip install --upgrade pip - python -m pip install backports.zoneinfo[tzdata] - pip install pytest coverage coveralls - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt - pip install deepcut tltk - pip install .[full] + python -m pip install .[full] python -m nltk.downloader omw-1.4 - python -m pip install spacy deepcut tltk - python -m pip cache purge - name: Test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pythainlp/util/date.py b/pythainlp/util/date.py index d2e03a11a..0201c4c8c 100644 --- a/pythainlp/util/date.py +++ b/pythainlp/util/date.py @@ -236,7 +236,7 @@ def thai_strptime( # 9, # 0, # 1, - # tzinfo=backports.zoneinfo.ZoneInfo(key='Asia/Bangkok') + # tzinfo=zoneinfo.ZoneInfo(key='Asia/Bangkok') # ) """ d = "" diff --git a/setup.py b/setup.py index 72897d889..54d697459 100644 --- a/setup.py +++ b/setup.py @@ -38,8 +38,6 @@ requirements = [ "requests>=2.22.0", - "backports.zoneinfo; python_version<'3.9'", - "tzdata; sys_platform == 'win32'" ] extras = { From ccc4bd643b88f84281781249eb6edefccf294985 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:06:21 +0000 Subject: [PATCH 03/38] Remove duplicated pip --- .github/workflows/unitttest-ubuntu.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 95fa5479c..2ebde6a70 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -35,8 +35,6 @@ jobs: env: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True run: | - python -m pip install --upgrade pip setuptools - python -m pip install pytest coverage coveralls python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | From b355bb664624f64c6ec36de5d8bb5c7b5d04169f Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:17:09 +0000 Subject: [PATCH 04/38] Remove PyTorch (already in requirements.txt) --- .github/workflows/unittest-macos.yml | 6 +----- .github/workflows/unittest-windows.yml | 5 ----- docker_requirements.txt | 14 +++++++------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index e3030689d..2dda515bc 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -43,11 +43,7 @@ jobs: python -m pip install --upgrade pip setuptools python -m pip install coverage coveralls pytest conda install -c conda-forge icu - conda install -c conda-forge pyicu - - name: Install PyTorch - shell: bash -l {0} - run: | - python -m pip install torch==1.10.0 + conda install -c conda-forge pyicu - name: Install dependencies shell: bash -l {0} env: diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 2475d59b5..a8003dca3 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -44,16 +44,11 @@ jobs: python -m pip install --disable-pip-version-check --user --upgrade pip setuptools python -m pip install coverage coveralls pytest python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" - - name: Install PyTorch - shell: powershell - run: | - python -m pip install torch==1.8.1 - name: Install dependencies shell: powershell env: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True run: | - conda install -y -c conda-forge fairseq || exit 1 python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP shell: powershell diff --git a/docker_requirements.txt b/docker_requirements.txt index b07d4b0ed..ddd815446 100644 --- a/docker_requirements.txt +++ b/docker_requirements.txt @@ -8,20 +8,20 @@ esupar==1.3.9 fairseq==0.10.2 fastai==1.0.61 fastcoref==2.1.6 -gensim==4.3.2 +gensim==4.3.3 h5py==3.1.0 khanaa==0.0.6 nlpo3==1.3.0 nltk==3.6.6 -numpy==1.22.* +numpy==1.22.3 OSKut==1.3 -pandas==1.4.* +pandas==1.4.4 panphon==0.20.0 phunspell==0.1.6 protobuf==3.20.3 -pyicu==2.8 +pyicu==2.14 python-crfsuite==0.9.11 -requests==2.31.* +requests==2.32.3 sacremoses==0.0.41 sefr_cut==1.1 sentence-transformers==2.2.2 @@ -34,8 +34,8 @@ symspellpy==6.7.7 tensorflow==2.13.1 thai-nner==0.3 tltk==1.6.8 -torch==1.13.1 -transformers==4.38.0 +torch==1.13.2 +transformers==4.38.2 ufal.chu-liu-edmonds==1.0.2 wtpsplit==1.0.1 wunsen==0.0.3 From 67dba6700df30949af151f9f83976bb24914b0ed Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:19:26 +0000 Subject: [PATCH 05/38] Update docker_requirements.txt --- docker_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_requirements.txt b/docker_requirements.txt index ddd815446..5143d6bfc 100644 --- a/docker_requirements.txt +++ b/docker_requirements.txt @@ -5,7 +5,7 @@ deepcut==0.7.0.0 emoji==0.5.4 epitran==1.9 esupar==1.3.9 -fairseq==0.10.2 +fairseq==0.12.2 fastai==1.0.61 fastcoref==2.1.6 gensim==4.3.3 From 4269923ad9d49fbef61037ffcd94b93d3adb1370 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:30:44 +0000 Subject: [PATCH 06/38] Make consistent yaml across OSes --- .github/workflows/unittest-macos.yml | 20 ++++++-------------- .github/workflows/unittest-windows.yml | 6 +++--- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 2dda515bc..d3b71b3d3 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -4,8 +4,8 @@ on: push: paths-ignore: - '**.md' + - '**.yml' - 'docs/**' -# - '**.yml' pull_request: branches: - dev @@ -16,34 +16,26 @@ on: jobs: build: - - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [macos-latest] + os: ["macos-latest"] python-version: ["3.9"] + runs-on: ${{ matrix.os }} + steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - auto-activate-base: false - auto-update-conda: true - - name: Show environment - shell: powershell - run: | - conda info - conda list - name: Install build tools + shell: bash -l {0} run: | python -m pip install --upgrade pip setuptools python -m pip install coverage coveralls pytest - conda install -c conda-forge icu - conda install -c conda-forge pyicu - name: Install dependencies shell: bash -l {0} env: diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index a8003dca3..6c8d322df 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -16,14 +16,14 @@ on: jobs: build: - - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [windows-latest] + os: ["windows-latest"] python-version: ["3.9"] + runs-on: ${{ matrix.os }} + steps: - name: Checkout uses: actions/checkout@v4 From 7f88dc3a9ab418609ea86158bb438d4dee2b1fd7 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:36:56 +0000 Subject: [PATCH 07/38] Don't use docker_requirements.txt --- .github/workflows/pypi-publish.yml | 1 + .github/workflows/unittest-macos.yml | 12 ++++++------ .github/workflows/unittest-windows.yml | 12 ++++++------ .github/workflows/unitttest-ubuntu.yml | 18 +++++++++++------- docker_requirements.txt | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index f39d03446..d7b47e216 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -24,6 +24,7 @@ jobs: python -m pip install --upgrade pip python -m pip install setuptools twine wheel python setup.py sdist bdist_wheel + # "python setup.py" is no longer recommended. - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index d3b71b3d3..a291b0674 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -36,12 +36,12 @@ jobs: run: | python -m pip install --upgrade pip setuptools python -m pip install coverage coveralls pytest - - name: Install dependencies - shell: bash -l {0} - env: - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True - run: | - python -m pip install -r docker_requirements.txt + # - name: Install dependencies + # shell: bash -l {0} + # env: + # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True + # run: | + # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP shell: bash -l {0} run: | diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 6c8d322df..b019325f3 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -44,12 +44,12 @@ jobs: python -m pip install --disable-pip-version-check --user --upgrade pip setuptools python -m pip install coverage coveralls pytest python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" - - name: Install dependencies - shell: powershell - env: - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True - run: | - python -m pip install -r docker_requirements.txt + # - name: Install dependencies + # shell: powershell + # env: + # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True + # run: | + # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP shell: powershell run: | diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 2ebde6a70..a67b90594 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -7,6 +7,8 @@ on: - '**.yml' - 'docs/**' pull_request: + branches: + - dev paths-ignore: - '**.md' - '**.yml' @@ -14,12 +16,14 @@ on: jobs: build: - - runs-on: ubuntu-24.04 strategy: + fail-fast: false matrix: + os: ["ubuntu-24.04"] python-version: ["3.9"] + runs-on: ${{ matrix.os }} + steps: - name: Checkout uses: actions/checkout@v4 @@ -31,11 +35,11 @@ jobs: run: | python -m pip install --upgrade pip setuptools python -m pip install coverage coveralls pytest - - name: Install dependencies - env: - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True - run: | - python -m pip install -r docker_requirements.txt + # - name: Install dependencies + # env: + # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True + # run: | + # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | python -m pip install .[full] diff --git a/docker_requirements.txt b/docker_requirements.txt index 5143d6bfc..f7d0bb285 100644 --- a/docker_requirements.txt +++ b/docker_requirements.txt @@ -1,4 +1,4 @@ -PyYAML==5.4.1 +PyYAML==6.0.2 attacut==1.0.6 bpemb==0.3.4 deepcut==0.7.0.0 From 3b905994475031dc51b679bd6281df42fe2ccac2 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 10:41:42 +0000 Subject: [PATCH 08/38] Install ICU --- .github/workflows/unittest-macos.yml | 9 +++++++++ .github/workflows/unittest-windows.yml | 3 +++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index a291b0674..2d7ea4e0a 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -36,6 +36,15 @@ jobs: run: | python -m pip install --upgrade pip setuptools python -m pip install coverage coveralls pytest + - name: Install ICU + shell: bash -l {0} + run: | + brew install icu4c + PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig + echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> "${GITHUB_ENV}" + ICU_VER=$(pkg-config --modversion icu-i18n) + echo "ICU_VER=${ICU_VER}" + echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}" # - name: Install dependencies # shell: bash -l {0} # env: diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index b019325f3..36d52b928 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -43,6 +43,9 @@ jobs: run: | python -m pip install --disable-pip-version-check --user --upgrade pip setuptools python -m pip install coverage coveralls pytest + - name: Install ICU + shell: powershell + run: | python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" # - name: Install dependencies # shell: powershell From e88fdb6083aaaf859ea4bf81cfbc74302e45f930 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 13:36:43 +0000 Subject: [PATCH 09/38] Use torch>=2 --- docker_requirements.txt | 2 +- setup.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker_requirements.txt b/docker_requirements.txt index f7d0bb285..e2ef1d4df 100644 --- a/docker_requirements.txt +++ b/docker_requirements.txt @@ -34,7 +34,7 @@ symspellpy==6.7.7 tensorflow==2.13.1 thai-nner==0.3 tltk==1.6.8 -torch==1.13.2 +torch==2.5.1 transformers==4.38.2 ufal.chu-liu-edmonds==1.0.2 wtpsplit==1.0.1 diff --git a/setup.py b/setup.py index 54d697459..78c4d4c48 100644 --- a/setup.py +++ b/setup.py @@ -45,15 +45,15 @@ "benchmarks": ["PyYAML>=5.3.1", "numpy>=1.22", "pandas>=0.24"], "icu": ["pyicu>=2.3"], "ipa": ["epitran>=1.1"], - "ml": ["numpy>=1.22", "torch>=1.0.0"], + "ml": ["numpy>=1.22", "torch>=2.0.0"], "ssg": ["ssg>=0.0.8"], "thai2fit": ["emoji>=0.5.1", "gensim>=4.0.0", "numpy>=1.22"], - "thai2rom": ["numpy>=1.22", "torch>=1.0.0"], + "thai2rom": ["numpy>=1.22", "torch>=2.0.0"], "translate": [ "fairseq>=0.10.0", "sacremoses>=0.0.41", "sentencepiece>=0.1.91", - "torch>=1.0.0", + "torch>=2.0.0", "transformers>=4.6.0", ], "wunsen": ["wunsen>=0.0.1"], @@ -133,7 +133,7 @@ "sacremoses>=0.0.41", "sentencepiece>=0.1.91", "ssg>=0.0.8", - "torch>=1.0.0", + "torch>=2.0.0", "fastai<2.0", "bpemb>=0.3.2", "transformers>=4.22.1", From b3cf9f1b5cd9e497c1f3f04f7dd8db3429b17664 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 13:42:12 +0000 Subject: [PATCH 10/38] Use "pip<24.1" --- .github/workflows/unittest-macos.yml | 2 +- .github/workflows/unittest-windows.yml | 2 +- .github/workflows/unitttest-ubuntu.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 2d7ea4e0a..d4298a9b8 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -34,7 +34,7 @@ jobs: - name: Install build tools shell: bash -l {0} run: | - python -m pip install --upgrade pip setuptools + python -m pip install --upgrade "pip<24.1" setuptools python -m pip install coverage coveralls pytest - name: Install ICU shell: bash -l {0} diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 36d52b928..52d78b6b6 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -41,7 +41,7 @@ jobs: - name: Install build tools shell: powershell run: | - python -m pip install --disable-pip-version-check --user --upgrade pip setuptools + python -m pip install --disable-pip-version-check --user --upgrade "pip<24.1" setuptools python -m pip install coverage coveralls pytest - name: Install ICU shell: powershell diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index a67b90594..c8f1ae878 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -33,7 +33,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install build tools run: | - python -m pip install --upgrade pip setuptools + python -m pip install --upgrade "pip<24.1" setuptools python -m pip install coverage coveralls pytest # - name: Install dependencies # env: From dbf2082dce62f58c2dc98444ce5bcb73816d62bc Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 13:54:53 +0000 Subject: [PATCH 11/38] Use light-the-torch for torch installation --- .github/workflows/unittest-macos.yml | 5 +++++ .github/workflows/unittest-windows.yml | 5 +++++ .github/workflows/unitttest-ubuntu.yml | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index d4298a9b8..d7c78abe0 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -45,6 +45,11 @@ jobs: ICU_VER=$(pkg-config --modversion icu-i18n) echo "ICU_VER=${ICU_VER}" echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}" + - name: Install PyTorch + shell: bash -l {0} + run: | + python -m pip install light-the-torch + ltt install torch # - name: Install dependencies # shell: bash -l {0} # env: diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 52d78b6b6..c0f5cc6a4 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -47,6 +47,11 @@ jobs: shell: powershell run: | python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" + - name: Install PyTorch + shell: powershell + run: | + python -m pip install light-the-torch + ltt install torch # - name: Install dependencies # shell: powershell # env: diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index c8f1ae878..9faaf3f60 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -35,6 +35,10 @@ jobs: run: | python -m pip install --upgrade "pip<24.1" setuptools python -m pip install coverage coveralls pytest + - name: Install PyTorch + run: | + python -m pip install light-the-torch + ltt install torch # - name: Install dependencies # env: # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True From f9bcd0bb9a4568a639855a6efafde998076592bc Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 13:59:19 +0000 Subject: [PATCH 12/38] torch --cpuonly --- .github/workflows/unittest-macos.yml | 2 +- .github/workflows/unittest-windows.yml | 2 +- .github/workflows/unitttest-ubuntu.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index d7c78abe0..ff92e5a42 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -48,7 +48,7 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install light-the-torch + python -m pip install --cpuonly light-the-torch ltt install torch # - name: Install dependencies # shell: bash -l {0} diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index c0f5cc6a4..e2c72e332 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -50,7 +50,7 @@ jobs: - name: Install PyTorch shell: powershell run: | - python -m pip install light-the-torch + python -m pip install --cpuonly light-the-torch ltt install torch # - name: Install dependencies # shell: powershell diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 9faaf3f60..e6d7e4e74 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -37,7 +37,7 @@ jobs: python -m pip install coverage coveralls pytest - name: Install PyTorch run: | - python -m pip install light-the-torch + python -m pip install --cpuonly light-the-torch ltt install torch # - name: Install dependencies # env: From abbca931032a408a35451be12fe77c65f498d64b Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 14:02:46 +0000 Subject: [PATCH 13/38] --cpuonly --- .github/workflows/unittest-macos.yml | 4 ++-- .github/workflows/unittest-windows.yml | 4 ++-- .github/workflows/unitttest-ubuntu.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index ff92e5a42..1711e9a1e 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -48,8 +48,8 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install --cpuonly light-the-torch - ltt install torch + python -m pip install light-the-torch + ltt install --cpuonly torch # - name: Install dependencies # shell: bash -l {0} # env: diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index e2c72e332..b6a27f8e8 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -50,8 +50,8 @@ jobs: - name: Install PyTorch shell: powershell run: | - python -m pip install --cpuonly light-the-torch - ltt install torch + python -m pip install light-the-torch + ltt install --cpuonly torch # - name: Install dependencies # shell: powershell # env: diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index e6d7e4e74..7eec11896 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -37,8 +37,8 @@ jobs: python -m pip install coverage coveralls pytest - name: Install PyTorch run: | - python -m pip install --cpuonly light-the-torch - ltt install torch + python -m pip install light-the-torch + ltt install --cpuonly torch # - name: Install dependencies # env: # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True From e45dc38bc178cf20263c42b52124eb1bdf6dc8a5 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 15:07:08 +0000 Subject: [PATCH 14/38] Use wheels from http://download.pytorch.org/whl/torch/ --- .github/workflows/unittest-macos.yml | 4 ++-- .github/workflows/unittest-windows.yml | 4 ++-- .github/workflows/unitttest-ubuntu.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 1711e9a1e..5c0897c25 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -48,8 +48,8 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install light-the-torch - ltt install --cpuonly torch + python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl + # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: bash -l {0} # env: diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index b6a27f8e8..fe2b3aa0c 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -50,8 +50,8 @@ jobs: - name: Install PyTorch shell: powershell run: | - python -m pip install light-the-torch - ltt install --cpuonly torch + python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-win_amd64.whl + # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: powershell # env: diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 7eec11896..dffe26182 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -37,8 +37,8 @@ jobs: python -m pip install coverage coveralls pytest - name: Install PyTorch run: | - python -m pip install light-the-torch - ltt install --cpuonly torch + python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-linux_x86_64.whl + # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # env: # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True From aa5ec74a23c6e1a23c3b608d0e3cb0db87a94670 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 15:27:50 +0000 Subject: [PATCH 15/38] Use macos-11 --- .github/workflows/unittest-macos.yml | 2 +- .github/workflows/unittest-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 5c0897c25..01f95731e 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-latest"] + os: ["macos-11"] python-version: ["3.9"] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index fe2b3aa0c..f357b9517 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -46,7 +46,7 @@ jobs: - name: Install ICU shell: powershell run: | - python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.13/PyICU-2.13-cp39-cp39-win_amd64.whl" + python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.14/PyICU-2.14-cp39-cp39-win_amd64.whl" - name: Install PyTorch shell: powershell run: | From 87b05f78b59d27c53bb670c80dd1970378a8d6e2 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 18:07:51 +0000 Subject: [PATCH 16/38] try macos-latest --- .github/workflows/unittest-macos.yml | 2 +- .python-version | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .python-version diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 01f95731e..5c0897c25 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-11"] + os: ["macos-latest"] python-version: ["3.9"] runs-on: ${{ matrix.os }} diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..bd28b9c5c --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.9 From 7cdb3ab0875e7593d25122debecac478ec9c30a7 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 18:10:36 +0000 Subject: [PATCH 17/38] Update unittest-macos.yml --- .github/workflows/unittest-macos.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 5c0897c25..3b1161316 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -48,7 +48,8 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl + python -m pip install torch +# python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: bash -l {0} From cfd1f6068612054b1f9692613dc09f4c03550ffd Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 18:17:33 +0000 Subject: [PATCH 18/38] Update unittest-macos.yml --- .github/workflows/unittest-macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 3b1161316..5c0897c25 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -48,8 +48,7 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install torch -# python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl + python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: bash -l {0} From 3be97c1b583cbed6e7f10759bc2759e2fcb99de0 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 18:53:01 +0000 Subject: [PATCH 19/38] Try torch 2.2.2 on macOS --- .github/workflows/unittest-macos.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 5c0897c25..b82dde5ee 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -48,7 +48,8 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl + python -m pip install http://download.pytorch.org/whl/cpu/torch-2.2.2-cp39-none-macosx_11_0_arm64.whl +# python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: bash -l {0} From cf101010014e98c83a74860e285efb10937e285b Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 18:54:13 +0000 Subject: [PATCH 20/38] Try macOS 12 --- .github/workflows/unittest-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index b82dde5ee..45a3354d3 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-latest"] + os: ["macos-12"] python-version: ["3.9"] runs-on: ${{ matrix.os }} From c2f1dc30a8c4b13577e83b405e627de951a21c94 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 18:56:06 +0000 Subject: [PATCH 21/38] Update unittest-macos.yml --- .github/workflows/unittest-macos.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 45a3354d3..5c0897c25 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-12"] + os: ["macos-latest"] python-version: ["3.9"] runs-on: ${{ matrix.os }} @@ -48,8 +48,7 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install http://download.pytorch.org/whl/cpu/torch-2.2.2-cp39-none-macosx_11_0_arm64.whl -# python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl + python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: bash -l {0} From 0542c87e00ff9a77a1b0a86ba14c2e9358a61f98 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 20:15:26 +0000 Subject: [PATCH 22/38] try macos-15 --- .github/workflows/unittest-macos.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 5c0897c25..969151695 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-latest"] + os: ["macos-15"] python-version: ["3.9"] runs-on: ${{ matrix.os }} @@ -48,7 +48,8 @@ jobs: - name: Install PyTorch shell: bash -l {0} run: | - python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl + pip install torch + # python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: bash -l {0} From bcf905ae24cae877cf87fc7b2af302744f56552d Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 20:38:08 +0000 Subject: [PATCH 23/38] Update unittest-macos.yml --- .github/workflows/unittest-macos.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 969151695..131e5953b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-15"] + os: ["macos-15"] # other versions failed PyTorch installation python-version: ["3.9"] runs-on: ${{ matrix.os }} @@ -31,6 +31,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Print system info + run: sw_vers; python --version; arch - name: Install build tools shell: bash -l {0} run: | From 43080375209f60643c4aea057e62b181612c102b Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 20:42:12 +0000 Subject: [PATCH 24/38] Update unittest-macos.yml --- .github/workflows/unittest-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 131e5953b..0b2919945 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-15"] # other versions failed PyTorch installation + os: ["macos-14"] # other versions failed PyTorch installation python-version: ["3.9"] runs-on: ${{ matrix.os }} From 6bd0c54f29f6ba95585cc5aeacc159f4c7f8f1d2 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 20:50:26 +0000 Subject: [PATCH 25/38] Update unittest-macos.yml --- .github/workflows/unittest-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 0b2919945..131e5953b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-14"] # other versions failed PyTorch installation + os: ["macos-15"] # other versions failed PyTorch installation python-version: ["3.9"] runs-on: ${{ matrix.os }} From 85c5fdec6afac88083249c60faa0861ba4800537 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 30 Oct 2024 21:13:06 +0000 Subject: [PATCH 26/38] pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] --- .github/workflows/deploy-docs.yml | 7 +++---- .github/workflows/pypi-publish.yml | 3 +-- .github/workflows/pypi-test.yml | 5 ++--- .github/workflows/unittest-macos.yml | 2 +- .github/workflows/unittest-windows.yml | 2 +- .github/workflows/unitttest-ubuntu.yml | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index d4229d3ad..aae3a7886 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -22,11 +22,10 @@ jobs: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True run: | python -m pip install --upgrade pip - pip install pytest coverage coveralls + python -m pip install coverage coveralls pytest if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi - pip install deepcut - pip install .[full] - pip install boto smart_open sphinx sphinx-rtd-theme + python -m pip install .[full] + python -m pip install boto smart_open sphinx sphinx-rtd-theme python -m nltk.downloader omw-1.4 - name: Build sphinx documentation run: | diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index d7b47e216..0e202074a 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -21,8 +21,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install setuptools twine wheel + python -m pip install --upgrade "pip<24.1" setuptools twine wheel python setup.py sdist bdist_wheel # "python setup.py" is no longer recommended. - name: Publish a Python distribution to PyPI diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 507442f80..8fb832392 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -22,9 +22,8 @@ jobs: env: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True run: | - python -m pip install --upgrade pip - python -m pip install deepcut tltk - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True python -m pip install -r https://raw.githubusercontent.com/PyThaiNLP/pythainlp/dev/docker_requirements.txt + python -m pip install --upgrade "pip<24.1" setuptools + python -m pip install -r https://raw.githubusercontent.com/PyThaiNLP/pythainlp/dev/docker_requirements.txt python -m pip install pythainlp[full] python -m nltk.downloader omw-1.4 - name: Test diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 131e5953b..99ef62740 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -62,7 +62,7 @@ jobs: - name: Install PyThaiNLP shell: bash -l {0} run: | - python -m pip install .[full] + python -m pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] python -m nltk.downloader omw-1.4 - name: Test shell: bash -l {0} diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index f357b9517..196b78e9e 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -61,7 +61,7 @@ jobs: - name: Install PyThaiNLP shell: powershell run: | - python -m pip install .[full] + python -m pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] python -m nltk.downloader omw-1.4 - name: Test shell: powershell diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index dffe26182..df0a7c9ec 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -46,7 +46,7 @@ jobs: # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | - python -m pip install .[full] + python -m pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] python -m nltk.downloader omw-1.4 - name: Test env: From 7123515782e37a1110768f0dba5dd9d4971e85d6 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:07:07 +0000 Subject: [PATCH 27/38] Try install just default features --- .github/workflows/unittest-macos.yml | 2 +- .github/workflows/unittest-windows.yml | 6 +++--- .github/workflows/unitttest-ubuntu.yml | 5 +++-- tests/test_ancient.py | 1 + tests/test_augment.py | 9 +++++---- tests/test_benchmarks.py | 1 + tests/test_classify.py | 1 + tests/test_coref.py | 1 + tests/test_el.py | 1 + tests/test_generate.py | 2 +- tests/test_khavee.py | 1 + tests/test_misspell.py | 2 ++ tests/test_morpheme.py | 3 ++- tests/test_parse.py | 1 + tests/test_soundex.py | 2 +- tests/test_summarize.py | 2 +- tests/test_translate.py | 3 ++- tests/test_transliterate.py | 5 +++-- tests/test_ulmfit.py | 10 ++++------ tests/test_util.py | 14 +++++++------- tests/test_wsd.py | 1 + 21 files changed, 43 insertions(+), 30 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 99ef62740..c35cc2812 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -62,7 +62,7 @@ jobs: - name: Install PyThaiNLP shell: bash -l {0} run: | - python -m pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] + python -m pip install . python -m nltk.downloader omw-1.4 - name: Test shell: bash -l {0} diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 196b78e9e..5d532a4f1 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -49,8 +49,8 @@ jobs: python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.14/PyICU-2.14-cp39-cp39-win_amd64.whl" - name: Install PyTorch shell: powershell - run: | - python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-win_amd64.whl + run: python -m pip install torch + # python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-win_amd64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: powershell @@ -61,7 +61,7 @@ jobs: - name: Install PyThaiNLP shell: powershell run: | - python -m pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] + python -m pip install . python -m nltk.downloader omw-1.4 - name: Test shell: powershell diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index df0a7c9ec..881a192ba 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -37,7 +37,8 @@ jobs: python -m pip install coverage coveralls pytest - name: Install PyTorch run: | - python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-linux_x86_64.whl + python -m pip install torch + # python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-linux_x86_64.whl # get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # env: @@ -46,7 +47,7 @@ jobs: # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | - python -m pip install .[icu,isa,thai2fit,translate,textaugment,wordnet,generate,nlpo3,thai_nner,wsd] + python -m pip install . python -m nltk.downloader omw-1.4 - name: Test env: diff --git a/tests/test_ancient.py b/tests/test_ancient.py index 349a7d3e5..ac3ef2da0 100644 --- a/tests/test_ancient.py +++ b/tests/test_ancient.py @@ -2,6 +2,7 @@ # SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.ancient import aksonhan_to_current diff --git a/tests/test_augment.py b/tests/test_augment.py index 5b2d81380..8b97ed2e0 100644 --- a/tests/test_augment.py +++ b/tests/test_augment.py @@ -3,15 +3,16 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + import nltk + from pythainlp.augment import WordNetAug -from pythainlp.augment.wordnet import postype2wordnet + # from pythainlp.augment.lm import Thai2transformersAug # from pythainlp.augment.lm.phayathaibert import ThaiTextAugmenter +from pythainlp.augment.word2vec import LTW2VAug from pythainlp.augment.word2vec.bpemb_wv import BPEmbAug -from pythainlp.augment.word2vec import ( - LTW2VAug -) +from pythainlp.augment.wordnet import postype2wordnet class TestTextaugmentPackage(unittest.TestCase): diff --git a/tests/test_benchmarks.py b/tests/test_benchmarks.py index c14a1a94d..45e79617e 100644 --- a/tests/test_benchmarks.py +++ b/tests/test_benchmarks.py @@ -6,6 +6,7 @@ import numpy as np import yaml + from pythainlp.benchmarks import word_tokenization with open("./tests/data/sentences.yml", "r", encoding="utf8") as stream: diff --git a/tests/test_classify.py b/tests/test_classify.py index e993a9a9a..723aad4dd 100644 --- a/tests/test_classify.py +++ b/tests/test_classify.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.classify import GzipModel diff --git a/tests/test_coref.py b/tests/test_coref.py index 2aaf2a8ff..a2e0d301f 100644 --- a/tests/test_coref.py +++ b/tests/test_coref.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.coref import coreference_resolution diff --git a/tests/test_el.py b/tests/test_el.py index 9266ca639..007442f1c 100644 --- a/tests/test_el.py +++ b/tests/test_el.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.el import EntityLinker diff --git a/tests/test_generate.py b/tests/test_generate.py index 6114300fe..6e1db1389 100644 --- a/tests/test_generate.py +++ b/tests/test_generate.py @@ -4,7 +4,7 @@ import unittest -from pythainlp.generate import Unigram, Bigram, Trigram +from pythainlp.generate import Bigram, Trigram, Unigram from pythainlp.generate.thai2fit import gen_sentence diff --git a/tests/test_khavee.py b/tests/test_khavee.py index 69792e015..6b43e4da9 100644 --- a/tests/test_khavee.py +++ b/tests/test_khavee.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.khavee import KhaveeVerifier kv = KhaveeVerifier() diff --git a/tests/test_misspell.py b/tests/test_misspell.py index cc479abd2..51b2bac44 100644 --- a/tests/test_misspell.py +++ b/tests/test_misspell.py @@ -3,7 +3,9 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + import numpy as np + from pythainlp.tools.misspell import misspell diff --git a/tests/test_morpheme.py b/tests/test_morpheme.py index 7a2f054eb..35cdb4bc3 100644 --- a/tests/test_morpheme.py +++ b/tests/test_morpheme.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import unittest -from pythainlp.morpheme import nighit, is_native_thai + +from pythainlp.morpheme import is_native_thai, nighit class TestMorphemePackage(unittest.TestCase): diff --git a/tests/test_parse.py b/tests/test_parse.py index 265bcfc32..b5ed5b85a 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.parse import dependency_parsing diff --git a/tests/test_soundex.py b/tests/test_soundex.py index 35bd718be..cbd8cbe53 100644 --- a/tests/test_soundex.py +++ b/tests/test_soundex.py @@ -11,7 +11,7 @@ soundex, udom83, ) -from pythainlp.soundex.sound import word_approximation, audio_vector +from pythainlp.soundex.sound import audio_vector, word_approximation class TestSoundexPackage(unittest.TestCase): diff --git a/tests/test_summarize.py b/tests/test_summarize.py index faaafc082..114a19d3f 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -4,7 +4,7 @@ import unittest -from pythainlp.summarize import summarize, extract_keywords +from pythainlp.summarize import extract_keywords, summarize class TestSummarizePackage(unittest.TestCase): diff --git a/tests/test_translate.py b/tests/test_translate.py index d7f94f1cf..e6809a3da 100644 --- a/tests/test_translate.py +++ b/tests/test_translate.py @@ -6,9 +6,10 @@ from pythainlp.translate.en_th import ( EnThTranslator, ThEnTranslator, - download_model_all + download_model_all, ) + class TestTranslatePackage(unittest.TestCase): def test_translate(self): # remove("scb_1m_th-en_spm") diff --git a/tests/test_transliterate.py b/tests/test_transliterate.py index 478716503..77c4c5eda 100644 --- a/tests/test_transliterate.py +++ b/tests/test_transliterate.py @@ -3,12 +3,13 @@ import unittest import torch -from pythainlp.transliterate import romanize, transliterate, pronunciate, puan + +from pythainlp.corpus import remove +from pythainlp.transliterate import pronunciate, puan, romanize, transliterate from pythainlp.transliterate.ipa import trans_list, xsampa_list from pythainlp.transliterate.thai2rom import ThaiTransliterator from pythainlp.transliterate.thai2rom_onnx import ThaiTransliterator_ONNX from pythainlp.transliterate.wunsen import WunsenTransliterate -from pythainlp.corpus import remove _BASIC_TESTS = { None: "", diff --git a/tests/test_ulmfit.py b/tests/test_ulmfit.py index c504731da..81db7ba30 100644 --- a/tests/test_ulmfit.py +++ b/tests/test_ulmfit.py @@ -3,13 +3,14 @@ import pickle import unittest -import pandas as pd -import torch - # fastai import fastai +import pandas as pd +import torch from fastai.text import * + from pythainlp.tokenize import THAI2FIT_TOKENIZER +from pythainlp.ulmfit import * from pythainlp.ulmfit import ( THWIKI_LSTM, ThaiTokenizer, @@ -38,9 +39,6 @@ ) from pythainlp.ulmfit.tokenizer import BaseTokenizer as base_tokenizer -# pythainlp -from pythainlp.ulmfit import * - class TestUlmfitPackage(unittest.TestCase): def test_ThaiTokenizer(self): diff --git a/tests/test_util.py b/tests/test_util.py index ce29784e5..2559f7069 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -22,8 +22,8 @@ count_thai_chars, countthai, dict_trie, - display_thai_char, digit_to_text, + display_thai_char, emoji_to_thai, eng_to_thai, find_keyword, @@ -31,11 +31,11 @@ is_native_thai, isthai, isthaichar, + maiyamok, + nectec_to_ipa, normalize, now_reign_year, num_to_thaiword, - maiyamok, - nectec_to_ipa, rank, reign_year_to_ad, remove_dangling, @@ -45,14 +45,17 @@ remove_trailing_repeat_consonants, remove_zw, rhyme, + sound_syllable, + syllable_length, + syllable_open_close_detector, text_to_arabic_digit, text_to_num, text_to_thai_digit, thai_digit_to_arabic_digit, thai_keyboard_dist, - thai_to_eng, thai_strftime, thai_strptime, + thai_to_eng, thai_word_tone_detector, thaiword_to_date, thaiword_to_num, @@ -61,9 +64,6 @@ tis620_to_utf8, to_idna, tone_detector, - sound_syllable, - syllable_length, - syllable_open_close_detector, words_to_num, ) from pythainlp.util.morse import morse_decode, morse_encode diff --git a/tests/test_wsd.py b/tests/test_wsd.py index b02f57fcf..372c04304 100644 --- a/tests/test_wsd.py +++ b/tests/test_wsd.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import unittest + from pythainlp.wsd import get_sense From 92e67b7e907c23c536575d1d075eb6076904e76c Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:19:59 +0000 Subject: [PATCH 28/38] sort module --- setup.py | 98 ++++++++++++++++++++++---------------------------------- 1 file changed, 39 insertions(+), 59 deletions(-) diff --git a/setup.py b/setup.py index 78c4d4c48..59f7719bf 100644 --- a/setup.py +++ b/setup.py @@ -6,9 +6,10 @@ https://github.com/PyThaiNLP/pythainlp """ + from setuptools import find_packages, setup -readme = """ +LONG_DESC = """ ![PyThaiNLP Logo](https://avatars0.githubusercontent.com/u/32934255?s=200&v=4) PyThaiNLP is a Python library for Thai natural language processing. @@ -37,6 +38,7 @@ """ requirements = [ + "nltk>=3.3", "requests>=2.22.0", ] @@ -57,31 +59,17 @@ "transformers>=4.6.0", ], "wunsen": ["wunsen>=0.0.1"], - "textaugment": [ - "bpemb", - "gensim>=4.0.0" - ], - "wangchanberta": [ - "transformers>=4.6.0", - "sentencepiece>=0.1.91" - ], - "mt5": ["transformers>=4.6.0", "sentencepiece>=0.1.91"], + "textaugment": ["bpemb", "gensim>=4.0.0"], + "wangchanberta": ["sentencepiece>=0.1.91", "transformers>=4.6.0"], + "mt5": ["sentencepiece>=0.1.91", "transformers>=4.6.0"], "wtp": ["transformers>=4.6.0", "wtpsplit>=1.0.1"], "wordnet": ["nltk>=3.3"], "generate": ["fastai<2.0"], "sefr_cut": ["sefr_cut>=1.1"], - "spell": [ - "phunspell>=0.1.6", - "spylls>=0.1.5", - "symspellpy>=6.7.6" - ], + "spell": ["phunspell>=0.1.6", "spylls>=0.1.5", "symspellpy>=6.7.6"], "oskut": ["oskut>=1.3"], "nlpo3": ["nlpo3>=1.2.2"], - "onnx": [ - "sentencepiece>=0.1.91", - "numpy>=1.22", - "onnxruntime>=1.10.0" - ], + "onnx": ["numpy>=1.22", "onnxruntime>=1.10.0", "sentencepiece>=0.1.91"], "thai_nner": ["thai_nner"], "esupar": [ "esupar>=1.3.8", @@ -90,70 +78,62 @@ ], "spacy_thai": ["spacy_thai>=0.7.1"], "transformers_ud": [ - "ufal.chu-liu-edmonds>=1.0.2", "transformers>=4.22.1", + "ufal.chu-liu-edmonds>=1.0.2", ], "dependency_parsing": [ "spacy_thai>=0.7.1", - "ufal.chu-liu-edmonds>=1.0.2", "transformers>=4.22.1", + "ufal.chu-liu-edmonds>=1.0.2", ], - "coreference_resolution":{ - "spacy>=3.0", + "coreference_resolution": [ "fastcoref>=2.1.5", - }, - "word_approximation":{ - "panphon>=0.20.0" - }, + "spacy>=3.0", + ], + "word_approximation": ["panphon>=0.20.0"], "wangchanglm": [ - "transformers>=4.6.0", + "pandas>=0.24", "sentencepiece>=0.1.91", - "pandas>=0.24" + "transformers>=4.6.0", ], - "wsd":{ - "sentence-transformers>=2.2.2" - }, - "el":{ - "multiel>=0.5" - }, - "abbreviation":{ - "khamyo>=0.2.0" - }, + "wsd": ["sentence-transformers>=2.2.2"], + "el": ["multiel>=0.5"], + "abbreviation": ["khamyo>=0.2.0"], "full": [ "PyYAML>=5.3.1", "attacut>=1.0.4", + "bpemb>=0.3.2", "emoji>=0.5.1", "epitran>=1.1", "fairseq>=0.10.0", + "fastai<2.0", + "fastcoref>=2.1.5", "gensim>=4.0.0", + "khamyo>=0.2.0", + "nlpo3>=1.2.2", "nltk>=3.3", "numpy>=1.22", + "onnxruntime>=1.10.0", + "oskut>=1.3", "pandas>=0.24", + "panphon>=0.20.0", + "phunspell>=0.1.6", "pyicu>=2.3", "sacremoses>=0.0.41", - "sentencepiece>=0.1.91", - "ssg>=0.0.8", - "torch>=2.0.0", - "fastai<2.0", - "bpemb>=0.3.2", - "transformers>=4.22.1", "sefr_cut>=1.1", - "phunspell>=0.1.6", + "sentencepiece>=0.1.91", + "sentence-transformers>=2.2.2", + "spacy>=3.0", + "spacy_thai>=0.7.1", "spylls>=0.1.5", + "ssg>=0.0.8", "symspellpy>=6.7.6", - "oskut>=1.3", - "nlpo3>=1.2.2", - "onnxruntime>=1.10.0", "thai_nner", - "wunsen>=0.0.3", - "wtpsplit>=1.0.1", - "spacy_thai>=0.7.1", - "spacy>=3.0", - "fastcoref>=2.1.5", + "torch>=2.0.0", + "transformers>=4.22.1", "ufal.chu-liu-edmonds>=1.0.2", - "panphon>=0.20.0", - "sentence-transformers>=2.2.2", - "khamyo>=0.2.0", + "wtpsplit>=1.0.1", + "wunsen>=0.0.3", ], } @@ -161,7 +141,7 @@ name="pythainlp", version="5.0.4", description="Thai Natural Language Processing library", - long_description=readme, + long_description=LONG_DESC, long_description_content_type="text/markdown", author="PyThaiNLP", author_email="email@wannaphong.com", @@ -177,7 +157,7 @@ include_package_data=True, install_requires=requirements, extras_require=extras, - license="Apache Software License 2.0", + license="Apache-2.0", zip_safe=False, keywords=[ "pythainlp", From 97aed61fe34b951726458b875fc36b0f5c3ad69c Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:23:48 +0000 Subject: [PATCH 29/38] Tidy up --- .github/workflows/unittest-macos.yml | 14 +++----------- .github/workflows/unittest-windows.yml | 3 +-- .github/workflows/unitttest-ubuntu.yml | 6 ++---- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index c35cc2812..91ab4f52d 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -1,4 +1,4 @@ -name: Unit test and code coverage (MacOS) +name: Unit test and code coverage (macOS) on: push: @@ -34,12 +34,10 @@ jobs: - name: Print system info run: sw_vers; python --version; arch - name: Install build tools - shell: bash -l {0} run: | python -m pip install --upgrade "pip<24.1" setuptools python -m pip install coverage coveralls pytest - name: Install ICU - shell: bash -l {0} run: | brew install icu4c PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig @@ -48,24 +46,18 @@ jobs: echo "ICU_VER=${ICU_VER}" echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}" - name: Install PyTorch - shell: bash -l {0} - run: | - pip install torch - # python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1-cp39-none-macosx_11_0_arm64.whl - # get pip wheel link from http://download.pytorch.org/whl/torch/ + run: pip install torch + # if needed, get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies - # shell: bash -l {0} # env: # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True # run: | # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP - shell: bash -l {0} run: | python -m pip install . python -m nltk.downloader omw-1.4 - name: Test - shell: bash -l {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 5d532a4f1..78b1be0e9 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -50,8 +50,7 @@ jobs: - name: Install PyTorch shell: powershell run: python -m pip install torch - # python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-win_amd64.whl - # get pip wheel link from http://download.pytorch.org/whl/torch/ + # if needed, get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # shell: powershell # env: diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 881a192ba..d4ed7d615 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -36,10 +36,8 @@ jobs: python -m pip install --upgrade "pip<24.1" setuptools python -m pip install coverage coveralls pytest - name: Install PyTorch - run: | - python -m pip install torch - # python -m pip install http://download.pytorch.org/whl/cpu/torch-2.5.1%2Bcpu-cp39-cp39-linux_x86_64.whl - # get pip wheel link from http://download.pytorch.org/whl/torch/ + run: python -m pip install torch + # if needed, get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies # env: # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True From 195154813a5990f8e578d6f7f3b65c1b2c4d3f8b Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:31:03 +0000 Subject: [PATCH 30/38] Put names to jobs --- .github/workflows/deploy-docs.yml | 9 +++++---- .github/workflows/pypi-publish.yml | 2 +- .github/workflows/pypi-test.yml | 2 +- .github/workflows/unittest-macos.yml | 6 +++--- .github/workflows/unittest-windows.yml | 6 +++--- .github/workflows/unitttest-ubuntu.yml | 6 +++--- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index aae3a7886..23e247aad 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -8,11 +8,12 @@ on: - '**.yml' jobs: - release: - name: Build + deploy-docs: + name: Build and deploy documentation runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: @@ -31,7 +32,7 @@ jobs: run: | cd docs && make html cd .. - - name: Deploy + - name: Deploy documentation uses: peaceiris/actions-gh-pages@v4 with: personal_token: ${{ secrets.PERSONAL_TOKEN }} diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 0e202074a..d9e07a207 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -5,7 +5,7 @@ on: types: [created] jobs: - deploy: + pypi-publish: runs-on: ubuntu-24.04 strategy: diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 8fb832392..695b2496e 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -5,7 +5,7 @@ on: - cron: '0 0 * * *' # Once per day jobs: - build: + pypi-test: runs-on: ubuntu-20.04 strategy: diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 91ab4f52d..c202162b8 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -15,7 +15,7 @@ on: - 'docs/**' jobs: - build: + unittest: strategy: fail-fast: false matrix: @@ -55,12 +55,12 @@ jobs: # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | - python -m pip install . - python -m nltk.downloader omw-1.4 + python -m pip install .[full] - name: Test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | + python -m nltk.downloader omw-1.4 coverage run -m unittest discover coveralls diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 78b1be0e9..d8a9176df 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -15,7 +15,7 @@ on: - 'docs/**' jobs: - build: + unittest: strategy: fail-fast: false matrix: @@ -60,13 +60,13 @@ jobs: - name: Install PyThaiNLP shell: powershell run: | - python -m pip install . - python -m nltk.downloader omw-1.4 + python -m pip install .[full] - name: Test shell: powershell env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | + python -m nltk.downloader omw-1.4 coverage run -m unittest discover coveralls diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index d4ed7d615..242480db0 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -15,7 +15,7 @@ on: - 'docs/**' jobs: - build: + unittest: strategy: fail-fast: false matrix: @@ -45,12 +45,12 @@ jobs: # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | - python -m pip install . - python -m nltk.downloader omw-1.4 + python -m pip install .[full] - name: Test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | + python -m nltk.downloader omw-1.4 coverage run -m unittest discover coveralls From 481223b2c0c403ed815319ec5def230093945696 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:45:37 +0000 Subject: [PATCH 31/38] try Pyton 3.10 --- .github/workflows/deploy-docs.yml | 2 +- .github/workflows/pypi-publish.yml | 2 +- .github/workflows/pypi-test.yml | 2 +- .github/workflows/unittest-macos.yml | 4 ++-- .github/workflows/unittest-windows.yml | 4 ++-- .github/workflows/unitttest-ubuntu.yml | 4 ++-- .python-version | 2 +- Dockerfile | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 23e247aad..f5f7fc08f 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies env: SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index d9e07a207..30d12808c 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: Checkout diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 695b2496e..f83e2865d 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index c202162b8..0e5c0ff6b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: ["macos-15"] # other versions failed PyTorch installation - python-version: ["3.9"] + python-version: ["3.10"] runs-on: ${{ matrix.os }} @@ -35,7 +35,7 @@ jobs: run: sw_vers; python --version; arch - name: Install build tools run: | - python -m pip install --upgrade "pip<24.1" setuptools + python -m pip install --upgrade "pip<24.1" "setuptools==73.0.1" python -m pip install coverage coveralls pytest - name: Install ICU run: | diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index d8a9176df..cd9131915 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: ["windows-latest"] - python-version: ["3.9"] + python-version: ["3.10"] runs-on: ${{ matrix.os }} @@ -41,7 +41,7 @@ jobs: - name: Install build tools shell: powershell run: | - python -m pip install --disable-pip-version-check --user --upgrade "pip<24.1" setuptools + python -m pip install --upgrade "pip<24.1" "setuptools==73.0.1" python -m pip install coverage coveralls pytest - name: Install ICU shell: powershell diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 242480db0..80102f3d9 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-24.04"] - python-version: ["3.9"] + python-version: ["3.10"] runs-on: ${{ matrix.os }} @@ -33,7 +33,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install build tools run: | - python -m pip install --upgrade "pip<24.1" setuptools + python -m pip install --upgrade "pip<24.1" "setuptools==73.0.1" python -m pip install coverage coveralls pytest - name: Install PyTorch run: python -m pip install torch diff --git a/.python-version b/.python-version index bd28b9c5c..c8cfe3959 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.9 +3.10 diff --git a/Dockerfile b/Dockerfile index 549848b45..dc8162af7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project # SPDX-License-Identifier: Apache-2.0 -FROM python:3.9-slim +FROM python:3.8-slim-buster COPY . . From 781e345d2b38aa57a846716a3b9db10c0fc292f2 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:49:46 +0000 Subject: [PATCH 32/38] Update PyICU win to 3.10 --- .github/workflows/unittest-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index cd9131915..dfc26b289 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -46,7 +46,7 @@ jobs: - name: Install ICU shell: powershell run: | - python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.14/PyICU-2.14-cp39-cp39-win_amd64.whl" + python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.14/PyICU-2.14-cp310-cp310-win_amd64.whl" - name: Install PyTorch shell: powershell run: python -m pip install torch From c95301ce60dca97c6784cb48540b110dfd46389e Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 05:51:32 +0000 Subject: [PATCH 33/38] Add wheel notes --- .github/workflows/unittest-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index dfc26b289..e3b782026 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -47,6 +47,7 @@ jobs: shell: powershell run: | python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.14/PyICU-2.14-cp310-cp310-win_amd64.whl" + # if needed, get pip wheel link from https://github.com/cgohlke/pyicu-build/releases - name: Install PyTorch shell: powershell run: python -m pip install torch From 27a48d36187d8845038892f900ae06cb80335c95 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 06:20:52 +0000 Subject: [PATCH 34/38] try macos-latest without bash -l --- .github/workflows/unittest-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 0e5c0ff6b..d4c0a97f7 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-15"] # other versions failed PyTorch installation + os: ["macos-latest"] python-version: ["3.10"] runs-on: ${{ matrix.os }} From 8af1f2d2748f0814b67ddf4b5bbb0982bbac17a5 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 06:28:57 +0000 Subject: [PATCH 35/38] Revert docker_requriements.txt --- docker_requirements.txt | 18 +++++++++--------- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker_requirements.txt b/docker_requirements.txt index e2ef1d4df..b07d4b0ed 100644 --- a/docker_requirements.txt +++ b/docker_requirements.txt @@ -1,27 +1,27 @@ -PyYAML==6.0.2 +PyYAML==5.4.1 attacut==1.0.6 bpemb==0.3.4 deepcut==0.7.0.0 emoji==0.5.4 epitran==1.9 esupar==1.3.9 -fairseq==0.12.2 +fairseq==0.10.2 fastai==1.0.61 fastcoref==2.1.6 -gensim==4.3.3 +gensim==4.3.2 h5py==3.1.0 khanaa==0.0.6 nlpo3==1.3.0 nltk==3.6.6 -numpy==1.22.3 +numpy==1.22.* OSKut==1.3 -pandas==1.4.4 +pandas==1.4.* panphon==0.20.0 phunspell==0.1.6 protobuf==3.20.3 -pyicu==2.14 +pyicu==2.8 python-crfsuite==0.9.11 -requests==2.32.3 +requests==2.31.* sacremoses==0.0.41 sefr_cut==1.1 sentence-transformers==2.2.2 @@ -34,8 +34,8 @@ symspellpy==6.7.7 tensorflow==2.13.1 thai-nner==0.3 tltk==1.6.8 -torch==2.5.1 -transformers==4.38.2 +torch==1.13.1 +transformers==4.38.0 ufal.chu-liu-edmonds==1.0.2 wtpsplit==1.0.1 wunsen==0.0.3 diff --git a/pyproject.toml b/pyproject.toml index 27e9c4d4a..f30ea6242 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [tool.ruff] line-length = 79 indent-width = 4 -target-version = "py39" +target-version = "py310" [tool.ruff.format] quote-style = "double" From 308e7d098afaeffd651caa8e63a64025abe97708 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 06:33:54 +0000 Subject: [PATCH 36/38] Revert versions in setup.py --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 59f7719bf..bc6a831d9 100644 --- a/setup.py +++ b/setup.py @@ -47,15 +47,15 @@ "benchmarks": ["PyYAML>=5.3.1", "numpy>=1.22", "pandas>=0.24"], "icu": ["pyicu>=2.3"], "ipa": ["epitran>=1.1"], - "ml": ["numpy>=1.22", "torch>=2.0.0"], + "ml": ["numpy>=1.22", "torch>=1.0.0"], "ssg": ["ssg>=0.0.8"], "thai2fit": ["emoji>=0.5.1", "gensim>=4.0.0", "numpy>=1.22"], - "thai2rom": ["numpy>=1.22", "torch>=2.0.0"], + "thai2rom": ["numpy>=1.22", "torch>=1.0.0"], "translate": [ "fairseq>=0.10.0", "sacremoses>=0.0.41", "sentencepiece>=0.1.91", - "torch>=2.0.0", + "torch>=1.0.0", "transformers>=4.6.0", ], "wunsen": ["wunsen>=0.0.1"], @@ -129,7 +129,7 @@ "ssg>=0.0.8", "symspellpy>=6.7.6", "thai_nner", - "torch>=2.0.0", + "torch>=1.0.0", "transformers>=4.22.1", "ufal.chu-liu-edmonds>=1.0.2", "wtpsplit>=1.0.1", From 2864da3da25b93fe1a82c96eade99c38274e1779 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 06:39:27 +0000 Subject: [PATCH 37/38] add back backports.zoneinfo --- setup.py | 2 ++ tox.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bc6a831d9..cb55c0eb3 100644 --- a/setup.py +++ b/setup.py @@ -38,8 +38,10 @@ """ requirements = [ + "backports.zoneinfo; python_version<'3.9'", "nltk>=3.3", "requests>=2.22.0", + "tzdata; sys_platform == 'win32'" ] extras = { diff --git a/tox.ini b/tox.ini index 8e8803df7..ae24e75d4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py{39,310,py3},flake8 +envlist=py{39,310,311,312,313,py3},flake8 skip_missing_interpreters = true [testenv] From c4bb673b666506bdae361cc497687507acae0d79 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 06:48:18 +0000 Subject: [PATCH 38/38] Try minimum --- .github/workflows/unittest-macos.yml | 4 ++-- .github/workflows/unittest-windows.yml | 4 ++-- .github/workflows/unitttest-ubuntu.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index d4c0a97f7..15c64e04b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -55,12 +55,12 @@ jobs: # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | - python -m pip install .[full] + python -m pip install . - name: Test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | python -m nltk.downloader omw-1.4 - coverage run -m unittest discover coveralls +# coverage run -m unittest discover diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index e3b782026..6de0deafe 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -61,7 +61,7 @@ jobs: - name: Install PyThaiNLP shell: powershell run: | - python -m pip install .[full] + python -m pip install . - name: Test shell: powershell env: @@ -69,5 +69,5 @@ jobs: COVERALLS_SERVICE_NAME: github run: | python -m nltk.downloader omw-1.4 - coverage run -m unittest discover coveralls +# coverage run -m unittest discover diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml index 80102f3d9..8c58e2d65 100644 --- a/.github/workflows/unitttest-ubuntu.yml +++ b/.github/workflows/unitttest-ubuntu.yml @@ -45,12 +45,12 @@ jobs: # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP run: | - python -m pip install .[full] + python -m pip install . - name: Test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | python -m nltk.downloader omw-1.4 - coverage run -m unittest discover coveralls +# coverage run -m unittest discover