Skip to main content

A Python library template with modern tooling and dual publishing support

Project description

nv-pylib-template

Version Release PyPI

nv-pylib-template is a Python library template with modern tooling, automated versioning, and dual publishing to PyPI and GCP Artifact Registry. Built with uv for fast dependency management and includes ruff, mypy, and pytest for code quality.

Features

Here's what this template gives you off the bat:

  • Modern Python tooling: uv for fast dependency management, ruff for linting/formatting, mypy for type checking, pytest for testing
  • Dual publishing: Automatic publishing to both PyPI and GCP Artifact Registry
  • Type safety: Strict mypy configuration with comprehensive type hints
  • Code quality: Pre-configured ruff linter with sensible defaults
  • Testing: pytest with coverage reporting and parametrized test examples
  • Command interface: Self-documenting just recipes for all development tasks
  • Environment management: Auto-load environment variables with direnv
  • CI/CD: GitHub Actions for testing on PRs and automatic releases on main
  • Semantic versioning: Automated version bumping with conventional commits
  • Cross-platform: Works on macOS, Linux, Windows (WSL), and Dev Containers

Requirements

  • bash 3.2+
  • Python 3.12+
  • uv (Python package manager)
  • just (command runner)
  • direnv (environment management)

Run just setup to install all required dependencies automatically.

Optional: just setup --dev for additional development tools (Docker, Claude CLI, etc.).

Quick Start

Scaffold a new project:

# Option 1: Nedavellir CLI (automated)
nv create your-project-name --platform nv-lib-template

# Option 2: GitHub template + scaffold script
# Click "Use this template" on GitHub, then:
git clone <your-new-repo>
cd <your-new-repo>
bash scripts/scaffold.sh --project your-project-name

Install dependencies and start developing:

just setup              # Install Python, uv, and all dependencies
just install            # Install project dependencies with uv
just test               # Run tests with coverage
just lint               # Run linter
just format             # Format code
just type-check         # Run type checker
just build              # Build Python package

Development workflow:

# Make changes to your code
just format             # Format code with ruff
just lint               # Check code with ruff
just type-check         # Verify types with mypy
just test               # Run tests with pytest

# Build and publish
just build              # Creates wheel and sdist in dist/
just publish            # Publishes to PyPI and/or GCP Artifact Registry

Publishing setup (add to GitHub secrets):

# Required for PyPI publishing
PYPI_TOKEN              # Get from https://pypi.org/manage/account/token/

# Optional for GCP Artifact Registry
GCP_SA_KEY              # GCP service account JSON key
GCP_REGISTRY_PROJECT_ID # GCP project ID
GCP_REGISTRY_REGION     # GCP region (e.g., us-east1)
GCP_REGISTRY_NAME       # Artifact Registry name

Commit using conventional commits (feat:, fix:, docs:). Push to main and CI/CD will automatically version and publish your package.

Documentation

To learn more about using this template, read the docs:

TODO

  • Pre-release publishing
  • Template docs improvements

References

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

nv_pylib_template-0.0.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.

nv_pylib_template-0.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file nv_pylib_template-0.0.1.tar.gz.

File metadata

  • Download URL: nv_pylib_template-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for nv_pylib_template-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6215aad12bffd237bb988aa3b7a03b99674620a1bd1c5d87107cb777b4cbd609
MD5 ea3af525e2b5b3ca3b4faaddbaeb2dfc
BLAKE2b-256 46833f0fab34fb21bfa319a696d8bb536c94b33a200a014206295d46226a53ea

See more details on using hashes here.

File details

Details for the file nv_pylib_template-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nv_pylib_template-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b027f407a6469e99db0619544bf7b781d4b89c0db025b4a462afa9712ca22786
MD5 8a0a8fbaa34c7418eab9260b5124d8ef
BLAKE2b-256 5a04b76f5d5f63b6ee957b50ccc050a7d8ed965ab986e7751b97013bd3f8cfe9

See more details on using hashes here.

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