Skip to content

Update CI to Python 3.10 #934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a9217b5
Update CI to Python 3.12
bact Oct 27, 2024
1a41072
Remove backports.zoneinfo (already in 3.9)
bact Oct 27, 2024
92f2b31
Upgrade PyYAML
bact Oct 27, 2024
d6a4114
Use Python 3.10 because Torch 1.x
bact Oct 27, 2024
e24713f
Remove redundant pip install
bact Oct 27, 2024
c851a4a
specify the patch version for Python setup on Ubuntu
bact Oct 27, 2024
6850498
Use ubuntu-22.04
bact Oct 27, 2024
7fa39c4
Use Python 3.9 on Ubutnu
bact Oct 27, 2024
c02d387
Try using container for Python 3.10 on Ubuntu isntead
bact Oct 27, 2024
ab9d819
3.10 has to be inside quote as "3.10"
bact Oct 27, 2024
3b5020a
Use pip==24.0
bact Oct 27, 2024
48085e7
Use setuptools<65
bact Oct 27, 2024
89911b0
Use setuptools<65
bact Oct 27, 2024
1351a02
Put quotes around versions in pip install cmd lnie
bact Oct 27, 2024
6f89046
Use setuptools<65
bact Oct 27, 2024
741479c
Try setuptools==65.7.0
bact Oct 27, 2024
47ce495
Remove macos-selfhosted
bact Oct 27, 2024
e4cfeb7
pyicu==2.13
bact Oct 27, 2024
baec646
use setup-python instead of setup-mimiconda
bact Oct 27, 2024
dcc60e6
setuptools<60.0
bact Oct 28, 2024
2370b16
numpy==1.22.*
bact Oct 28, 2024
26eaa61
Update docker_requirements.txt
bact Oct 28, 2024
4e01acd
remove deepcut
bact Oct 28, 2024
aa9d91e
Update test-windows.yml
bact Oct 28, 2024
c1b1212
Update test-windows.yml
bact Oct 28, 2024
ed5b45e
Remove OSKut
bact Oct 28, 2024
f6522ac
Remove serf_cut
bact Oct 28, 2024
dae8a64
setuptools==73.0.1
bact Oct 28, 2024
779c074
Merge branch 'PyThaiNLP:dev' into update-ci
bact Oct 28, 2024
6bacd77
setuptools<60 in pyproject.toml
bact Oct 28, 2024
4e72d6b
sentence-transformers==3.2.1
bact Oct 28, 2024
47d6772
numpy==2.1.2
bact Oct 28, 2024
d871fdb
gensim==4.3.2
bact Oct 28, 2024
361f0ff
setuptools==65.5.1
bact Oct 28, 2024
1382014
Update test-ubuntu.yml
bact Oct 28, 2024
e2815e2
scikit-learn no longer need upper limit on setuptools
bact Oct 28, 2024
5367b78
Update pyproject.toml
bact Oct 28, 2024
d11eb0e
Try Python 3.9
bact Oct 28, 2024
3317655
Back to Python 3.10
bact Oct 28, 2024
1d67d92
Update docker_requirements.txt
bact Oct 28, 2024
b50f37d
brew install icu4c on macOS
bact Oct 28, 2024
baab223
Update setup.py
bact Oct 29, 2024
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
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ about: Propose a change or an addition เสนอความสามาร
---

## Detailed description

<!--- Provide a detailed description of the change or addition you are proposing -->

## Context
Expand All @@ -14,7 +15,8 @@ about: Propose a change or an addition เสนอความสามาร
<!--- Not obligatory, but suggest an idea for implementing addition or change -->

## Your environment
* PyThaiNLP version:
* Python version:
* Operating system and version (distro, 32/64-bit):
* More info (Docker, VM, etc.):

- PyThaiNLP version:
- Python version:
- Operating system and version (distro, 32/64-bit):
- More info (Docker, VM, etc.):
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Description of how the changes fix the issue.
Fixes #...

### Your checklist for this pull request

🚨Please review the [guidelines for contributing](https://github.com/PyThaiNLP/pythainlp/blob/dev/CONTRIBUTING.md) to this repository.

- [ ] Passed code styles and structures
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ 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
uses: actions/setup-python@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: "3.10"
- name: Install dependencies
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade "pip==24.0" "setuptools"
pip install pytest coverage coveralls
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 nltk.downloader omw-1.4
Expand Down
98 changes: 0 additions & 98 deletions .github/workflows/macos-test.yml

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ on:
jobs:
deploy:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.8]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install --upgrade "pip==24.0" "setuptools"
pip install wheel twine
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.8]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
run: |
python -m pip install --upgrade pip
pip install deepcut tltk
python -m pip install --upgrade "pip==24.0" "setuptools"
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r https://raw.githubusercontent.com/PyThaiNLP/pythainlp/dev/docker_requirements.txt
pip install pythainlp[full]
python -m nltk.downloader omw-1.4
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Unit test and code coverage (macOS)

on:
push:
paths-ignore:
- '**.md'
- 'docs/**'
# - '**.yml'
pull_request:
branches:
- dev
paths-ignore:
- '**.md'
- '**.yml'
- 'docs/**'

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
python-version: ["3.10"]

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the ICU library
run: |
brew install icu4c
PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> "${GITHUB_ENV}"
- name: Determine the ICU version
run: |
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}
run: |
python -m pip install --upgrade "pip==24.0" "setuptools"
python -m pip --version
python -m pip show setuptools
python -m pip install pytest coverage coveralls
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True python -m pip install -r docker_requirements.txt
python -m pip install .[full]
python -m nltk.downloader omw-1.4
python -m pip cache purge
- name: Test
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coverage run -m unittest discover
coveralls
25 changes: 13 additions & 12 deletions .github/workflows/test.yml → .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit test and code coverage
name: Unit test and code coverage (Ubuntu)

on:
push:
Expand All @@ -15,27 +15,28 @@ on:
jobs:
build:

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.9]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
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 --upgrade "pip==24.0" "setuptools"
python -m pip install "numpy==2.1.2"
python -m pip --version
python -m pip show setuptools
python -m pip install pytest coverage coveralls
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True python -m pip install -r docker_requirements.txt
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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows Unit test and code coverage
name: Unit test and code coverage (Windows)

on:
push:
Expand All @@ -22,38 +22,28 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: [3.8]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
auto-activate-base: true
auto-update-conda: true
- shell: powershell
run: |
conda info
conda list
- name: Install PyTorch
shell: powershell
run: |
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 install --disable-pip-version-check --user --upgrade "pip==24.0" "setuptools"
python -m pip --version
python -m pip show setuptools==65.5.1
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-cp310-cp310-win_amd64.whl"
python -m pip install -r docker_requirements.txt
python -m pip install .[full]
python -m nltk.downloader omw-1.4
python -m pip install spacy deepcut tltk
- name: Test
shell: powershell
env:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ notebooks/iso_11940-dev.ipynb
# vscode devcontainer
.devcontainer/
notebooks/d.model

logs/
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
# SPDX-License-Identifier: Apache-2.0

FROM python:3.8-slim-buster
FROM python:3.9-slim

COPY . .

RUN apt-get update && apt-get install -y --no-install-recommends build-essential libicu-dev libicu63 pkg-config && rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip setuptools
RUN pip3 install --upgrade "pip==24.0" "setuptools"
RUN if [ -f docker_requirements.txt ]; then pip3 install -r docker_requirements.txt; fi
RUN pip3 install -e .[full] && pip3 cache purge
Loading