A minimal, production-oriented starting point for desktop applications built with wxPython and managed with uv. The project uses a standard src layout, an installable package under src/wx_python_project_template, and a small demo window (menus, status bar, and a simple interactive panel).
- Python 3.10 or newer
- uv installed on your system
On Windows, wxPython ships wheels for common architectures; use a supported Python build (64-bit recommended) for the best experience.
Clone or copy this repository, then from the project root:
uv syncThat creates a virtual environment (.venv), installs dependencies from the lockfile, and installs this project in editable mode.
Any of the following work:
uv run main.pyuv run python -m wx_python_project_templateuv run wx-python-appThe last command uses the console script defined in pyproject.toml.
.
├── main.py # Optional root entrypoint (calls the packaged app)
├── pyproject.toml # Project metadata, dependencies, build, scripts
├── uv.lock # Locked dependency versions (commit this for reproducible installs)
└── src/
└── wx_python_project_template/
├── __init__.py # Package exports and version
├── __main__.py # Enables: python -m wx_python_project_template
├── main.py # wx.App bootstrap and event loop
└── main_window.py # Main frame and UI
| Task | Command |
|---|---|
| Install dependencies and sync the environment | uv sync |
| Add a dependency | uv add <package> |
| Add a dev-only dependency | uv add --dev <package> |
| Run the app with the project environment | uv run … (see above) |
| Build wheel and sdist | uv build |
After changing dependencies, uv.lock is updated automatically when you run uv add or uv lock; commit the lockfile so others get the same resolved versions.
- Rename the package directory under
src/and the import namewx_python_project_templateto match your product (updatepyproject.toml[tool.hatch.build.targets.wheel]packagesand[project.scripts]accordingly). - Bump the version in
pyproject.tomland inwx_python_project_template/__init__.pyif you keep a__version__string there. - Replace the demo UI in
main_window.pywith your real screens and dialogs.