Page 96 -
P. 96

fresh pypi


           Update PyPI with your new code


           Go ahead and edit your nester.py module (in the nester folder) to
           invoke your function properly. Now that you have a new version of your
           module, it’s a good idea to update the distribution that you uploaded to PyPI.
           With your code amended, there’s also a small change needed to your
           distribution’s setup.py program. You’ve changed your API, so adjust the
           value associated with version in setup.py. Let’s move from version 1.0.0
           to 1.1.0:
                           from distutils.core import setup
                                                                       Change the value
                                                                      associated with “version”
                           setup(
                                                                      to indicate to PyPI that
                                   name         = 'nester',           this is indeed a new
                                   version      = '1.1.0',            version.
                                   py_modules   = ['nester'],
                                   author       = 'hfpython',
                                   author_email = 'hfpython@headfirstlabs.com',
                                   url          = 'http://www.headfirstlabs.com',
                                   description  = 'A simple printer of nested lists',
                                )

           Just as you did when you created and uploaded your distribution, invoke the
           setup.py program within your distribution folder to perform the upload:

                         File  Edit   Window  Help   UploadAgain
                         $ python3 setup.py sdist upload
                         running sdist
                         running check
                         reading manifest file 'MANIFEST'
                         creating nester-1.1.0
                         making hard links in nester-1.1.0...
                         hard linking nester.py -> nester-1.1.0
            Don’t you just   hard linking setup.py -> nester-1.1.0
                         Creating tar archive
            love those
           “200 OK”      removing 'nester-1.1.0' (and everything under it)
                         running upload
            messages?    Submitting dist/nester-1.1.0.tar.gz to http://pypi.python.org/pypi
                         Server response (200): OK
                         $





          Your new distribution is now available on PyPI.


           60    Chapter 2
   91   92   93   94   95   96   97   98   99   100   101