This document describes how to publish the djhtmx package to PyPI.
- Ensure you have PyPI and TestPyPI accounts
- Configure PyPI credentials using UV's built-in authentication:
# Set PyPI token export UV_PUBLISH_TOKEN="your-pypi-token" # Or configure interactively uv publish --help # Shows authentication options
Update the version in src/djhtmx/__init__.py:
__version__ = "1.0.0" # Update to your target versionmake buildThis will:
- Clean the
dist/directory - Build both source distribution (.tar.gz) and wheel (.whl)
make publish-testThis publishes to TestPyPI for testing before the official release.
make publishThis publishes the package to the official PyPI repository.
If you prefer to run commands manually:
# Build
uv build
# Upload to TestPyPI
uv publish --index-url https://test.pypi.org/simple/
# Upload to PyPI
uv publishUV supports several authentication methods:
-
Environment Variable (recommended):
export UV_PUBLISH_TOKEN="your-pypi-token"
-
Interactive prompt: UV will prompt for credentials if not configured
-
Keyring integration: UV can use system keyring for credential storage
- The current setup uses hatchling as the build backend
- Version is automatically extracted from
src/djhtmx/__init__.py - License, README, and other metadata are configured in
pyproject.toml - Static files (templates, JS) are included via MANIFEST.in
- No need for twine - UV handles publishing directly