Scripts#

EncoderMap has a few scripts, that can help with development.

run_docbuild_test_and_cover#

EncoderMap’s main CI script.

Execution:
  1. Check whether a new commit is on the current branch. Force with -f.

  2. Run tests with coverage. Skip with -d

  3. Run new notebooks and put the executed notebooks in docs

  4. Build json files for dynamic shield.io badges.

  5. Run and create a mypy report.

Also logs these executions into docbuild.log into the same directory, as this file is also in. Logfiles older than a month are backed-up into YYYY-MM_docbuild.log files. This script is meant to be added as a cronjob. To make it run every 3 hours, add this line to crontab:

0 */3 * * * $python /path/to/encodermap/tests/run_docbuild_test_and_cover.py

And set the correct python executable and path to this script..

run_docbuild_test_and_cover [OPTIONS]

Options

-f, --force#

Forces the script to rerun tests, rebuild documentation.

-fb, --force-notebook#

Forces the script to rerun notebooks, even when not changed since last commit. This can potentially take a long time.

-d, --doc-only#

Skips tests and just build docs. Can be combined with the f-flag to force only docs.

-t, --test-only#

Skips docs and just runs tests.

--run-expensive-tests#

Sets the env-variable 11ENCODERMAP_RUN_EXPENSIVE_TESTS=’True’`` prior to running tests.

--remote <remote>#

To check and pull the latest remotes from a specific remote. Set it here. Can be used with passwordless ssh remote configurations.

--log#

Whether to log to console or just file.

--del-robots#

Set this flag, so that the robots.txt of the site will be deleted and your site will be visible by search engines.

run_doctests#

Helps with testing the documentation. Starts a unittest runner, that only runs the doctest test suite.

run_doctests [OPTIONS]

Options

--module <module>#

The name of the module to run doctests from.

--exclude <exclude>#

Exclude this substring from recursing through modules.

--only <only>#

Only run doctests matching this string.