harbor run -t openthoughts/tasktrove-exp-flat25-stackoverflow-v2-5k-stackoverflow-4664harbor download openthoughts/tasktrove-exp-flat25-stackoverflow-v2-5k-stackoverflow-4664Title: How to implement a minimal Python package example_python_package_mate with two simple functions and pytest importability
Body: I'm building a tiny Python package and want to keep it completely self-contained (no external dependencies) while ensuring it’s importable and easily testable with pytest. The package should be named example_python_package_mate and expose two simple functions:
Optional but encouraged: include basic type hints and docstrings:
Requirements to satisfy:
Project layout (example)
Minimal working code (without type hints)
# example_python_package_mate/__init__.py
def multi(a, b):
return a * b
def my_name(name):
return name
Optional with type hints and docstrings
# example_python_package_mate/__init__.py
from __future__ import annotations
def multi(a: float | int, b: float | int) -> float | int:
"""Return the product of a and b."""
return a * b
def my_name(name: str) -> str:
"""Return the input string unchanged (identity function)."""
return name
Example tests (demonstration)
# tests/test_functions.py
from example_python_package_mate import multi, my_name
def test_multi_basic():
assert multi(3, 3) == 9
assert multi(100, 2) == 200
def test_my_name_identity():
s = "Mate"
assert my_name(s) == s
Usage
Question What is the simplest, cleanest way to structure this package so that it remains self-contained, importable via from example_python_package_mate import multi, my_name, and works reliably with pytest tests as described? If there are any additional best practices (e.g., packaging tips, all considerations, or type-hint guidance) you’d add for such a tiny utility package, I’d appreciate them.