diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index c01e0161..d87bdf50 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -18,8 +18,9 @@ jobs: architecture: x64 - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools - pip install --progress-bar off .[lint] + python -m pip install --progress-bar off --upgrade pip setuptools + pip install --progress-bar off . + pip install --progress-bar off flake8 black isort mypy - run: flake8 . --show-source - run: black --check --diff . - run: isort --check --diff . @@ -37,5 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: x64 - name: Install dependencies - run: pip install --progress-bar off . + run: | + python -m pip install --progress-bar off --upgrade pip setuptools + pip install --progress-bar off . - run: python -m unittest diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 453c698b..bd80f7d3 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -70,10 +70,21 @@ $ pip install tox $ tox -e py39 ``` +### Running visual regression tests using pyppeteer + +Please run following commands, then check screenshots in `tmp/` directory. + +``` +$ pip install -r requirements.txt +$ python visual_regression_test.py --output-dir tmp +``` + +Note: When you run pyppeteer for the first time, it downloads the latest version of Chromium (~150MB) if it is not found on your system. + ### Linters (flake8, black and mypy) ``` -$ pip install .[lint] +$ pip install -r requirements.txt $ flake8 $ black --check . $ isort . --check diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..6d49d55a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +# project dependency +optuna>=2.4 +bottle +typing-extensions;python_version<'3.8' +scikit-learn + +# lint +black +flake8 +isort +mypy + +# test +pyppeteer diff --git a/setup.cfg b/setup.cfg index 1ae34112..3cd04ed6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,13 +32,6 @@ install_requires = typing-extensions;python_version<'3.8' scikit-learn -[options.extras_require] -lint = - black - isort - mypy - flake8 - [options.entry_points] console_scripts = optuna-dashboard = optuna_dashboard.cli:main diff --git a/tox.ini b/tox.ini index dd77fb99..91a17ef3 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ commands = black --check . {posargs} [testenv:isort] deps = isort -commands = isort . --check +commands = isort . --check {posargs} [testenv:mypy] deps = mypy