Contributing

Dev Environment

Tools

Description

pip-tools

Used to generate requirements.txt

pytest

Used to run tests

pytest-cove

Used to generate test coverage reports

JSON-log-formatter

Used for JSON logging

mypy

Used for type checking

black

Used for code formatting

tox

Used for testing in multiple python versions

Optional Tools

Tools

Description

Docker

Used to run the dev environment in a container

Building enviornment

Python virtual environment

  1. Clone the repo

git clone https://github.com/TheSchipper/hcp-vault-secrets-client.git
  1. Create a python virtual environment

python3 -m venv venv
  1. Activate the virtual environment

source venv/bin/activate
  1. Generate the requirements file

pip-compile --output-file=requirements-dev.txt requirements-dev.in
  1. Install the requirements

pip install -r requirements-dev.txt

Using docker

  1. Clone the repo

git clone https://github.com/TheSchipper/hcp-vault-secrets-client.git
  1. Build the docker image

docker build . -t hcp
  1. Run the docker image

docker run -ti --rm hcp

Testing

  1. Run tox

tox

Compiling Requirements

Requirements.in

  1. Update the requirements.in file

pip-compile --extra=dev --generate-hashes --output-file=requirements-dev.in --strip-extras pyproject.toml

Requirements-dev.in

  1. Update the requirements-dev.in file

pip-compile --extra=dev --generate-hashes --output-file=requirements.in --strip-extras pyproject.toml

Updating Package Version

  1. Update the version in pyproject.toml

  2. Update the version in docs/source/conf.py

  3. Update the version in sonar-project.properties

Pre-commit Hooks

<Add info>

Creating a Pull Request

  • Add description about opening a PR. Add a template.

Opening an Issue

  • Add description about opening an issue. Add a template.

Workflow Actions

Add description about workflow actions. * CD * CI * Linter * pages * Sonarcloud * Sonarcloud_pr