Pull requests welcome.
This is a Python codebase, written to support Python 3 only.
This app uses dependencies that are difficult to install locally. In order to make local development easy, we run app commands through a Docker container. Run the following to set this up:
make bootstrap-with-dockerBecause the container caches things like packages, you will need to run this again if you change the package versions.
In the root directory of the repo, run:
notify-pass credentials/client-integration-tests > environment.sh
Unless you're part of the GOV.UK Notify team, you won't be able to run this command or the Integration Tests. However, the file still needs to exist - run touch environment.sh instead.
There are unit and integration tests that can be run to test functionality of the client.
To run the unit tests:
make test-with-docker
We use tox to ensure code works on all versions of python. You can run this using docker by calling:
make tox-with-dockerBecause tox caches installed packages, you may need to run rm -rf .tox if you change package versions.
To run the integration tests:
make integration-test-with-docker
If you wish to run tox locally, you'll need to install a variety of python versions. You should use pyenv for this.
while read line; do pyenv install "$line" < /dev/null; done < tox-python-versionsYou may already have a .python-version file. In order to run tox you need to activate all the Python versions in tox-python-versions.
cp tox-python-versions .python-versionThen you'll need to install tox.
pip install toxThen you can run tox to run the tests against each version of python.
Use this to test the client without having to create an application.
python utils/make_api_call.py <base_api_url> <api_key> [fetch|create]
This will use the API referred to in the base_api_url argument to send a text message.