Development

Preparing development environment

Create new virtual environment

cd path/to/cloned/repo/marshmallow_configparser
python3 -m venv .venv
source .venv/bin/activate
pip install -u pip wheel

Installing in develop mode

python setup.py develop

Later, to uninstall it

python setup.py develop --uninstall

To install extra packages useful in development

pip install -e .[dev]

Running tests

py.test

or to get more verbose output

py.test -p no:sugar --spec

or to generate tests coverage

py.test --cov=marshmallow_configparser --cov-report=html

and finally, tests can be run with tox

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox

Running under PyPy3

wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.8.0-linux64.tar.bz2
tar -xvjf pypy3-v5.8.0-linux64.tar.bz2
virtualenv -p pypy3-v5.8.0-linux64/bin/pypy3 .venvpypy
source .venvpypy/bin/activate
pip install -U pip wheel

Profiling

Use IPython shell to generate profiling data

%prun -D program.prof [mover.move(d) for d in moves_cycle]

After that, it is viewable by either Snakeviz

snakeviz program.prof

or as call graph through KCacheGrind

pyprof2calltree -i program.prof
kcachegrind program.prof.log

Uploading to PyPI

pip install -U twine

Prepare ~/.pypirc

[distutils]
index-servers=
    pypi
    pypitest

[pypitest]
repository = https://test.pypi.org/legacy/
username = <username>
password = <password>

[pypi]
username = <username>
password = <password>

Create dist

python setup.py sdist bdist_wheel

An upload it

twine upload -r pypitest dist/*