The Artima Developer Community
Sponsored Link

Python Buzz Forum
Distributing dependencies

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
Distributing dependencies Posted: Apr 13, 2005 4:53 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: Distributing dependencies
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

When I cut a release for WSGIKit, I want the experience to be pretty easy -- you download the package, run a command, you got a server you can play with. It's pretty close to that right now, you can run:

./server.py --webkit-dir=../examples/todo --server=wsgiutils \
    --reload -v -D

To do that I have to ship some dependencies, like a server (WSGIUtils is small, but now with TwistedWeb 2 it's pretty reasonable as well). Maybe even a couple of servers. And if I want to make use of other people's middleware or libraries, I don't want to import them into my repository and namespace. I just want to distribute the files.

One option is to use a zip file, which Python can import from. You just add the zip file to sys.path. For pure Python packages this works okay -- and if it's not pure Python it's not a simple install anyway and I don't mind leaving it out and forcing the user to install it on their own. There are some problems, however -- Eggs try to solve this, but there's still a little work to do there.

Then I realized I didn't really like zip files. Zip files nested in zip files, what does that buy? And anyway, I want users to have access to all the source unpacked, regardless of its origin -- this is the transparency we like in an open source framework. They shouldn't need to look at the source. But I actually want them to, since then they are more likely to contribute, and to generally feel comfortable with the infrastructure.

So, my plan is to put all the external packages in a 3rd-party directory. I named it so it's an invalid Python package, and people can't import from it directly. Instead for each package there's a subdirectory that is added if we need to load the package, so 3rd-party/wsgiutils-files/ is added to sys.path if wsgiutils can't be loaded the normal way. I'm 100% okay with adding 100K to the download to make the experience more pleasant -- heck, I'm probably okay with something much larger than 100K, it's only disk space and bandwidth, and both of those are cheap these days. I made a little module to support this -- no magic, nothing very fancy at all.

Read: Distributing dependencies

Topic: Web 2.0 publishing empire begins ... Previous Topic   Next Topic Topic: Joshua's investors

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use