[Chicago] Python Packaging Question.

Samir Faci samir at esamir.com
Wed Jan 22 03:57:57 CET 2014


I'm working to re-package a python project from work and hopefully open
source it, and I'm running into a few blockers I was hoping someone can
clarify for me.

I've seen two styles and I'm not sure which is better or recommended when
structuring your module

A:

${root}/
   - setup.py
   - modulename.py
   -modulefolder/__init__.py # contains all your code except for modulename.
py
  - test/__init__.py   # all your tests

using A, I think any XML, yaml etc configuration is dropped into the
modulefolder/

B:

${root}/
   - setup.py
   - modulefolder/__init__.py
                       /modulename.py


1.   is A preferred over B? Is there a recommended layout ?  Is there a
recommended location as to where to store your test classes? inside the
modulefolder? outside of it?

2.  Where do you put your configuration?  do you usually shove that into
the module folder? If so, how do you derive the location of the
configuration file? relative to __file__? with some os.path magic? Would
you store things in /etc/ ?

3.  bonus question.  If anyone has a good simple example of a module
they've packaged with some type of configs and such... I'd buy you a beer
the next time I'm Chi town.

I'm probably going to have some follow up once I get all of this squared
away, but if anyone has any insight... or a link to one of those.. read
this guide that answers everything you ever wanted about packaging and
more.  That'd be awesome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20140121/d572d89b/attachment.html>


More information about the Chicago mailing list