You want to improve MapProxy, found a bug and want to fix it? Great! This document points you to some helpful information.
The main (authoritative) repository is hosted at http://github.com/mapproxy/mapproxy
To get a copy of the repository call:
git clone https://github.com/mapproxy/mapproxy
If you want to contribute a patch, please consider creating a “fork” instead. This makes life easier for all of us.
This is the documentation you are reading right now. The raw files can be found in
doc/. The HTML version user documentation is build with Sphinx. To rebuild this documentation install Sphinx with
pip install sphinx sphinx-bootstrap-theme and call
python setup.py build_sphinx. The output appears in
build/sphinx/html. The latest documentation can be found at
We are using the issue tracker at GitHub to manage all bug reports, enhancements and new feature requests for MapProxy. Go ahead and create new tickets. Feel free to post to the mailing list first, if you are not sure if you really found a bug or if a feature request is in the scope of MapProxy.
MapProxy contains lots of automatic tests. If you don’t count in the
mapproxy-seed-tool and the WSGI application, the test coverage is around 95%. We want to keep this number high, so all new developments should include some tests.
MapProxy uses pytest as a test loader and runner.
pip install pytest
To run the actual tests call:
We distinguish between doctests, unit, system tests.
Doctest are embedded into the source documentation and are great for documenting small independent functions or methods. You will find lots of doctest in the
Tests that are a little bit more complex, eg. that need some setup or state, are put into
mapproxy.tests.unit. To be recognized as a test all functions and classes should be prefixed with
Test. Refer to the existing tests for examples.
We have some tests that will start the whole MapProxy application, issues requests and does some assertions on the responses. All XML responses will be validated against the schemas in this tests. These test are located in
You are using virtualenv as described in Installation, right?
Before you start hacking on MapProxy you should install it in development-mode. In the root directory of MapProxy call
pip install -e ./. Instead of installing and thus copying MapProxy into your virtualenv, this will just link to your source directory. If you now start MapProxy, the source from your MapProxy directory will be used. Any change you do in the code will be available if you restart MapProxy. If you use the
mapproxy-util serve-develop command, any change in the source will issue a reload of the MapProxy server.
In order to debug MapProxy in an IDE of your choice, set your working directory to one containing your
mapproxy.yaml configuration file and debug the
mapproxy\script\util.py file with the command line parameters
serve-develop mapproxy.yaml. Around line 107 of util.py, you may need to temporarily change
use_reloader from True to False. Then browse to http://localhost:8080/ to trigger a request to debug.