Service for authenticating users for services that serve the Exporting is Great campaign for the Department for International Trade (DIT).
$ git clone https://github.com/uktrade/directory-sso
$ cd directory-sso
$ [create virtual environment]
$ source .venv/bin/activate
$ make requirements
Secrets such as API keys and environment specific configurations are placed in conf/env/secrets-do-not-commit
- a file that is not added to version control. To create a template secrets file with dummy values run make secrets
.
Command | Description |
---|---|
make clean | Delete pyc files |
make pytest | Run all tests |
make pytest test_foo.py | Run all tests in file called test_foo.py |
make pytest -- --last-failed` | Run the last tests to fail |
make pytest -- -k foo | Run the test called foo |
make pytest -- | Run arbitrary pytest command |
make manage | Run arbitrary management command |
make webserver | Run the development web server |
make requirements | Compile the requirements file |
make install_requirements | Installed the compile requirements file |
make css | Compile scss to css |
make secrets | Create your secret env var file |
If you're doing front-end development work you will need to be able to compile the SASS to CSS. For this you need:
$ npm install yarn
$ yarn install --production=false
We add compiled CSS files to version control. This will sometimes result in conflicts if multiple developers are working on the same SASS files. However, by adding the compiled CSS to version control we avoid having to install node, npm, node-sass, etc to non-development machines.
You should not edit CSS files directly, instead edit their SCSS counterparts.
We are using distributed testing by default. You can disable it by removing -n auto --dist=loadfile
from the pytest.ini
You can also disable it by running pytest with --dist=no --pdb
and insert a breaking assertion (e.g. assert 0
) where you would normally pdb.set_trace()
.
https://github.com/uktrade?q=directory https://github.com/uktrade?q=great