Skip to content

Commit

Permalink
Run tests on python 3.11 and 3.12 prelease (#115)
Browse files Browse the repository at this point in the history
* run tests on python 3.11 and 3.12 prelease

* refine actions workflow

* upgrade setuptools before runnig tests

* upgrade mypy

* upgrade actions/setup-python

* ignore lint error E275 - missing whitespace

* upgrade deps for development
  • Loading branch information
mocobeta authored Jul 1, 2023
1 parent 1d13da6 commit 88f1d66
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
ignore=W605
ignore=W605,E275
exclude=.git,__pycache__,docs,sysdic,work,mecab-ipadic-2.7.0-20070801,benchmark
max-line-length=120
26 changes: 11 additions & 15 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ name: Checks

on:
push:
paths:
- 'janome/**'
- 'tests/**'
- 'ipadic/**'
- '.github/workflows/**'
branches:
- 'master'
pull_request:
paths:
- 'janome/**'
- 'tests/**'
- 'ipadic/**'
- '.github/workflows/**'


jobs:
test:
Expand All @@ -21,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']

steps:
- uses: actions/checkout@v2
Expand All @@ -31,19 +24,22 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Test
run: |
pip install psutil
pip install --upgrade pip
pip install --upgrade setuptools
pip install -r requirements-dev.txt
python setup.py test
check:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
- name: Unit tests for coverage
run: |
pip install coverage
pip install psutil
pip install --upgrade pip
pip install --upgrade setuptools
pip install -r requirements-dev.txt
python setup.py develop
coverage run -m unittest discover tests
- name: Coveralls
Expand Down
2 changes: 1 addition & 1 deletion janome/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Token(object):
A Token object contains all information for a token.
"""

def __init__(self, node: Node, extra: Tuple = None):
def __init__(self, node: Node, extra: Optional[Tuple] = None):
self.node = node
self.extra = extra

Expand Down
22 changes: 9 additions & 13 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
autopep8==1.5.4
flake8==3.8.3
mccabe==0.6.1
mypy==0.782
mypy-extensions==0.4.3
pycodestyle==2.6.0
pyflakes==2.2.0
toml==0.10.1
typed-ast==1.4.1
typing-extensions==3.7.4.2
twine==3.2.0
wheel==0.35.1
psutil==5.9.0
autopep8
flake8
mypy
pyflakes
toml
twine
wheel
psutil
coverage

0 comments on commit 88f1d66

Please sign in to comment.