A service used by eQ Runner to request CIs from CIR, forward the instruments to the CIR Converter Service to convert them to the latest version, and return the updated instrument back to eQ Runner
To run the project locally, follow these steps:
Ensure you have the following installed:
- Python: Version specified in
.python-version. We recommend using pyenv for managing Python versions. - Poetry: This is used to manage package dependencies and virtual environments.
- Docker
- Operation System: Ubuntu/MacOS
-
Clone the repository and install the required dependencies.
git clone https://github.com/ONSdigital/eq-cir-proxy-service.git
-
Install dependencies
Poetry is used to manage dependencies in this project. For more information, read the Poetry documentation.
To install all dependencies, including development dependencies, run:
make install-dev
To install only production dependencies, run:
make install
-
Set the environment variable LOG_LEVEL.
It can be set to INFO, DEBUG, WARN, ERROR - if not set, it will be set to INFO by default.
make set-env-var
-
Run the application
make run
Get started with development by running the following commands.
Before proceeding, make sure you have the development dependencies installed using the make install-dev command.
A Makefile is provided to simplify common development tasks. To view all available commands, run:
makeThe unit tests are written using the pytest framework. To run the tests and check coverage, run:
make testVarious tools are used to lint and format the code in this project. These include:
- Black
- MegaLinter
- Mypy
- Pylint
- Ruff
The project uses Ruff, pylint and black for linting and formatting of the Python code.
The tools are configured using the pyproject.toml file.
To lint the Python code, run:
make lintTo auto-format the Python code, and correct fixable linting issues, run:
make formatMegaLinter is utilised to lint the non-python files in the project. It offers a single interface to execute a suite of linters for multiple languages and formats, ensuring adherence to best practices and maintaining consistency across the repository without the need to install each linter individually.
MegaLinter examines various file types and tools, including GitHub Actions, Shell scripts, Dockerfile, etc. It is
configured using the .mega-linter.yml file.
To run MegaLinter, ensure you have Docker installed on your system.
Note: The initial run may take some time to download the Docker image. However, subsequent executions will be considerably faster due to Docker caching.
To start the linter and automatically rectify fixable issues, run:
make megalint- Navigate to http://localhost:5050/docs to view the FastAPI application.
- Navigate to http://localhost:5050/ to view the response JSON.
See CONTRIBUTING.md for details.
See LICENSE for details.