======
Anyone
======

This Python package will deliver the poem, "anyone lived in a pretty how town," by e.e. cummings.

.. code-block:: python

    # unit test
    python -m pytest

The real purpose of this package is build some solid Python foundations for future work.

So, it turns out nearly all of the documentation on building your own python package is either out of date or conflicting. Even the documentation on the `official Python documentation`_ is wrong at times. There's also spotty documentation for the TestPyPi sandbox that is out of date too.

Anyway, I guess the best thing to do for now is to use this package as a starting template.

You must create an account. There are actually two pypi pages; I'm not really sure which i the definitive source of truth, though doing anything to one site will affect the other.

- pypi.io_
- pypi.python.org_

You must create a .pypirc file

.. code-block:: bash

    cd ~
    touch .pypirc
    
    # copy + paste the following:
    # change your username and password to pyp credentials
    [distutils]
    index-servers=
        pypi
  
    [pypi]
    username = myusername
    password = mypassword

Once you made a template package like anyone, you must install twine, which is the service to upload packages

.. code-block:: bash

    pip install twine

Then try to build your distribution. It might work.

.. code-block:: bash

    # be sure to be in your package directory at its root
    python setup.py sdist

Now cross your fingers and hopefully the rest will work

.. code-block:: bash

    # upload
    twine upload dist/*
    
    # moment of truth
    pip install mypackgename

.. _pypi.io: https://pypi.io
.. _pypi.python.org: https://pypi.python.org/pypi
.. _`official Python documentation`: https://packaging.python.org/tutorials/distributing-packages/
