Skip to main content

A small example Python library.

Project description

my-py-private-lib

A small example Python library, published to PyPI.

Release workflow

Releases are automated. Pushing a tag that matches v* triggers .github/workflows/publish.yml, which builds the package and uploads it to PyPI.

One-time setup

  1. Create a PyPI account: https://pypi.org/account/register/
  2. Create an API token: https://pypi.org/manage/account/token/ (scope "Entire account" for the first release; narrow it to this project afterwards.)
  3. In the GitHub repo, add the token as a secret named PYPI_API_TOKEN (Settings → Secrets and variables → Actions → New repository secret).

Cutting a release

# 1. Bump the version in pyproject.toml (e.g. 0.1.0 -> 0.1.1).
# 2. Commit and push to main.
git commit -am "Release v0.1.1"
git push

# 3. Tag and push the tag — this triggers the workflow.
git tag v0.1.1
git push origin v0.1.1

PyPI versions are immutable: once published, that exact version number can never be reused, even after deletion. Always bump before tagging.

Local publishing (manual, optional)

poetry config pypi-token.pypi <your-pypi-token>
poetry build
poetry publish

Trial runs with TestPyPI

To verify the release pipeline without burning a real version on PyPI:

poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi <your-testpypi-token>
poetry publish -r testpypi

Install from TestPyPI:

pip install -i https://test.pypi.org/simple/ my-py-private-lib

Installation

pip install my-py-private-lib

Usage

from my_py_private_lib import hello

print(hello("Thar San"))

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

my_py_private_lib-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

my_py_private_lib-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: my_py_private_lib-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1013-azure

File hashes

Hashes for my_py_private_lib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 306ae8f83a862413738b159a26ef44eb8e92107780dad6b2cbbf5d8f2fbcdb2a
MD5 7459954eb11bf21feb17396c8b53a5b5
BLAKE2b-256 e216cec383bd73ea67c62a627c57f6bf3893a7d497afd166dc31c3cf114f329d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: my_py_private_lib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1013-azure

File hashes

Hashes for my_py_private_lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95fa759020192b2d2af60cc4c517399c285bb8614dc36630a63741075793520f
MD5 b05202a55fb29c43ff8da670ea3fadd3
BLAKE2b-256 26de71d0f72496b95f510fad5be91dd7ddcc5e6ec3592e761e7143f497c0ab09

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