Development Environment

Setup

Splinter is written in Python 3. It targets active Python versions and generally drops support for versions as they hit end of life status. For platform support, we target Linux, MacOS, and Windows.

Installing Python on your machine is out of scope for this documentation.

We use virtual environments extensively and manage them using tox.

Generally, tox should be installed with pip:

pip install tox

See tox’s documentation if you need to use another method.

tox can then be run from the project root:

cd /path/to/source_code
# Lists the possible environments to use with `tox -e`
tox l

Linting

Splinter enforces code standards using various linting tools. They can be run from tox:

tox -e lint

Testing

The following tox environments each run a subset of the test suite:

  • tests_splinter

  • tests_lxml_drivers

  • tests_selenium

  • tests_selenium_remote

  • tests_selenium_edge

  • tests_selenium_safari

Run

Running any suite is as simple as passing the environment name to tox:

tox -e tests_selenium

Documentation

Our documentation is written using Sphinx, which uses the RST format.

For the documentation’s visual theme, we use the Sphinx-Immaterial Theme.

Build

The build_docs environment is a wrapper around Sphinx’s Makefile. Arguments will be passed to the Makefile. Thus, to build the docs in HTML format:

tox -e build_docs -- html

The documentation will then be built inside the docs/_build/html directory:

open docs/_build/html/index.html