Sample Project To Publish Python Package
Setting Up
- Create virtual env
python -m venv venv
source venv/bin/activate
- Install dependencies
pip install setuptools wheel twine
-
Update
name,versionandinstall_requiresinsetup.py -
Build Package
python setup.py sdist bdist_wheel
- Test Locally
pip install dist/hello_sethlee-0.2-py3-none-any.whl
python test.py
- Publish to PyPI Configure your PyPI environment variables:
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<YOUR_PASSWORD>
- Publish to PyPI
twine upload dist/*
- Usage Anywhere
pip install hello-sethlee
Release files for hello-sethlee 0.7.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 | |
|---|---|---|---|
| hello_sethlee-0.7.0.tar.gz | 1.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hello_sethlee-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.6 kB
Release files / hello_sethlee-0.7.0.tar.gz
| Download URL | hello_sethlee-0.7.0.tar.gz |
|---|---|
| Size | 1.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63d6a0fe832ec9a35291f591ab55af9c7082e5810e8a7a86e6f31759c1c08d2b
|
|
BLAKE2b-256 checksum How to use checksums |
0caad639ffb7d2477bc86670bd4546841aab654aba0c171c1baa30c8be74e82b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Release files / hello_sethlee-0.7.0-py3-none-any.whl
| Download URL | hello_sethlee-0.7.0-py3-none-any.whl |
|---|---|
| Size | 2.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
326cc7862f2436a5948de2a06b7b4010958e3b0fc5feff553303e5e06ac69c93
|
|
BLAKE2b-256 checksum How to use checksums |
253897c7a29c4cf9d90ccc88c81e2d7f9098fae43f959fb9389ce67ced7a6879
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|