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
- 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"))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
306ae8f83a862413738b159a26ef44eb8e92107780dad6b2cbbf5d8f2fbcdb2a
|
|
| MD5 |
7459954eb11bf21feb17396c8b53a5b5
|
|
| BLAKE2b-256 |
e216cec383bd73ea67c62a627c57f6bf3893a7d497afd166dc31c3cf114f329d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95fa759020192b2d2af60cc4c517399c285bb8614dc36630a63741075793520f
|
|
| MD5 |
b05202a55fb29c43ff8da670ea3fadd3
|
|
| BLAKE2b-256 |
26de71d0f72496b95f510fad5be91dd7ddcc5e6ec3592e761e7143f497c0ab09
|