Add tox.ini

This commit is contained in:
c-bata
2020-11-11 17:16:31 +09:00
parent 8faf4fcdf0
commit 92a9ec5d54
4 changed files with 57 additions and 1 deletions
+1
View File
@@ -8,6 +8,7 @@ build/
node_modules/
public/
.tox/
*.sqlite3
*.db
+20
View File
@@ -39,12 +39,25 @@ $ optuna-dashboard sqlite:///db.sqlite3
## Running tests, lint checks and formatters
### Run all tests and lint
```
$ tox -e ALL
```
### Running Python unit tests
```
$ python -m unittest
```
or
```
$ pip install tox
$ tox -e py39
```
### Linters (flake8, black and mypy)
```
@@ -54,6 +67,13 @@ $ black --check .
$ mypy .
```
or
```
$ pip install tox
$ tox -e flake8 -e black -e mypy
```
### Auto-formatting TypeScript files (by prettier)
```
+1 -1
View File
@@ -1,7 +1,7 @@
[flake8]
max-line-length = 99
statistics = True
exclude = venv,build
exclude = venv,build,.tox
[mypy]
ignore_missing_imports = True
+35
View File
@@ -0,0 +1,35 @@
[tox]
envlist =
py36
py37
py38
py39
flake8
black
mypy
[testenv]
basepython = python3.9
setenv=PYTHONPATH = {toxinidir}:{toxinidir}
commands = python -m unittest
[testenv:py36]
basepython = python3.6
[testenv:py37]
basepython = python3.7
[testenv:py38]
basepython = python3.8
[testenv:flake8]
deps = flake8
commands = flake8 .
[testenv:black]
deps = black
commands = black --check .
[testenv:mypy]
deps = mypy
commands = mypy .