This repository is no longer in use, superseded by the migration to a monolith in communitiesuk/funding-service-design-post-award-data-store#641
- Python 3.11.x or higher
- Install Python 3.11
(Instructions assume python 3 is installed on your PATH as
python
but may bepython3
on OSX)
Check your python version starts with 3.11 i.e.
python --version
Python 3.11.2
From top level repo directory:
python -m venv .venv
...or if using PyCharm when importing project, create venv and set local python interpreter to use it:
In Pycharm:
- File -> New Project... :
- Select 'New environment using' -> Virtualenv
- Set 'location' to top level of project folder
- Base interpreter should be set to global Python install.
...either macOS using bash/zsh:
source .venv/bin/activate
...or if on Windows using Command Prompt:
.venv\Scripts\activate.bat
...or if using Pycharm, if venv not set up during project import:
- settings -> project -> python interpreter -> add interpreter -> add local interpreter
- If not previously created -> Environment -> New -> select path to top level of project
- If previously created -> Environment -> Existing -> Select path to local venv/scripts/python.exe
- Do not inherit global site packages
To check if Pycharm is running local interpreter (rather than global):
pip -V #check the resultant path points to virtual env folder in project
Add pip tools:
python -m pip install pip-tools
Install dependencies:
python -m pip install --upgrade pip && pip install -r requirements-dev.txt
NOTE: requirements-dev.txt and requirements.txt are updated using pip-tools pip-compile To update requirements please manually add the dependencies in the .in files (not the requirements.txt files) Then run:
pip-compile requirements.in
pip-compile requirements-dev.in
For convenience a shell script has been provided to download and extract the GOV.UK Frontend distribution assets
python build.py
- Install pre-commit locally
- Pre-commit hooks can either be installed using pip
pip install pre-commit
or homebrew (for Mac users)brew install pre-commit
- From your checkout directory run
pre-commit install
to set up the git hook scripts
To run the app alongside other related microservices see https://github.com/communitiesuk/funding-service-design-post-award-docker-runner
To run the front-end app locally, you can run the following:
flask run
App should be available at http://localhost:5000
Functionality may be limited due to dependency on other microservices. It is recommended to run all the necessary apps using Docker Compose from the docker runner repo: https://github.com/communitiesuk/funding-service-design-post-award-docker-runner
To run the tests:
python -m pytest --cov=app --cov-report=term-missing --cov-branch
main
branch is continuously deployed to the AWS Test environment, deployments to the Dev and Production environments are triggered by a manual Github Actions workflow.
On the deployed environments we use Paketo buildpacks rather than the local Dockerfile.