E · Ship · intermediate · Week 6–7 · Chapter 11 of 13
Packaging lite — pyproject.toml & entry points
You do not need to publish to PyPI yet. pyproject.toml declares project metadata and dependencies. pip install -e . makes your package importable. Entry points turn modules into CLI commands.
Path progress79%
Step 1 of 4
Minimal pyproject.toml
PEP 621 project table: name, version, dependencies. Build backend can be hatchling or setuptools — keep it minimal.
Example
[project]
name = "py-journey"
version = "0.1.0"
dependencies = ["httpx>=0.27", "pytest>=8.0"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"Do this now
Add pyproject.toml to py-journey with project name, version 0.1.0, dependencies from requirements.txt.
Was this step clear?
Chapter learning outcomes
- pyproject.toml basics
- pip install -e .
- Console scripts entry points
- src layout packaging
Clear these before you leave
Side quest
Shareable tool
Extract retry() helper into installable subpackage. Friend clones repo and runs pip install -e . successfully.