diff --git a/Makefile b/Makefile index d0874e03f..fdbdbecb2 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ clean-test: ## remove test and coverage artifacts rm -f .coverage rm -fr htmlcov/ -lint: ## check style with flake8 - flake8 pythainlp tests +lint: ## check style + ruff check pythainlp tests notebooks test: ## run tests quickly with the default Python python -m unittest discover diff --git a/pyproject.toml b/pyproject.toml index 9724eb0ea..a1c233fd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dev = [ "build>=1.0.0", "bump-my-version>=1.2.6", "coverage>=7.10.7", - "flake8>=7.3.0", + "mypy>=1.19.1", "ruff>=0.14.14", "tox>=4.30.3", ] @@ -345,23 +345,21 @@ select = [ extend-ignore = ["E402", "E501", "E722", "S101", "S202", "S301", "S310"] [tool.tox] -envlist = ["py39", "py310", "py311", "py312", "py313", "py314", "py3", "pypy3", "flake8"] +env_list = ["py39", "py310", "py311", "py312", "py313", "py314", "pypy310", "pypy311", "ruff"] skip_missing_interpreters = true -[tool.tox.testenv] -setenv = { PYTHONPATH = "{toxinidir}:{toxinidir}/pythainlp" } -changedir = "tests" -commands = ["discover"] -deps = ["discover"] +[tool.tox.env_run_base] +commands = [["python", "-m", "unittest", "tests.core", "tests.compact"]] +extras = ["compact"] -[tool.tox.envs.pypy3] +[tool.tox.env.pypy310] basepython = "pypy3.10" -setenv = { PYTHONPATH = "{toxinidir}:{toxinidir}/pythainlp" } -changedir = "tests" -commands = ["discover"] -deps = ["discover"] -[tool.tox.envs.flake8] +[tool.tox.env.pypy311] +basepython = "pypy3.11" + +[tool.tox.env.ruff] basepython = "python" -deps = ["flake8"] -commands = ["flake8 pythainlp"] +deps = ["ruff"] +commands = [["ruff", "check", "pythainlp"], ["ruff", "format", "--check", "pythainlp"]] +skip_install = true