Skip to main content

A minimal but complete example of a modern Python package published to PyPI.

Project description

nvidia-ai-endpoints

A minimal but complete example of a modern Python package: src layout, PEP 621 metadata in pyproject.toml, a typed library, a console script, tests, and a GitHub Actions release workflow that publishes to PyPI with Trusted Publishing (no API tokens stored anywhere).

Install

pip install nvidia-ai-endpoints

Use it as a library

from nvidia_ai_endpoints import Greeter, greet

greet("Ada")  # 'Hello, Ada!'
greet("Ada", salutation="Howdy")  # 'Howdy, Ada!'
Greeter(salutation="Hi", punctuation="?").greet("Ada")  # 'Hi, Ada?'

Use it from the shell

sample-greet Ada
sample-greet Ada --salutation Howdy --times 3
sample-greet --version

Develop

python -m venv .venv
.venv\Scripts\activate        # Windows;  source .venv/bin/activate on POSIX
pip install -e ".[dev]"

pytest                        # tests + coverage
ruff check . && ruff format --check .
mypy

Release

  1. Bump __version__ in src/nvidia_ai_endpoints/__init__.py (the single source of truth — pyproject.toml reads it via [tool.hatch.version]).

  2. Update CHANGELOG.md.

  3. Tag and push:

    git tag v0.1.0 && git push origin v0.1.0
    

The release.yml workflow builds the sdist and wheel, uploads them to TestPyPI, then publishes to PyPI. Configure both as Trusted Publishers for this repo first (PyPI → Your projectsPublishing), matching workflow name release.yml and environments testpypi / pypi.

Manual release, if you'd rather not use CI

pip install build twine
python -m build            # -> dist/*.whl and dist/*.tar.gz
twine check dist/*
twine upload dist/*

Layout

nvidia-ai-endpoints/
├── pyproject.toml              # build backend, metadata, tool config
├── README.md                   # rendered as the PyPI project page
├── LICENSE
├── CHANGELOG.md
├── src/nvidia_ai_endpoints/
│   ├── __init__.py             # public API + __version__
│   ├── core.py                 # library logic
│   ├── cli.py                  # console script entry point
│   └── py.typed                # ships inline type hints (PEP 561)
├── tests/
└── .github/workflows/          # ci.yml, release.yml

The src layout is deliberate: tests import the installed package rather than the working directory, so a missing py.typed or an unlisted subpackage fails in CI instead of after release.

License

MIT — see LICENSE.

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

nvidia_ai_endpoints-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

nvidia_ai_endpoints-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file nvidia_ai_endpoints-0.1.0.tar.gz.

File metadata

  • Download URL: nvidia_ai_endpoints-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for nvidia_ai_endpoints-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88651f898ecaada01ded5b05353872b7068123768e8bf2204a8becbab78affdd
MD5 82130f4ab4ccbfc7939399c64ab1d9e5
BLAKE2b-256 9edff2aa7c94dfbdd71e887a42e274415cd2dd968e021c3c14af290d27f545ce

See more details on using hashes here.

File details

Details for the file nvidia_ai_endpoints-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nvidia_ai_endpoints-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 535e765e193f5e79fcfd43bbc828a52f34bda15e84deb136b967f5bc022ee6d5
MD5 61de06455fd42d217cd7b8eb728d1efd
BLAKE2b-256 d5c3ebcd67301e4455647d7be35376811e5bf3ac08ce4e1db3e2cb122c09999a

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