Open y4h2 opened 1 year ago
How to Publish an Open-Source Python Package to PyPI
click setup example: https://github.com/yu-iskw/click-custom-multi-commands-example other doc: https://stackoverflow.com/questions/61449987/how-to-package-my-python-program-so-the-user-can-install-it-using-setup-py more about setup tool: https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html
https://godatadriven.com/blog/a-practical-guide-to-setuptools-and-pyproject-toml/
official doc
python -m pip install -e .
or
pip install mypackage --no-index --find-links file:///srv/pkg/mypackage
--no-index and --find-links可以被放在requirements.txt
--no-index
--find-links
Python: Creating a pip installable package
python setup.py sdist
python -m build
setup your .pypirc
.pypirc
[distutils] index-servers = nexus [nexus] repository=[my URL]/repository/[repositoryname] username=[username] password=[password]
用twine上传
twine upload -r nexus dist/*
How to Publish an Open-Source Python Package to PyPI
Setup Tool
click setup example: https://github.com/yu-iskw/click-custom-multi-commands-example other doc: https://stackoverflow.com/questions/61449987/how-to-package-my-python-program-so-the-user-can-install-it-using-setup-py more about setup tool: https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.html
pyproject.toml
https://godatadriven.com/blog/a-practical-guide-to-setuptools-and-pyproject-toml/
official doc
install your package locally
or
--no-index
and--find-links
可以被放在requirements.txtgenerate package
Python: Creating a pip installable package
or
upload package to private registry
setup your
.pypirc
用twine上传