Skip to main content

Just a demo of the uv package manager for Python.

Project description

uv-demo PyPI package

PyPI - Version PyPI - Python Version Pepy Total Downloads Code Quality Check

A demo and template for a modern Python package managed by uv. Very useless as a package.

Use this as a template for new projects, or as a reference for how to set up a Python project with the following:

  • uv as the Python package manager.
  • pre-commit hooks for code formatting, linting, and quality checks.
  • GitHub Actions for testing and publishing.
  • Multiple Python versions tested with uv -p ${python-version} run pytest [...].
  • gh-act for running GitHub Actions locally.
  • Justfile with common recipes.
  • Documentation with pdoc + GitHub Pages.
  • Deptry to highlight missing and unused dependencies.

System Dependencies

  • uv
    • curl -LsSf https://astral.sh/uv/install.sh | sh
  • just
    • sudo apt install just
    • sudo pacman -S just
    • More installation methods.
  • For running GitHub Actions locally
    • Docker
    • gh (GitHub CLI)
      • sudo pacman -S github-cli
      • Others
    • gh-act
      • gh extension install nektos/gh-act

Quick start

This will install all dependencies (uv sync) and run the entrypoint script:

uv run uv-demo

just Recipes

# just --list
Available recipes:
    all               # Installs dependencies and runs tests
    build             # Build the package and run tests
    clean             # Clean up generated files
    deptry            # Run deptry to check for unused and missing dependencies
    docs              # Generate and serve documentation
    docs-gen          # Generate documentation using pdoc
    docs-serve        # Serve the docs with a simple HTTP server
    gact              # Run the GitHub Actions workflow for all branches
    gact-pull-request # Run the GitHub Actions workflow for pull requests [alias: gact-pr]
    gact-release      # Run the GitHub Actions workflow for release
    install           # Install pre-commit hooks and development project dependencies with uv
    pre-commit        # Run pre-commit hooks on all files [alias: check]
    publish           # Build and publish the package to PyPI
    serve-coverage    # Serve the coverage report with a simple HTTP server
    test              # Simple execution of tests with coverage
    test-all          # Run static checker and tests for all compatible python versions
    test-verbose      # Run tests with coverage and increased output
    upgrade           # Upgrades all project and pre-commit dependencies respecting pyproject.toml constraints [alias: update]

Integration with GitHub Actions

See the Upload Python Package workflow file for this package.

Running actions locally

You can use act to run GitHub Actions locally. Use cases:

  1. While writing a workflow, to test the workflow locally before pushing to the repository.
  2. Run the publishing workflow without setting secrets on GitHub.
  3. Before opening a pull request, to check the workflow will pass.

Copy the example secrets file:

cp "config/secrets.env.example" "config/secrets.env"

Then edit the new file to add your secrets.

After that, run just gact to run the GitHub Actions workflow locally.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_demo-0.3.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uv_demo-0.3.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file uv_demo-0.3.1.tar.gz.

File metadata

  • Download URL: uv_demo-0.3.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uv_demo-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9bced2173adca97dc358a9c93b446a4d6d94116dbb502b508cd31c9c41061c87
MD5 0e614fbab7e27ad1ae782c730dae085a
BLAKE2b-256 4317dc7ee2370b03f232357a5277cc8bbbb52267bf4bd96214f2fa70e8d660c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_demo-0.3.1.tar.gz:

Publisher: python-publish.yaml on lucaspar/uv-demo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uv_demo-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: uv_demo-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uv_demo-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8bdb72803ee903b563e94a52b3187eafd52d9b39eacc4fa23f74ed50a6ac5b0a
MD5 9fe9ca533effb84cf38aa24c0836af10
BLAKE2b-256 3a1ba1d6ab6fd1e6f2fe9432fa698be0eb2ff913854d3b2a9a0c8e18a011fb35

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_demo-0.3.1-py3-none-any.whl:

Publisher: python-publish.yaml on lucaspar/uv-demo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page