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
- Create a PyPI account: https://pypi.org/account/register/
- Create an API token: https://pypi.org/manage/account/token/ (scope "Entire account" for the first release; narrow it to this project afterwards.)
- 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"))
Metadata
Release files for my-py-private-lib 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| my_py_private_lib-0.1.0.tar.gz | 2.4 kB | Without provenance | Details for my_py_private_lib-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| my_py_private_lib-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for my_py_private_lib-0.1.0-py3-none-any.whl |
Total release size: 5.4 kB
Release files / my_py_private_lib-0.1.0.tar.gz
| Download URL | my_py_private_lib-0.1.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
306ae8f83a862413738b159a26ef44eb8e92107780dad6b2cbbf5d8f2fbcdb2a
|
|
BLAKE2b-256 checksum How to use checksums |
e216cec383bd73ea67c62a627c57f6bf3893a7d497afd166dc31c3cf114f329d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1013-azure
|
Release files / my_py_private_lib-0.1.0-py3-none-any.whl
| Download URL | my_py_private_lib-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95fa759020192b2d2af60cc4c517399c285bb8614dc36630a63741075793520f
|
|
BLAKE2b-256 checksum How to use checksums |
26de71d0f72496b95f510fad5be91dd7ddcc5e6ec3592e761e7143f497c0ab09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1013-azure
|
Security for my-py-private-lib 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.