Thank you for your interest in contributing to Agentics! This document provides guidelines and instructions for contributing to the project.
uvpackage manager (install here)- Python 3.11 or higher (but less than 3.13)
- If not available, uv will download it automatically.
- Git
-
Clone the repository:
git clone https://github.com/IBM/agentics.git cd agentics -
Install dependencies using
uv:uv sync --all-groups --all-extras
This installs all dependencies including development tools needed for testing and code quality checks.
-
Verify your setup:
uv run pytest
Also, to ensure the version is correctly computed from Git tags try running:
uvx --with uv-dynamic-versioning hatchling version
We use pre-commit hooks to ensure code quality and consistency. These hooks automatically run checks before each commit.
-
Install pre-commit:
uv tool install pre-commit
-
Set up the git hooks:
pre-commit install
Our pre-commit configuration includes the following checks:
- codespell: Checks for common spelling mistakes in Python, RST, and Markdown files
- trailing-whitespace: Removes trailing whitespace
- check-ast: Validates Python syntax
- end-of-file-fixer: Ensures files end with a newline
- debug-statements: Detects leftover debugging code
- isort: Sorts and organizes Python imports
- black: Formats Python code to consistent style
- nbstripout: Removes outputs from Jupyter notebooks
If you want to run pre-commit checks manually without committing:
# Run all hooks on all files
pre-commit run --all-files
# Run a specific hook
pre-commit run codespell --all-files
pre-commit run black --all-filesIf you absolutely need to skip pre-commit checks for a commit:
git commit --no-verifyHowever, this is not recommended as it may cause CI/CD pipeline failures.
We use pytest for testing. All contributions should include tests for new functionality.
uv run pytest tests/uv run pytest tests/ -v# Run a specific test file
pytest tests/test_specific_module.py
# Run a specific test function
pytest tests/test_module.py::test_function_name
# Run tests matching a pattern (can be a file, function or package)
pytest tests/ -k "pattern"pytest tests/ -n autoThis uses all available CPU cores to run tests faster.
Pytest uses fixtures to initialize state of tests or provide some dependencies tests/conftest.py.
You can see the list of available fixtures with uv run pytest --fixtures.
pytest tests/ --html=report.html --self-contained-htmlThe test report will be saved as report.html in the project root for later analysis or sharing.
Code coverage measures the percentage of your codebase that is exercised by tests. It's an important metric that helps you understand how thoroughly your how much code is not exercised by your tests.
pytest tests/ --cov=src/agentics --cov-report=htmlThis command generates a detailed coverage report in HTML format in the htmlcov/ directory. You can open htmlcov/index.html in your browser to see which lines are covered and which are not.
This project follows specific code style guidelines:
- Formatting: Black (automatic via pre-commit)
- Import ordering: isort (automatic via pre-commit)
- Spell checking: codespell (automatic via pre-commit)
Code style checks are enforced automatically by pre-commit hooks, so ensure you've installed them properly.
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes and ensure they pass tests:
pytest tests/ -v
-
Run pre-commit checks:
pre-commit run --all-files
-
Commit your changes with a descriptive message:
git commit -m "Add description of changes" -
Push to your fork and create a Pull Request
-
When your PR is merged to
main, one of the maintainers will include a release keyword in the merge commit:- Merge the PR and include
[release major],[release minor], or[release patch]in the commit message - This ensures tests run and the package is published to PyPI with a new version
- If the change doesn't include the change a new release can be created from Github to create a new version in PyPI.
- Merge the PR and include
- Create a new release in Github Make sure the release has the format v{MAJOR}.{MINOR}.{PATCH} so the github actions picks this change and publishes to PyPI.
This project uses Semantic Versioning (SemVer):
- MAJOR (X.0.0): Breaking changes
- MINOR (0.X.0): New features (backward compatible)
- PATCH (0.0.X): Bug fixes (backward compatible)
Technical Details:
- The version is dynamically determined from git tags using
uv-dynamic-versioning - Tags follow the format
v{major}.{minor}.{patch}(e.g.,v1.0.0) - All automated releases pass the test suite before being published
- Releases are built as Python wheels and published in PyPI automatically.
- Provide a clear description of what your PR does
- Include tests for new functionality
- Ensure all tests pass locally before submitting
- Keep commits focused and logical
- Update documentation if needed
If you have questions or need help, please open an issue on GitHub or contact the maintainers.
Thank you for contributing to Agentics!