A collection of tools and scripts for either standalone use or importing into other projects. Collating these small utilites and code snippets will decrease code duplication across our projects.
To install the as a command run.
pip3 install git+https://github.com/alphagov/cybersecuritytools.git@#egg=cybersecuritytools
You might run into pip keyring issues where the above install hangs. You can work around it by setting the following environment variable and re running the pip command.
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
Once installed you should be able to run cst
from anywhere.
The CLI interface is setup to have multiple sub commands. This helps us organise multiple projects tools into a single CLI. For example:
cst sub1 sub2 command
Install pyenv then install Python 3.6, 3.7, and 3.8.
Find the latest python versions
pyenv install -l | grep '^ 3.[678]..$'
Install the Pythons
pyenv install 3.6.11
pyenv install 3.7.8
pyenv install 3.8.5
Add the shims to your environment
pyenv global 3.8.5 3.7.8 3.6.11 system
Install Poetry
pip install poetry
Run tests with make test
.
Test files live along side the python files. They have the same name
with a suffix of _test
. For example if your file is
cybersecuritytools/foo/bar.py
then the tests will be in
cybersecuritytools/foo/bar_test.py
.
.secrets.baseline
tox
, all tests, formatting, and linting must pass.