A simple FastAPI to mock the SDS service required by eq-runner.
- Python installed using Pyenv. Version is specified in
.python-version
file. - Poetry Package Manager
To install dependencies using poetry, run the following command:
poetry install
To launch business surveys that make use of supplementary data, you'll first need to pull down example unit data from the sds-schema-definitions examples. To do this, run the following command:
make load-mock-unit-data
IMPORTANT: The hardcoded MOCK_DATA_PATHS_BY_SURVEY_ID
in app/main.py
will need to be updated if any of the
sds-schema-definitions
example folders change
To run the FastAPI application locally using uvicorn
, use the following command:
make run
The application will be accessible at http://localhost:5003
.
You can also containerize the application using Docker.
- Build the Docker image:
docker build -t eq-runner-mock-sds .
- Run the Docker container:
docker run -d -p 5003:5003 eq-runner-mock-sds
The FastAPI app will be available at http://localhost:5003
.
To format the code using black, run the following command:
make format
To lint the code using black, run the following command:
make lint
To run the unit tests, run the following command:
make test