Skip to content

Latest commit

 

History

History
90 lines (57 loc) · 1.66 KB

CONTRIBUTING.md

File metadata and controls

90 lines (57 loc) · 1.66 KB

Contributing to the CodeFlare SDK

Thank you for your interest in contributing to the CodeFlare SDK!

Getting Started

Prerequisites

Setting Up Your Development Environment

  1. Clone the repository:

    git clone https://github.com/project-codeflare/codeflare-sdk.git
    cd codeflare-sdk
  2. Create a Poetry virtual environment:

    poetry shell
  3. Install dependencies:

    poetry install
    • To include test dependencies, run:

      poetry install --with test
    • To include docs dependencies, run:

      poetry install --with docs
    • To include both test and docs dependencies, run:

      poetry install --with test,docs

Development Workflow

Pre-commit

We use pre-commit to ensure consistent code formatting. To enable pre-commit hooks, run:

pre-commit install

Testing

To install CodeFlare SDK in editable mode, run:

pip install -e .

Unit Testing

To run the unit tests, execute:

pytest -v tests/unit_test.py

Local e2e Testing

Code Coverage

  • Run tests with the following command: coverage run -m --source=src pytest tests/unit_test.py
  • To then view a code coverage report w/ missing lines, run coverage report -m

Code Formatting

  • To check file formatting, in top-level dir run black --check .
  • To auto-reformat all files, remove the --check flag
  • To reformat an individual file, run black <filename>