This document will guide you through setting up your development environment for the IaC-Assistant project.
This project uses Poetry for dependency management and packaging. Poetry ensures that you have a consistent and reproducible development environment. The dependencies are defined in the pyproject.toml file and locked in the poetry.lock file.
To install the project dependencies, you need to have Poetry installed. Then, run the following command in the root of the project:
poetry installThis will create a virtual environment inside the project's root directory and install all the necessary dependencies.
We use pre-commit hooks to ensure code quality and consistency before any code is committed. The hooks are configured in the .pre-commit-config.yaml file and include:
black: An opinionated code formatter.flake8: A tool to check for style and quality issues.reorder-python-imports: A tool to automatically sort imports.mypy: A static type checker.
To set up the pre-commit hooks, run the following command after installing the dependencies:
pre-commit installNow, the hooks will run automatically every time you make a commit.
We use Tox to automate and standardize testing in isolated environments. The tox.ini file is configured to run the following checks:
lint: Runs all pre-commit hooks to check for code quality.mypy: Runs the static type checker.
To run all the checks, simply execute the following command:
tox