Skip to content

Conversation

@Wirasm
Copy link
Owner

@Wirasm Wirasm commented Oct 23, 2025

Summary

This PR adds a simple, well-structured "Hello World" Python script (hello.py) to the root directory. The script demonstrates Python best practices including proper script structure, type annotations, Google-style docstrings, and executable configuration. It follows the project's KISS (Keep It Simple, Stupid) and YAGNI (You Aren't Gonna Need It) principles.

Changes

  • feat: add hello world script with unit tests and pytest markers

Files Modified

  • hello.py - New hello world script in root directory
  • tests/test_hello.py - Comprehensive unit tests
  • tests/__init__.py - Updated to support test discovery
  • pyproject.toml - Updated project configuration
  • PRPs/features/completed/add-hello-script.md - Completed PRP documentation

Implementation Details

Script Features:

  • Proper shebang line (#!/usr/bin/env python3) for Unix/Linux compatibility
  • Main function pattern with if __name__ == "__main__": guard
  • Complete type annotations for strict mypy compliance
  • Google-style docstrings for module and functions
  • Executable via uv run python hello.py

Testing:

  • Three comprehensive unit tests with pytest markers
  • Tests verify stdout output, stderr silence, and import behavior
  • All tests marked with @pytest.mark.unit per project requirements
  • Tests use proper type annotations and Google-style docstrings

Quality Assurance:

  • Passes ruff linting (zero errors)
  • Passes mypy type checking in strict mode (zero errors)
  • Formatted with black (zero changes needed)
  • 100% test coverage

PRP Reference

See: PRPs/features/completed/add-hello-script.md

This implementation fully satisfies all 12 acceptance criteria defined in the PRP, including:

  • Proper script structure with main function pattern
  • Complete type annotations and docstrings
  • All quality checks passing (ruff, mypy, black)
  • Comprehensive unit tests with 100% coverage
  • Adherence to KISS and YAGNI principles

Testing

  • All existing tests pass
  • New tests added (tests/test_hello.py)
  • Manual testing completed
    • uv run python hello.py outputs "Hello, World!"
    • uv run pytest tests/test_hello.py -v -m unit passes (3/3 tests)
    • uv run ruff check hello.py passes
    • uv run mypy hello.py passes
    • uv run black --check hello.py passes

Related Issues

Implements feature request for a basic hello world script to demonstrate Python best practices and provide a quick environment verification tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants