The (strongly) recommended way of developing, testing and debugging reuse-api is to set up an isolated Python environment, called a virtual environment or venv, to make development independent from the operating system provided version of the required Python libraries. To make this as easy as possible, reuse-api uses Pipenv.
After cloning the git repository, just run
make virtualenv in the git
checkout directory and the virtual environment will be completely set up.
reuse-api follows PEP 8. Additionally, imports are sorted
alphabetically; you can run
make applyisort to let
isort do that for you. Source code is
formatted with the tool black; use
applyblack to reformat the code before you commit.
reuse-api can be run from the git checkout directory for testing and debugging.
When you have set up that, you can run
make flask to run reuse-api
with Flask’s built-in web server in debug mode. Alternatively, you can run
make gunicorn to use the gunicorn web server, which is the variant used in
The following commands are available for automatic quality checks:
make isortto verify the correct sorting of imports.
make blackto verify the correct formatting of source code.
make lintto verify the compliance with coding standards.
make pytestto run the functional tests defined in the tests directory.
make qualityto run all of the above tests.
All these tests are also run during the deployment process, and updating the
code on the production server is refused if any of the tests fails, so it is
strongly recommended that you run
make quality before committing any change.