Skip to content

Latest commit

 

History

History
116 lines (80 loc) · 2.71 KB

CONTRIBUTING.md

File metadata and controls

116 lines (80 loc) · 2.71 KB

Contributing to vitallens-python

Thank you for your interest in contributing! This guide will help you set up your development environment and run the test suite.

Development setup

We recommend using a virtual environment to manage dependencies.

Clone and install

Clone the repository and install the package in editable mode with development dependencies.

# Clone the repo
git clone https://github.com/Rouast-Labs/vitallens-python.git
cd vitallens-python

# Create a virtual environment
python -m venv venv
source venv/bin/activate

# Install in editable mode
# This allows you to modify source code and see changes immediately.
pip install -e .

# Install dev tools
pip install flake8 pytest build

Running tests

The test suite requires a valid API Key to verify integration with the live API.

  1. Set the Environment Variable:

You must set VITALLENS_DEV_API_KEY before running tests.

# Mac/Linux
export VITALLENS_DEV_API_KEY="your_api_key_here"

# Windows (PowerShell)
$env:VITALLENS_DEV_API_KEY="your_api_key_here"
  1. Run Pytest:
pytest

Linting

We use flake8 to ensure code quality. Please check your code before submitting a PR.

flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

Building the package

To build the distribution archives (source and wheel) for PyPI:

python -m build

The artifacts will be generated in the dist/ directory.

Releases

Releases are automated via GitHub Actions and triggered by pushing git tags. The project uses setuptools_scm, so the version is derived directly from the tag name.

Prerelease (Beta)

Use this to test new features without affecting stable users on PyPI.

  1. Ensure your changes are merged into main.
  2. Switch to main locally and pull the latest:
git switch main
git pull origin main
  1. Create and push a beta tag (e.g., v1.2.0-beta.1):
git tag -a v1.2.0-beta.1 -m "v1.2.0-beta.1"
git push origin v1.2.0-beta.1

The CI will automatically publish to PyPI and create a GitHub prerelease.

Production Release

  1. Ensure the main branch is ready for production.
  2. Switch to main locally and pull the latest:
git switch main
git pull origin main
  1. Create and push a production tag (must start with v):
git tag -a v1.2.0 -m "v1.2.0"
git push origin v1.2.0

The CI will build the distribution archives, publish to PyPI, and create a stable GitHub Release with generated release notes.

Syncing back to Dev

After any release, ensure the tags are available in your development branch to keep setuptools_scm versions in sync:

git switch dev
git merge main
git push origin dev