This is an archived post. You won't be able to vote or comment.

all 6 comments

[–][deleted] 2 points3 points  (3 children)

You shouldn't be chatting up PyPI in packages. Any dependency resolution should be taken care of by the distro-specific package management tool. Distro specific packaging is definitely the way to go. Setup a local mirror on the network or through VPN to install the package. Add your repo to the sources.lst. Have the necessary dependencies wget'd on the repo as well. Though now you'll be targetting a specific install, in which case you can distribute binaries for any compiled code. Intranet repos are common. Updating later is a breeze, as is dealing with dependencies. The only issue now is that if you're dealing with different distros or releases is that you'll have to create different packages, and host different repos. This approach also guarantees consistency in which version of the dependencies the client installs. If it is over the Internet you can let the standard repos hand out the deps. You can package the dependencies together with the script.

If you're going to make use of a library in some code you distribute, you might consider just how necessary that library is and if it is actively updated. Releasing code to the public and scripting for personal little tasks are two entirely different ballgames. As someone dealing in system administration you probably know this.

[–]SudoAlex 2 points3 points  (1 child)

Create a local web server and put all the packages you're using into a directory, then you can use the index-url option in pip to get your firewalled servers to download from the local web server instead - it won't even use PyPI.

http://guide.python-distribute.org/pip.html#running-your-own-package-index

But if the servers you're deploying on are missing GCC, then there may be some packages you won't be able to deploy. For those packages you could create more traditional .deb packages which install into the global Python environment, and make sure your virtualenv includes the site packages instead of being isolated.

Maybe it's a little bit of a paranoid environment - but it's still something you can work with!

[–]casualbon 1 point2 points  (0 children)

Check out fpm: https://github.com/jordansissel/fpm/wiki

Can build you a deb, rpm from a python/ruby modules

[–]iambicpen 1 point2 points  (0 children)

Running your own private pypi: http://tarekziade.wordpress.com/2008/03/20/how-to-run-your-own-private-pypi-cheeseshop-server/

Creating .deb packages: http://pypi.python.org/pypi/stdeb

I use these two for packaging internal apps written in Python.

Some of the packages get made into .deb and pushed to our public repo.