In order to set up the development environment you will need to have poetry installed on your computer. You can then install all of the project dependencies by running the following command.
poetry install
This will create a virtual environment in .venv/
in the project's root directory.
Before submitting a pull request, you should verify that all the tests are passing and that the types are correct.
poetry run pytest -v tests/
poetry run mypy --strict cwms/
In order for a pull request to be accepted, python code must be formatted using black and isort. YAML files should also be formatted using either Prettier or the provided pre-commit hook. Developer are encouraged to integrate these tools into their workflow. Pre-commit hooks can be installed to automatically validate any code changes, and reformat if necessary.
poetry run pre-commit install
It is also possible to run the pre-commit hooks without committing if you simply want to format the code.
# Format staged files without committing
poetry run pre-commit run
# Format all source files
poetry run pre-commit run --all-files