Thank you for considering contributing to deepfabric!
When contributing, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Note that we have a Code of Conduct, please follow it in all your interactions with the project.
- Python 3.10 or later
Fork this repository and create your branch from main.
git clone https://github.com/<YOUR-USERNAME>/deepfabric
cd deepfabricWe strongly recommend using an isolated virtual environment.
python -m venv .venv
source .venv/bin/activateOption B: Using uv (recommended)
DeepFabric supports running all development tasks via uv, which provides fast and reproducible environments without manual virtual environment activation.
DeepFabric uses PEP 621 (pyproject.toml) with Hatch as the build backend.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
pip install -U pip
pip install -e '.[dev]'Option B: Using `uv` (recommended)
uv sync --extra devThis installs:
- test dependencies (
pytest,pytest-cov, etc.) - linting and security tools (
ruff,bandit)
Ensure all tests pass before submitting changes.
At a minimum, please run the unit test suite. Additional integration and security checks are recommended when relevant.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
pytest tests/unit/Option B: Using `uv` (recommended)
uv run pytest tests/unit/Integration tests cover interactions with external systems (e.g. LLM providers). They may require additional environment variables or credentials. Please refer to the Makefile for available integration test targets.
We recommend running security checks before submitting larger or user-facing changes.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
bandit -r deepfabric/Option B: Using `uv` (recommended)
uv run bandit -r deepfabric/Ensure the codebase is properly linted and formatted before submitting changes.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
ruff format deepfabric/ tests/
ruff check . --exclude notebooks/Option B: Using `uv` (recommended)
uv run ruff format deepfabric/ tests/
uv run ruff check . --exclude notebooks/We strongly recommend following the Conventional Commits specification when committing:
- feat: new features
- fix: bug fixes
- docs: documentation-only changes
- refactor: code refactoring
- test: adding or updating tests
- chore: tooling and maintenance
Example:
git commit -m "feat: add dataset validation pipeline"DeepFabric uses MkDocs with the Material theme for documentation.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
pip install -U pip
pip install -e '.[docs]'Option B: Using `uv` (recommended)
uv sync --extra docsThis installs:
- MkDocs and the Material theme (
mkdocs-material) - Python API documentation support via
mkdocstrings[python]
- User-facing documentation lives in the docs directory.
- API documentation is generated from Python docstrings via
mkdocstrings. - Please follow the existing style and structure when adding new pages.
DeepFabric enforces Google-style docstrings, consistent with the ruff configuration:
[tool.ruff.lint.pydocstyle]
convention = "google"Example:
def load_dataset(path: str) -> Dataset:
"""Load a dataset from disk.
Args:
path: Path to the dataset directory.
Returns:
The loaded dataset.
"""
...Ensure you can preview the documentation site locally before submitting changes.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
mkdocs serveOption B: Using `uv` (recommended)
uv run mkdocs serveEnsure you generate the static documentation site before publishing or submitting changes.
Option A: Standard Python (`venv` + `pip`)
# Make sure your virtual environment is activated.
mkdocs buildOption B: Using `uv` (recommended)
uv run mkdocs build