Example Python project
Generate cool badges with badgen, shields, or the standard GitHub workflow badges.
This repo contains boilerplate configs for python projects, including:
- vanilla
setup.pyto bundle and install a python package; - publishing package to PyPI on CI;
- running tests on CI;
- general folder structure.
Publishing to PyPI locally
Python reference here, and twine reference here.
- Install necessary dependencies.
pip3 install setuptools twine build
- Generate distribution archives (bundle package).
python3 -m build
- Upload the distribution archives to test-pypi as follows.
python3 -m twine upload --repository testpypi dist/*
- If everything looks OK, upload the distribution archives to the official PyPI repo.
python3 -m twine upload dist/*
Note When prompted for credentials use
__token__for the username and your generated api token as the password.
Installing
After publishing your project, you can now install it with pip as follows (optionally, add the test-pypi url):
pip3 install my-project-andre [--index-url https://test.pypi.org/simple/]
Substitute my-project-andre with whatever unique project name you chose in setup.py.
Metadata
Release files for my-project-andre 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| my-project-andre-0.1.1.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| my_project_andre-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.9 kB
Release files / my-project-andre-0.1.1.tar.gz
| Download URL | my-project-andre-0.1.1.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cd711a8dc016aed7ce5818dda269e21e5088bfc9e1bedd466076d5d0a7874c8
|
|
BLAKE2b-256 checksum How to use checksums |
3422c0c05f592d0a01dd814673e82ec17b82bd1c0c57b4e0a5075391e3695ec3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / my_project_andre-0.1.1-py3-none-any.whl
| Download URL | my_project_andre-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3697e0bb9c04d92f401a75ef3ca736cd1f17140d452578ecdcbbdda0d6abc808
|
|
BLAKE2b-256 checksum How to use checksums |
9cea42725e67b0fee6b523386f21e89bb2b44105330bc7cf74743f560cf6ac71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|