This repository provides a simple Python project template following my usual workflow: managed with uv and using top-level package imports.
-
Initialize project
uv init
This creates a basic project scaffold with
pyproject.toml. -
Configure
pyproject.tomlEditpyproject.tomlwith the following template:[build-system] requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] name = "python-project-template" version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.11" dependencies = [] [tool.uv] index-url = "http://your-custom-index/simple/" extra-index-url = ["https://pypi.org/simple"] allow-insecure-host = ["your-custom-index"] [tool.setuptools] packages = ["python_project"]
Notes:
[build-system]→ Controls how the package is built, here using setuptools.[project]→ Basic metadata for your package.[tool.uv]→ Configure package sources (change to your mirror or private index).[tool.setuptools].packages→ which Python packages to include.
-
Install in editable (development) mode
uv pip install -e .Makes local changes instantly available.
-
Add dependencies
uv add requests
Installs and records package in
[project.dependencies]. -
Import your package
import python_project.module_name from python_project.subpkg import something
Always use the top-level package name for imports.