Development Setup Guide¶
This guide helps you set up your development environment for contributing to Vyte.
Prerequisites¶
- Python 3.11 or higher
- Git
- pip
Initial Setup¶
1. Clone the Repository¶
2. Create Virtual Environment¶
# Using venv
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Or using conda
conda create -n vyte python=3.11
conda activate vyte
3. Install Dependencies¶
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Install additional dev tools
pip install black ruff isort mypy bandit safety pre-commit
4. Install Pre-commit Hooks¶
This will automatically run code quality checks before each commit.
Development Workflow¶
Making Changes¶
- Create a new branch:
-
Make your changes
-
Format your code:
- Run linters:
- Run tests:
- Commit your changes:
Pre-commit hooks will automatically run and may modify files. If files are modified, add them and commit again.
Available Make Commands¶
make help # Show all available commands
make test # Run tests
make test-cov # Run tests with coverage
make format # Format code
make lint # Check code quality
make security # Run security scans
make clean # Clean build artifacts
Code Quality Tools¶
Black - Code Formatting¶
Formats Python code to maintain consistent style:
Ruff - Fast Linter¶
Checks and fixes common Python issues:
isort - Import Sorting¶
Organizes imports:
MyPy - Type Checking¶
Static type checking:
Bandit - Security Linting¶
Finds common security issues:
Pre-commit Hooks¶
Pre-commit hooks run automatically before each commit. You can also run them manually:
# Run all hooks
pre-commit run --all-files
# Run specific hook
pre-commit run black --all-files
pre-commit run ruff --all-files
Skipping Pre-commit (Not Recommended)¶
If you need to commit without running hooks:
Testing¶
Run All Tests¶
Run with Coverage¶
Run Specific Tests¶
# Single test file
pytest tests/test_cli.py
# Single test function
pytest tests/test_cli.py::test_cli_help
# Integration tests only
pytest -m integration
# Skip integration tests
pytest -m "not integration"
View Coverage Report¶
# Generate HTML report
pytest --cov=vyte --cov-report=html
# Open in browser (Linux/Mac)
open htmlcov/index.html
# Windows
start htmlcov/index.html
Configuration Files¶
- pyproject.toml: Project metadata, dependencies, and tool configs
- .pre-commit-config.yaml: Pre-commit hooks configuration
- .editorconfig: Editor settings for consistent coding style
- .pylintrc: Pylint configuration (optional)
- Makefile: Common development commands
Troubleshooting¶
Pre-commit Issues¶
If pre-commit fails:
- Update pre-commit:
- Clean pre-commit cache:
Test Failures¶
- Clear pytest cache:
- Reinstall package:
Import Errors¶
Make sure you installed the package in editable mode:
VS Code Setup (Optional)¶
Create .vscode/settings.json:
{
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.ruffEnabled": true,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
PyCharm Setup (Optional)¶
- Go to Settings → Tools → External Tools
- Add Black, Ruff, etc. as external tools
- Configure File Watchers for automatic formatting
Next Steps¶
- Read CONTRIBUTING.md for contribution guidelines
- Check the Home Page for project documentation
- Browse the documentation for detailed guides
Getting Help¶
- GitHub Issues: https://github.com/PabloDomi/Vyte/issues
- Discussions: https://github.com/PabloDomi/Vyte/discussions
- Email: Domi@usal.es
Happy coding! 🚀