commit | 215787c4b622a4d579370173f19e1ed55ee24510 | [log] [tgz] |
---|---|---|
author | Borjan Tchakaloff <borjan@steadymonkey.eu> | Fri Jan 24 14:29:58 2020 +0100 |
committer | Borjan Tchakaloff <borjan@steadymonkey.eu> | Fri Jan 24 17:09:24 2020 +0100 |
tree | 32a6bedba52d700b9187ff8caec5d99ff244619d | |
parent | c20f4f374f6ded02cba134977f98c44f39f12fa2 [diff] |
Setup the Python toolchain Use pre-commit to run Black and mypy on Python code. Also fix the requirements file that was not pinning transitive dependencies. Issue: INFRA-228 Change-Id: Iab2fcf932d21400cdfb2fdf005068c9206a57bdf
Deployment script to install and configure the SmartViser solution on devices.
Install the required dependencies in a virtual environment:
% python3 -mvenv venv % . ./venv/bin/activate (venv) % pip install -r requirements.txt
Follow instructions at https://gitlab.fairphone.software/fp/wiki/wikis/fp2/m/gms/sanity#prepare-a-device
Follow (and potentially adapt) instructions on how to run sanity check at https://gitlab.fairphone.software/fp/wiki/wikis/fp2/m/gms/sanity#run-the-sanity-check
Install the pre-commit
hook to setup the toolchain:
(venv) % pip install -r requirements-dev.txt (venv) % pre-commit install
The toolchain can be run independently of the hook. On the staged changes only:
(venv) % pre-commit run
Or on all files:
(venv) % pre-commit run --all-files
To keep things simple, and avoid installing extra software, this repository relies on standard Python tools (pip
and the venv
module).
The abstract dependencies are specified in setup.py
while the actual dependencies (i.e. the required and transitive dependencies) are pinned in dedicated requirements files. This ensures reproducibility.