8.31.2018

Python Packaging

Following this quickstart, this and this.

1. Pick a name and make sure it is unique after checking on pypi, you might want to make this public later on.

2. Create the scaffolding.
maestroclient
├── LICENSE.txt
├── README.txt
├── maestroclient
│   └── __init__.py
└── setup.py

3. Edit setup.py to contain...
from setuptools import setup

setup(name='maestroclient',
      version='0.1',
      description='Client for accessing Maestro API',
      author='Sam Dela Cruz',
      author_email='s@gmail.com',
      license='MIT',
      packages=['maestroclient'],
      install_requires=[
          'requests',
          'urllib3',
      ],
      zip_safe=False)

4. Create a distribution.
$ python3 setup.py sdist

5. Publish on pypi, just so the project name can be reserved to pypi.
$ twine upload dist/*

6. After building the package, if publishing to pypi is not desired, the package can also be hosted anywhere and can be installed using pip as follows...
$ pip3 install http://whatever.web/maestroclient-0.1.tar.gz