Skip to content

Local Repo Setup

imda-tzx edited this page Jul 17, 2025 · 2 revisions

image

Git Clone

  1. Do a git clone:
git clone git@github.com:aiverify-foundation/moonshot-cicd.git
  1. Change working directory:
cd moonshot-cicd
  1. Create a virtual environment before installing the requirements:
python -m venv my_venv

(Optional, but good to have as this will ensure that Python packages on your host will not be affected)

  1. Activate the virtual environment:
source my_venv/bin/activate
  1. Install all dependencies using Poetry:
poetry install

This will install all dependencies in pyproject.toml, including all the packages that you will need as a developer. You should now have Moonshot and Process Checks set up and ready to go!

Pre-Commit Checks

We have put in place pre-commit hooks to ensure that the code pushed by developers is of a certain quality. The pre-commit hooks are specified in the .pre-commit-config.yaml file in the root directory. Currently, the pre-commit hooks are:

  1. isort: isort helps to sort Python imports according to the specified profile, which in this case is black. It helps maintain a consistent import order in your Python files.
  2. black: black is a Python code formatter. It automatically formats Python code to adhere to a consistent style.
  3. flake8: flake8 is a linting tool for Python. It checks the code for style guide enforcement, programming errors, and other issues.
  4. gitleaks: gitleaks is a tool to detect hardcoded secrets like passwords, API keys, and tokens in your codebase.

Pre-commit checks will be run when a commit is attempted. If any of the pre-commit checks fail, the commit will fail, and developers are expected to look at the cause and rectify the issues before attempting another commit.

Updating Requirements

Developers may use additional libraries when adding new features. To ensure that the list of dependencies is kept up to date, developers should make a conscious effort to update the list of dependencies. To update the dependencies:

  • Add the new library to the list of dependencies:
poetry add <the library name>

This will add the library and its version into pyproject.toml.

  • Update the poetry lock file:
poetry lock

You should see a new poetry.lock file generated

  • Remember to commit and push pyproject.toml and poetry.lock files

Clone this wiki locally