Thank you for your interest in contributing! This guide will help you set up your development environment and run the test suite.
We recommend using a virtual environment to manage dependencies.
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 buildThe test suite requires a valid API Key to verify integration with the live API.
- 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"- Run Pytest:
pytestWe use flake8 to ensure code quality. Please check your code before submitting a PR.
flake8 . --count --select=E9,F63,F7,F82 --show-source --statisticsTo build the distribution archives (source and wheel) for PyPI:
python -m buildThe artifacts will be generated in the dist/ directory.
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.
Use this to test new features without affecting stable users on PyPI.
- Ensure your changes are merged into
main. - Switch to
mainlocally and pull the latest:
git switch main
git pull origin main- 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.1The CI will automatically publish to PyPI and create a GitHub prerelease.
- Ensure the
mainbranch is ready for production. - Switch to
mainlocally and pull the latest:
git switch main
git pull origin main- 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.0The CI will build the distribution archives, publish to PyPI, and create a stable GitHub Release with generated release notes.
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