How to share a python package in pypi(Python Package Index)?

Опубликовано: 19 Октябрь 2024
на канале: Said Mousa Sajadi
32
0

Instructions
https://packaging.python.org/en/lates...

Files:
Project Folder(Include project.py , __init__)
pyproject.toml
README.md
LICENSE

pyproject File: [Hatchling]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "ProjectFolder"
version = "0.0.1"
authors = [
{ name="Example Author", email="[email protected]" },
]
description = "A small example package"
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
"Homepage" = "https://github.com/YourAccount/YourRe..."
"Bug Tracker" = "https://github.com/YourAccount/YourRe..."

Read Me:
https://rentry.co

License:
https://choosealicense.com/

Build Package:
pip install --upgrade build
python -m build
pip install --upgrade twine

Upload Package:
python -m twine upload --repository testpypi dist/*
python -m twine upload --repository pypi dist/*

usr:
pw:

Download Package:
pip install -i https://test.pypi.org/simple/ ProjectFolder
pip install ProjectFolder