Thank you for your interest in contributing to QPanda3 Runtime MCP Server!
- Python 3.10 or higher
- Git
- uv (recommended) or pip
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/qpanda3-runtime-mcp-server.git
cd qpanda3-runtime-mcp-server- Install development dependencies:
uv sync --all-extrasWe use the following tools for code quality:
- Ruff for linting and formatting
- mypy for type checking
# Format code
uv run ruff format .
# Lint code
uv run ruff check .
# Type check
uv run mypy src/Install pre-commit hooks:
uv run pre-commit installfeature/your-featurefor new featuresfix/your-fixfor bug fixesdocs/your-docsfor documentation changes
Follow conventional commits:
feat: add new featurefix: resolve bugdocs: update documentationtest: add testsrefactor: improve code structure
| Category | Location | Description |
|---|---|---|
| Unit Tests | tests/ |
Individual function/class tests with mocks |
| E2E Tests | tests/e2e/ |
End-to-end MCP protocol and workflow tests |
| Integration | tests/ |
Tests with external services (requires credentials) |
# Run all tests
uv run pytest
# Run with coverage (target: 80%+)
uv run pytest --cov=src --cov-report=html
# Run specific test file
uv run pytest tests/test_server.py
# Run E2E tests only
uv run pytest tests/e2e/ -v
# Run with markers
uv run pytest -m e2e -v # E2E tests
uv run pytest -m "not e2e" -v # Unit tests only- Place unit tests in the
tests/directory - Place E2E tests in the
tests/e2e/directory - Use pytest fixtures from
conftest.py - Aim for 80%+ test coverage
- Follow TDD: write tests first, then implement
For detailed E2E testing guide, see E2E Testing.
This project uses MkDocs with the Material theme for documentation.
# Install documentation dependencies
uv sync --extra docs
# Build documentation (English + Chinese)
./scripts/build-docs.sh
# Local preview (with language switching)
mkdocs servedocs/ # English documentation (default)
docs/zh/ # Chinese documentation
mkdocs.yml # MkDocs configuration with i18n plugin
- Create the page as a Markdown file in
docs/(English) - Create the corresponding Chinese version in
docs/zh/ - Add it to the
navsection inmkdocs.yml - Add the Chinese nav label in
nav_translations.zhinmkdocs.yml - For untranslated Chinese pages, copy the English version with a "not yet translated" banner:
!!! warning
此页面尚未翻译。[English version](../../page.md).
(English content follows)- Use Markdown (
.md) for all documentation - API reference is auto-generated from docstrings using mkdocstrings
- Include code examples where helpful
- Use MkDocs Material admonitions for notes and warnings
- Create a feature branch from
main - Make your changes
- Add tests for new functionality
- Update documentation
- Run all tests and linting
- Submit a pull request
- Code follows project style guidelines
- All tests pass
- New code has appropriate test coverage
- Documentation is updated
- Commit messages follow conventions
Please be respectful and inclusive in all interactions.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.