From 3b3017345c92ec1397c90164717184814017780a Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 10 Apr 2021 03:21:52 +0900 Subject: [PATCH 1/3] Add requirements.txt instead of setup.cfg --- .github/workflows/python-tests.yml | 4 ++-- DEVELOPMENT.md | 2 +- requirements.txt | 14 ++++++++++++++ setup.cfg | 7 ------- tox.ini | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index c01e0161..04d9c63e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -18,8 +18,8 @@ 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 flake8 black isort mypy - run: flake8 . --show-source - run: black --check --diff . - run: isort --check --diff . diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 453c698b..4b2d06a4 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -73,7 +73,7 @@ $ tox -e py39 ### 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 From e392644087550b4b2fb3444289f7d4505afba243 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 10 Apr 2021 03:26:12 +0900 Subject: [PATCH 2/3] Add description for visual regression test --- DEVELOPMENT.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4b2d06a4..bd80f7d3 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -70,6 +70,17 @@ $ 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) ``` From e05ea5426a4e645525e0bbc7aff0f8b8207574f1 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 10 Apr 2021 05:02:27 +0900 Subject: [PATCH 3/3] Fix action --- .github/workflows/python-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 04d9c63e..d87bdf50 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -19,6 +19,7 @@ jobs: - name: Install dependencies run: | 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 . @@ -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