mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-12 12:40:33 +08:00
Add tox.ini
This commit is contained in:
@@ -8,6 +8,7 @@ build/
|
||||
|
||||
node_modules/
|
||||
public/
|
||||
.tox/
|
||||
|
||||
*.sqlite3
|
||||
*.db
|
||||
|
||||
@@ -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,7 +1,7 @@
|
||||
[flake8]
|
||||
max-line-length = 99
|
||||
statistics = True
|
||||
exclude = venv,build
|
||||
exclude = venv,build,.tox
|
||||
|
||||
[mypy]
|
||||
ignore_missing_imports = True
|
||||
|
||||
@@ -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 .
|
||||
Reference in New Issue
Block a user