Minimal Python project using Poetry for dependency and virtual environment management.
[[TOC]]
| Term | Description |
|---|---|
| Python | 3.10+ |
| Poetry | pipx install poetry (recommended) |
- Open the Command Palette (
Ctrl+Shift+P) - Type Python: Select Interpreter
- Choose the Poetry virtual environment (e.g.,
.venvor the one containing your project name)
If the virtual environment doesn't appear, run
poetry installfirst, then reload VS Code.
pytest is included as a dev dependency. Install it via Poetry:
poetry installTo verify pytest is available:
poetry run pytest --versionpoetry installTo also install build dependencies (PyInstaller):
poetry install --with buildUsing the script entry point:
poetry run hello-pythonUsing the module directly:
poetry run python -m hello_pythonpoetry run pytest
poetry run pytest --cov=hello_python --cov-report=term-missingFormat (applies changes):
poetry run python -m hello_python.codestyleStyle check only (no changes):
poetry run python -m hello_python.codestyle checkUsing the Python build class (cross-platform):
poetry run python -m hello_python.buildOutput: dist/windows/hello-python-windows.exe (Windows) or dist/linux/hello-python-linux (Linux)
src/hello_python/
├── __init__.py # Package exports
├── __main__.py # python -m entry point
├── main.py # Core logic and app entry
├── window.py # UI components (HelloWindow)
├── build.py # PyInstaller build class
└── codestyle.py # Ruff formatting/linting class
tests/
├── conftest.py # Shared test fixtures
├── test_main.py # Unit tests for main + window
├── test_build.py # Build configuration tests
├── test_build_class.py # BuildExecutable class tests
└── test_codestyle.py # CodeStyle class tests
docs/ # Documentation
Install and activate:
poetry run pre-commit installRun manually:
poetry run pre-commit run --all-files- CI:
.github/workflows/ci.yml— lint, test, build on push/PR - CD:
.github/workflows/cd.yml— release candidate on main after CI passes
See docs/CICD-validation.md for full details.