10. Development Notes

Run the following before any of the following tasks:

set VIRTUALENV=C:\VirtualEnvs\mappyfile
echo set VIRTUALENV=C:\VirtualEnvs\mappyfile3

echo set MAPPYFILE_PATH=C:\Code\mappyfile
set MAPPYFILE_PATH=D:\GitHub\mappyfile

10.1. Building the Dev Virtual Environment

Run from the root of the mappyfile project folder:

set MAPPYFILE_PATH=D:\GitHub\mappyfile
set VIRTUALENV=C:\VirtualEnvs\mappyfile3
cd /D "C:\Python36\Scripts"
pip install virtualenv
virtualenv %VIRTUALENV%
pip install -r requirements-dev.txt

10.2. Testing Locally

See also https://tox.readthedocs.io/en/latest/ (run with tox).

First install the development code to a virtual environment:

pip install -e .

Run from the root of the mappyfile project folder:


To see which tests will run:

pytest --collect-only

For a single test file:

pytest tests/test_snippets.py

10.3. Lark Update

To update from master. https://github.com/erezsh/lark/

pip install git+git://github.com/lark-parser/lark@master -U

10.4. Linting

flake8 --ignore=E501,E121,E122,E123,E126,E127,E128 tests
flake8 mappyfile --max-line-length=120

Or to export to file:

flake8 --ignore=E501,E121,E122,E123,E126,E127,E128 tests > D:\Temp\lint.txt
flake8 mappyfile --max-line-length=120 > D:\Temp\lint.txt

10.5. Prospector

prospector > prospector.log

10.6. Documentation

To build the Sphinx documentation:

make.bat html