Thank you for your interest in contributing to CE Library Wizard! This guide will help you get started.
- Python 3.12 or higher
- Git
- Make
- GitHub CLI (optional but recommended)
-
Fork and clone the repository
gh repo fork compiler-explorer/ce-lib-wizard --clone cd ce-lib-wizard -
Install dependencies
./run.sh # This will set up Poetry and install dependencies -
Verify installation
./run.sh --help
We use Black and Ruff for code formatting and linting:
# Format code automatically
./run.sh --format
# Check formatting without changes
./run.sh --format --checkImportant: Always run ./run.sh --format before committing changes.
- Follow PEP 8 with Black's formatting
- Use type hints for all function signatures
- Keep functions small and focused
- Write descriptive variable names
- Place all imports at the top of files
- Group imports: standard library, third-party, local
- Avoid circular imports
Example:
import logging
import tempfile
from pathlib import Path
import click
from pydantic import BaseModel
from core.models import LibraryConfig
from core.git_operations import GitManager- Pure business logic only
- No direct I/O operations
- No CLI-specific code
- All functions should be testable in isolation
- User interaction code
- Argument parsing
- Output formatting
- Orchestration of core functions
git checkout -b feature/your-feature-nameFollow the existing patterns:
- One module per file
- Clear function names
- Comprehensive error handling
Test manually with different scenarios:
# Test with debug mode
./run.sh --debug --verify --lang=rust --lib=test-crate --ver=0.1.0
# Test error handling
./run.sh --lang=c++ --lib=invalid-url --ver=1.0.0- Update README.md if adding new features
- Update relevant docs/ files
- Add docstrings to new functions
Write clear commit messages:
git add .
git commit -m "Add support for X language libraries
- Implement XHandler class
- Add ce_install integration
- Update CLI to support --lang=x"To add support for a new language:
-
Create a handler class in
core/{language}_handler.py:class NewLanguageHandler: def __init__(self, infra_path: Path, main_path: Path, debug: bool = False): self.infra_path = infra_path self.main_path = main_path self.debug = debug def add_library(self, config: LibraryConfig) -> str | None: # Implementation pass
-
Update the Language enum in
core/models.py:class Language(str, Enum): # ... existing languages ... NEW_LANGUAGE = "New Language"
-
Add CLI support in
cli/main.py:- Update the
--langchoices - Add a
process_{language}_libraryfunction - Update the main dispatch logic
- Update the
-
Update documentation:
- Add to supported languages in README.md
- Document any special requirements
cd /tmp/ce-lib-wizard-*/infra
poetry run ce_install --helpexport GIT_TRACE=1
./run.sh --debug ..../run.sh --oauth --debug
# Check that browser opens and callback works- Code is formatted with
./run.sh --format - Changes work with
--verifyflag - Error cases are handled gracefully
- Documentation is updated
- Commit messages are clear
- PR description explains the changes
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
## Testing
How you tested the changes
## Additional Notes
Any additional contextWhen reporting issues, please include:
- The exact command you ran
- The full error message
- Debug output (
--debugflag) - Your OS and Python version
- Whether you're authenticated with GitHub
- Open an issue for bugs or feature requests
- Use discussions for questions
- Check existing issues before creating new ones
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Follow the project's goals
The ce_install tool is the heart of library management. Familiarize yourself with:
# See available commands
cd infra && poetry run ce_install --help
# Test commands manually
poetry run ce_install list# Add debug prints in github_auth.py
logger.debug(f"Token type: {type(token)}")
logger.debug(f"Token length: {len(token) if token else 0}")- Test with invalid GitHub URLs
- Test with private repositories
- Test without authentication
- Test with existing library versions
Thank you for contributing to CE Library Wizard!