I’ve been learning python this summer (more on that later), and one thing that is a challenge for me was packaging my first library and shipping it to PyPi, the online repository for python modules.
First, set up your directories:
sudo apt-get install python-pip python-setuptools
vi setup.py and put this in it
with open(“README.md”, “r”) as fh:
long_description = fh.read()
description=”Simple Workflow Library”,
“Programming Language :: Python :: 2”,
“License :: OSI Approved :: MIT License”,
“Operating System :: OS Independent”,
In the fair_flow/fair_flow/__init__.py put something simple, for testing ou tthe functionality.
name = "fair_flow" def doit(): return "Did It" Install it locally pip install . Test it from the command line python -c 'import fair_flow; print fair_flow.doit()' Once you're ready, you can upload it to Pypi. First, create your account on PyPi and install twine with pip install twine Build the distribution python setup.py sdist And upload it twine upload python -c 'import fair_flow; print fair_flow.doit()'
Then you can see it on Pypi
Thanks for hints and tips from: