This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Python package template project (hello_world) that serves as a standard template for creating new Python packages. The project follows a simple structure for a basic Python package with versioning, testing, linting, and Github CI.
This project uses tools:
- bump2version to synchronize version across different files
- tox to test across different python versions
- pyproject.toml for package information
- unittesting for tests
python3 -m hello_world# Run all tests using unittest
python3 -m unittest discover tests
# Testing using tox
tox# Create virtual environment and install dev dependencies
python3 -m venv venv && source venv/bin/activate && pip install -e .[dev]
# Run flake8 linter
python3 -m flake8 .# Build wheel package
python3 -m build --wheel# Create virtual environment and install dev dependencies
python3 -m venv venv && source venv/bin/activate && pip install -e .[dev]
# Bump version automatically (creates commit and tag)
bump2version patch # for bug fixes
bump2version minor # for new features
bump2version major # for breaking changes
python3 -m build --wheel
# git tags in semver format are considered package releases# The release publishing is automated via GitHub Actions:
# 1. Make a local release with a new version
# 2. Push the changes with 'git push'
# 3. GitHub Actions automatically:
# - Builds wheel and source distributions
# - Creates GitHub release
# - Attaches build artifacts
# - Generates release noteshello_world/- Main package directory__init__.py- Package initialization, exportssay_hellofunctionhello.py- Core module withsay_hello()function__main__.py- Module entry point forpython -mexecution
tests/- Unit tests using Python's unittest frameworkpyproject.toml- Modern package configuration and dependencies.flake8- Flake8 linting configuration (max line length: 120, complexity: 14)tox.ini- Tox configuration for testing across Python versions.github/workflows/- CI/CD workflows for testing, linting, releasing
- Python Version: Requires Python 3.8+
- Flake8 Settings: Max line length 120, max complexity 14, double quotes preferred
- Test Framework: Standard Python unittest
- CI/CD: GitHub Actions for automated testing, linting and release publishing on main and dev-** branches
Follow the project structure to place new code, tests, rules, documentation.
After making changes to the code you should run tests and run linter. Then check for errors and fix issues until your task does not produce errors.