This project is aimed to provide instructions to build own python package from the scratch. All steps are used from packaging-projects official tutorial.
There are couple of steps you have to accomplish to have own python package:
- Make sure you have package ready to be shipped e.g example
- Create bunch of meta files: README.md, LICENSE.md and requirements.txt files
- Create setup.py file
- Generate distribution packages
- Update
setuptools
andwheel
:➜ pip install --user --upgrade setuptools wheel
- Run command from the same directory where
setup.py
is located:➜ python setup.py sdist bdist_wheel
- You should see newly created
dist/
directory with.tar.gz
extension file
- Update
- Upload package to PIP (python package index)
- Create test account on https://test.pypi.org/account/register
- Install
twine
package➜ pip install --user --upgrade twine
- Upload all of the archives under
dist/
➜ python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
- Install brand new python package
pip install --index-url https://test.pypi.org/simple/ --no-deps package-tutorial-vyahello
Then please launch following intructions from your environment:
from example import tutorial
t = tutorial.Tutorial("foo", "bar")
t.meta()
Author – Volodymyr Yahello vyahello@gmail.com
Distributed under the MIT
license. See LICENSE for more information.
You can reach out me at:
- clone the repository
- configure Git for the first time after cloning with your
name
andemail
pip install -r requirements.txt
to install all project dependencies