Thank you for your interest in contributing to pyvm. This document provides guidelines for contributing to the project.
- Modifications to
/usr/bin/python3or system Python symlinks - Usage of
update-alternativesto change system defaults - Alterations to system PATH or shell configuration files
- Modifications to conda or virtualenv environments
- Deletion or replacement of existing Python installations
- Changes to system-wide Python settings
- Install Python side-by-side with existing versions only
- Respect the user's system configuration
- Provide clear instructions instead of automatic modifications
- Work well with virtual environments
- Include proper error handling and validation
# Clone the repository
git clone https://github.com/shreyasmene06/pyvm-updater.git
cd pyvm-updater
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"pyvm-updater/
├── src/pyvm_updater/ # Main package
│ ├── __init__.py # Package metadata
│ ├── cli.py # CLI commands (click)
│ ├── config.py # Configuration management
│ ├── constants.py # Global constants
│ ├── history.py # Installation history
│ ├── installers.py # Platform-specific installers
│ ├── logging_config.py # Logging configuration
│ ├── tui.py # Terminal UI (textual)
│ ├── utils.py # Utility functions
│ ├── venv.py # Virtual environment management
│ └── version.py # Version checking
├── tests/ # Test suite
├── docs/ # Documentation
└── pyproject.toml # Package configuration
Run tests before submitting a pull request:
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ -v --cov=pyvm_updater
# Run specific test file
pytest tests/test_utils.py -vThe project uses several tools to maintain code quality:
# Format code with Black
black src/ tests/
# Run Ruff linter
ruff check .
# Run Flake8
flake8 src/ tests/
# Type checking with mypy
mypy src/pyvm_updater --ignore-missing-imports
# Security scan with Bandit
bandit -r src/ --severity-level mediumAll checks must pass before a pull request can be merged.
- Follow PEP 8 guidelines
- Use type hints for function parameters and return values
- Add docstrings to all public functions and classes
- Keep functions focused and single-purpose
- Use meaningful variable and function names
- Maximum line length is 120 characters
Example:
def download_file(url: str, destination: Path, timeout: int = 30) -> bool:
"""
Download a file from a URL to the specified destination.
Args:
url: The URL to download from.
destination: The local path to save the file.
timeout: Request timeout in seconds.
Returns:
True if download succeeded, False otherwise.
"""
# Implementation
pass- Fork the repository and create your branch from
main - Make your changes following the guidelines above
- Add or update tests for your changes
- Ensure all tests pass and code quality checks succeed
- Update documentation if needed
- Commit with clear, descriptive messages using conventional format:
fix: correct version comparison logic feat: add support for Python 3.14 docs: update installation instructions test: add tests for history module - Submit a pull request with:
- Clear description of the changes
- Reason for the changes
- How you tested the changes
- Screenshots if relevant for UI changes
When reporting bugs, include:
- Operating system and version
- Python version (
python3 --version) - pyvm version (
pyvm --version) - Exact command that caused the issue
- Full error message and traceback
- Expected behavior
Before requesting features:
- Ensure it aligns with the tool's purpose (safe Python installation)
- Verify it does not violate safety guidelines
- Describe your use case clearly
- Explain why existing functionality is insufficient
- Features that modify system defaults automatically
- Code requiring root/admin for basic operations
- Platform-specific implementations that break other platforms
- Features that duplicate existing tools (pyenv, conda, etc.)
- Code without proper error handling
- Changes without corresponding tests
- Improved error messages and user guidance
- Better cross-platform compatibility
- Enhanced detection of Python installations
- Documentation improvements
- Bug fixes with test cases
- Performance improvements
- Additional tests for existing functionality
When updating documentation:
- Keep language clear and concise
- Include code examples where appropriate
- Add warnings for potentially dangerous operations
- Update all relevant docs (README, INSTALL, QUICKSTART, etc.)
- Verify all code examples work correctly
If you find a security vulnerability:
- Do not open a public issue
- Email the maintainer directly (see pyproject.toml for contact)
- Describe the vulnerability and its potential impact
- Allow time for a fix before public disclosure
By contributing, you agree that your contributions will be licensed under the MIT License.
If you have questions about contributing, open a discussion on GitHub or reach out to the maintainers.