Thanks for contributing to AbstractCore. This guide is written for external contributors and focuses on a fast setup, practical repo conventions, and a smooth PR process.
git clone https://github.com/lpalbou/AbstractCore.git
cd AbstractCore
python -m venv .venv
source .venv/bin/activate # Windows: .venv\\Scripts\\activate
python -m pip install -U pip
# Tooling + tests (recommended baseline for contributors)
pip install -e ".[dev,test]"
pytest -qAbstractCore’s default install is intentionally lightweight. Most features and provider SDKs are behind extras:
pip install -e ".[remote]" # OpenAI + Anthropic SDKs (OpenRouter/Portkey use core httpx)
pip install -e ".[openai]" # OpenAI SDK
pip install -e ".[anthropic]" # Anthropic SDK
pip install -e ".[tools]" # requests/bs4/lxml/ddgs for built-in tools
pip install -e ".[media]" # Pillow + PDF/Office extraction
pip install -e ".[embeddings]" # sentence-transformers + numpy
pip install -e ".[server]" # FastAPI gatewayExtras compose, so a realistic app setup might be pip install -e ".[remote,tools,media,server]".
If you want a “kitchen sink” contributor environment, full-dev is a convenient superset, but it may not install everywhere (for example MLX vs CUDA-only stacks):
pip install -e ".[full-dev]"AbstractCore is designed so:
pip install abstractcorestays small.import abstractcorestays import-safe.
When contributing:
- Don’t add heavy libraries to core
dependenciesinpyproject.toml. - Keep optional subsystems behind explicit extras (
[tools],[media],[embeddings],[server], provider SDKs). - Avoid importing optional dependencies on default import paths (for example
abstractcore/__init__.py). Prefer lazy imports and clear install hints likepip install "abstractcore[media]".
These tools are useful, but the full-repo baselines are not currently clean. Treat them as diagnostics unless a maintainer explicitly asks for a full-repo cleanup.
blackis the code formatter. It rewrites layout/spacing; most failures are style drift, not runtime bugs.ruffis the fast linter. Some findings are cosmetic, butF821undefined names, broadexcept, unused imports, and similar findings can point to real bugs.mypyis the static type checker. The repo has a strict target config, but dynamic provider code and optional dependencies still produce known legacy errors.
For normal PRs, format and lint the files you touched when they already have a clean local baseline:
black path/to/changed_file.py
ruff check path/to/changed_file.pyIf a touched file has legacy style/lint debt, avoid unrelated churn and keep the high-signal package check clean:
ruff check --select F821 abstractcoreFull-repo checks are still useful for maintainers tracking cleanup progress:
black --check abstractcore tests
ruff check abstractcore
mypy abstractcoreThis repo has pre-commit hooks for formatting/lint checks. The expensive hooks
are configured for manual use, so run them explicitly when you want them.
One-time setup:
pip install -e ".[dev,test]"
pre-commit installRun on all files:
pre-commit run --all-filespytest -qSome provider-/network-/hardware-dependent tests are intentionally opt-in and may
skip locally. When local LLM services or heavyweight inference tests are enabled,
the suite can take a long time; during development, run the focused test file or
marker first, then a broader pass before release. See
tests/README_VISION_TESTING.md and tests/README_SEED_TESTING.md.
If a change affects user-facing behavior, update the docs entry points:
README.mddocs/README.mddocs/getting-started.mddocs/architecture.mddocs/api.mddocs/faq.mddocs/server.md(if the HTTP gateway is affected)
Keep language clear, user-oriented, and accurate to the code (the code is the source of truth).
- Add or update tests where appropriate.
- Run relevant tests; run
pytest -qwhen feasible. - Run
blackandruff checkon changed files. - Keep
ruff check --select F821 abstractcorepassing. - Update relevant documentation.
- Add a changelog entry when the change is user-visible.
The package version is sourced from abstractcore/utils/version.py.
For a release:
- Bump
abstractcore/utils/version.py. - Add a new section to
CHANGELOG.md. - Verify:
python -c "import abstractcore; print(abstractcore.__version__)"
If you believe you found a security vulnerability, please follow SECURITY.md for responsible disclosure.