Skip to content

Latest commit

 

History

History
146 lines (115 loc) · 3.19 KB

File metadata and controls

146 lines (115 loc) · 3.19 KB

CONTRIBUTING.md

We welcome contributions to the Python Environment Manager (PEM)!

Development Setup

  1. Clone the repository:

    git clone https://github.com/freddiedfre/python-env-manager.git
    cd python-env-manager
  2. Install the project locally:

    make install
  3. Install development dependencies:

    # For unit testing
    brew install bats-core  # macOS
    sudo apt-get install bats  # Ubuntu/Debian
    
    # For code coverage (optional)
    brew install kcov  # macOS
    sudo apt-get install kcov  # Ubuntu/Debian
  4. Run tests to verify setup:

    make test-all

Commit Message Convention

We follow Conventional Commits:

<type>(<scope>): <description>

[optional body]

[optional footer]

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • chore: Maintenance tasks
  • refactor: Code restructuring
  • test: Adding or updating tests
  • ci: CI/CD changes

Examples

feat(init): add support for custom Python versions
fix(doctor): correct venv detection on macOS
docs(readme): update installation instructions
chore(release): bump version to v1.1.0

Pull Request Process

  1. Fork the repository
  2. Create a branch from main using naming convention:
    • feat/description for features
    • fix/description for bug fixes
    • docs/description for documentation
  3. Make your changes following the coding style
  4. Add tests for new functionality
  5. Run tests: make test-all
  6. Run linting: make lint
  7. Commit with conventional commit messages
  8. Push to your fork
  9. Open a Pull Request with:
    • Clear description of changes
    • Reference to related issues
    • Screenshots for UI changes

Coding Style

Bash Scripts

  • Follow the existing style in the codebase
  • Use snake_case for variables and functions
  • Add comments for complex logic
  • Use shellcheck for linting
# Good
my_function() {
    local param="$1"
    log_info "Processing: $param"
}

# Bad
MyFunction() {
    P=$1
    echo "Processing: $P"
}

Testing Guidelines

  • Write unit tests for new library functions in tests/unit/
  • Write integration tests for new commands in tests/integration/
  • Aim for ≥80% code coverage
  • Use descriptive test names
@test "function_name handles empty input gracefully" {
    run my_function ""
    [[ "$status" -ne 0 ]]
    [[ "$output" =~ "error" ]]
}

PR Labels

Add appropriate labels to your PR for automatic changelog generation:

  • feat / feature - New features
  • fix / bugfix - Bug fixes
  • docs - Documentation updates
  • chore - Maintenance
  • breaking / major - Breaking changes
  • security - Security-related changes

The labels determine version bumping:

  • major / breaking → v2.0.0
  • minor / feat → v1.1.0
  • patch / fix → v1.0.1

Code Review

All submissions require review. We use GitHub pull requests for this purpose.

Reviewers will check for:

  • Code quality and style
  • Test coverage
  • Documentation updates
  • Breaking changes properly communicated
  • Performance impact

Questions?

Open an issue or discussion on GitHub!