Notes from 30 September, 2015: python packaging & unexpected results

I’m learning about python packaging, and I think I just expected to Do A Google, copy a few commands, and be on my way. This is because I was wrong, which is both disappointing and awesome: turns out I get to learn a lot more than I thought I was going to!

My desired end result is running my little Weather Balloon script as a command line script with less fussing, and I found this fabulous little resource, so I’m just doing what primates do and copying motions in order to learn: http://python-packaging.readthedocs.org/en/latest/minimal.html

Already, I’ve done some reading on the differences between python setup.py install and python setup.py develop, and got a better understanding of what that means, and also surprising results in my own terminal.

Adding a new dependency (markdown) in setup.py/__init__.py didn’t actually do anything with the develop option, which is the one mentioned here: http://python-packaging.readthedocs.org/en/latest/dependencies.html

? ? ? ? ? ? ? python setup.py develop
running develop
running egg_info
writing pbr to funniest.egg-info/pbr.json
writing requirements to funniest.egg-info/requires.txt
writing funniest.egg-info/PKG-INFO
writing top-level names to funniest.egg-info/top_level.txt
writing dependency_links to funniest.egg-info/dependency_links.txt
reading manifest file 'funniest.egg-info/SOURCES.txt'
writing manifest file 'funniest.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python2.7/site-packages/funniest.egg-link (link to .)
Removing funniest 0.1 from easy-install.pth file
Adding funniest 0.1 to easy-install.pth file

Installed /Users/liene/Documents/src/funniest
Processing dependencies for funniest==0.1
Finished processing dependencies for funniest==0.1

That toooootally doesn’t match the “To prove this works” section on the above page. Zero markdown references to be found in this result.

But install did it just fine (I just removed a bunch of non-salient stuff below, and also I bolded all references to Markdown):

[removed parts are marked with '...']
Removing funniest 0.1 from easy-install.pth file
Adding funniest 0.1 to easy-install.pth file

Installed /usr/local/lib/python2.7/site-packages/funniest-0.1-py2.7.egg
Processing dependencies for funniest==0.1
Searching for markdown
Reading https://pypi.python.org/simple/markdown/
Best match: Markdown 2.6.2
Downloading https://pypi.python.org/packages/source/M/Markdown/Markdown-2.6.2.zip...
Processing Markdown-2.6.2.zip
Writing /var/folders/.../Markdown-2.6.2/setup.cfg
Running Markdown-2.6.2/setup.py -q bdist_egg --dist-dir /var/folders/.../Markdown-2.6.2/egg-dist-tmp-7uJqls
Copying Markdown-2.6.2-py2.7.egg to /usr/local/lib/python2.7/site-packages
Adding Markdown 2.6.2 to easy-install.pth file
Installing markdown_py script to /usr/local/bin

Installed /.../site-packages/Markdown-2.6.2-py2.7.egg
Finished processing dependencies for funniest==0.1
Markdown Markdown Markdown Markdown Malkovich Malkovich Malkovich Malkovich

Huh. And what happens if, for kicks and giggles, I try python setup.py develop again?

? ? ? ? ? ? ? python setup.py develop
running develop
running egg_info
writing pbr to funniest.egg-info/pbr.json
writing requirements to funniest.egg-info/requires.txt
writing funniest.egg-info/PKG-INFO
writing top-level names to funniest.egg-info/top_level.txt
writing dependency_links to funniest.egg-info/dependency_links.txt
reading manifest file 'funniest.egg-info/SOURCES.txt'
writing manifest file 'funniest.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python2.7/site-packages/funniest.egg-link (link to .)
Removing funniest 0.1 from easy-install.pth file
Adding funniest 0.1 to easy-install.pth file

Installed /Users/liene/Documents/src/funniest
Processing dependencies for funniest==0.1
Searching for Markdown==2.6.2
Best match: Markdown 2.6.2
Processing Markdown-2.6.2-py2.7.egg
Markdown 2.6.2 is already the active version in easy-install.pth
Installing markdown_py script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages/Markdown-2.6.2-py2.7.egg
Finished processing dependencies for funniest==0.1

Huh! That was the expected result the first time.

So. I wanna know why this happened. But more than that, I want to make this work.

Gonna have to come back to this later, but I’m looking forward to learning something new here.

Leave a Reply

Your email address will not be published. Required fields are marked *