---
description: how to publish the package to PyPI using uv
---
1.  **Build the Package**: Generate the distribution files (sdist and wheel) using `uv`.
    ```bash
    uv build
    ```
    This will create a `dist/` directory containing the build artifacts.

2.  **Upload to PyPI**: Upload the package using `uv`.
    ```bash
    # For TestPyPI (Recommended for first time)
    # You need to set the token variable first or pass it directly
    # $Env:UV_PUBLISH_TOKEN = "pypi-..." 
    uv publish --publish-url https://test.pypi.org/legacy/
    
    # For Real PyPI
    # $Env:UV_PUBLISH_TOKEN = "pypi-..."
    uv publish
    ```
    `uv` will look for the `UV_PUBLISH_TOKEN` environment variable or can be configured via `uv.toml` or global configuration.

3.  **Clean Up**: Remove the build artifacts if needed (optional, `uv` handles rebuilds well).
    ```bash
    # Windows (PowerShell)
    Remove-Item -Recurse -Force dist
    ```
