python-setuptools is making my head hurt

We use the distutils module to package Shoebot. Recently we’ve been discussing to replace it with setuptools, particularly because of its simple-as-pie uploading to the Python Package Index (the CPAN for snakes), as well as some other fine goodies. I hit the wall when i noticed setuptools didn’t support the data_files option, which is present in distutils. This simple option enabled us to, among others, place the examples dir in /usr/share/shoebot/examples (the same for docs) when the install script is run.

I got kind of baffled after reading docs and threads when looking for a way to place files into arbitrary directories — setuptools seems to have dropped this functionality; this absence is described as ‘a feature, not a bug’ in the setuptools documentation. Apparently, there’s no ‘standard’ way to package docs in setuptools.

What confuses me is that i really don’t get the design choice to remove a really important feature from the setuptools package creator. I couldn’t discern the reasons for this either — is it to protect users from lazy developers who want to copy evil data files into the sacred system dirs? (isn’t that why ‘sudo’ is required for installing?)

I’m really hoping that i misread the docs or got something really wrong; since the alternative provided in the thread above mentioned would be to make custom scripts that the users would run if they so wanted. It really doesn’t sound like proper behaviour for a user-friendly (and dev-friendly) package manager — one can only love easy_install. If any Python hacker runs into this rant, this humble coder would really love to be enlightened on this.

Sadly, Shoebot will have to wait a bit longer for the day it reaches PyPI /:

Leave a Reply

Powered by WP Hashcash