GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gdamjan/uv-getting-started: An example "getting started" python project based on `uv`

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
scripts
scripts
 
 
src/demo
src/demo
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

An example getting started python project based on uv

uv - An extremely fast Python package and project manager, written in Rust

  • uses pyproject.toml (and uv.lock)
  • follows the src/ directory layout
  • example production optimized Dockerfile
  • github actions ci
  • depends on: starlette, httpx, granian and polars, just as an example

Quickstart:

uv sync
uv run granian --reload --interface asgi demo.web:app

I prefer to initialize projects as packages even for applications, this will setup the project using a src-layout structure, and setup uv_build as a build system:

uv init --package

Running dev tools:

uv run ty check
uv format
uv run ruff check

Build container image:

podman build -t uv-demo .
podman run -it --rm -p 8000:8000 uv-demo

Note

Use Podman or Docker - it's the same, podman is rootless on Linux

Running scripts

These scripts will be executed in the context (venv, python) of the project, good for development helper scripts:

uv run scripts/h.py
uv run scripts/p.py
uv run scripts/example.py 1 2 3 hello world 4 5

PEP 723

uv can also run scripts that have the pep-0723 based metadata, like dependencies. There's no need to setup venvs or dependencies in a pyproject.toml file, uv automagically creats an ad-hoc venv for the script.

See:

  • uv docs: Running scripts - Creating a Python script
  • PEP 723 – Inline script metadata
uv run scripts/pep723.py

About

An example "getting started" python project based on `uv`

Topics

demopython

Resources

Readme
CC0-1.0 license
Activity

Stars

18 stars

Watchers

2 watching

Forks

8 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.