Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Lint

name: PyThaiNLP Test

on: [push,pull_request]
on: [push]

jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
python-version: [3.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -21,20 +18,16 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip pytest wheel flake8 flake8-commas flake8-comprehensions
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install "h5py>=2.10.0,<3" "tensorflow>=2.3.1,<3"
pip install torch==1.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install deepcut
pip install .[full]
pip install deepcut coverage coveralls
pip install flake8 flake8-commas flake8-comprehensions flake8-tidy-imports
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test
env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage run -m unittest discover
CI_BRANCH=${GITHUB_REF#"ref/heads"} COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} coveralls
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
name: Upload package to PyPI

on:
release:
Expand All @@ -11,13 +8,16 @@ jobs:
deploy:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]

steps:
- uses: actions/checkout@v2
- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: '3.x'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Unit test and code coverage

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest coverage coveralls
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install "h5py>=2.10.0,<3" "tensorflow>=2.3.1,<3"
pip install torch==1.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install deepcut
pip install .[full]
- name: Test
env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage run -m unittest discover
CI_BRANCH=${GITHUB_REF#"ref/heads"} COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} coveralls
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ install:
- python --version
- python -m pip install --disable-pip-version-check --user --upgrade pip setuptools
- pip --version
- pip install -U coveralls[yaml]
- pip install -U coverage
- pip install -U "h5py>=2.10.0,<3" "tensorflow>=2.3.1,<3" deepcut
- pip install torch==1.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip install %PYICU_PKG%
Expand Down
17 changes: 11 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tox]
envlist = py36,flake8
envlist=py{36,37,38,39,py3},flake8
skip_missing_interpreters = true

[testenv]
setenv = PYTHONPATH = {toxinidir}:{toxinidir}/pythainlp
Expand All @@ -12,11 +13,15 @@ deps = discover
; deps =
; -r{toxinidir}/requirements.txt

[flake8]
exclude = **/.ipynb_checkpoints,

[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 pythainlp
deps =
flake8
flake8-commas
flake8-comprehensions
flake8-tidy-imports
commands =
flake8 pythainlp

[flake8]
exclude = **/.ipynb_checkpoints,