[Chicago] Python Packaging Question.

Samir Faci samir at esamir.com
Wed Jan 22 04:33:11 CET 2014

Well, the code itself is going through legal... so code wise I don't have
anything I can show yet.

The purpose of the actual program is as follows:

it creates a .py executable that will take in a series of CLI options.  I
need to reference a few XML template files.  (Jinja2 I think, though that
might go to mako at some point), reads a config.yaml file and via CLI you
give a relative path to a bunch of thrift files.

The code will figure out your dependency tree, and generate packages and
deploy artifacts for ruby gems and maven jars.  (once I figure out this
python thing, I probably should add python to the list of supported
languages as well).

for example:

./publishClients.py --local --service thrift/services/awesome_service.thrift

my idea scenario would be to have the yaml and xml live in the same folder
as the module install.  I'd like to be able to resolve the file path/
location of the .xml and .yaml files based on the __file__ or using the
inspect package.  The output would be created relative to the $cwd.

I hope this helps.

On Tue, Jan 21, 2014 at 7:22 PM, Brian Curtin <brian at python.org> wrote:

> On Tue, Jan 21, 2014 at 8:57 PM, Samir Faci <samir at esamir.com> wrote:
> > 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?
> I guess it depends on what you're actually building beyond an example
> layout. If you're building a package, then you'll have a packagename
> folder, the __init__.py, and the files that folder which construct
> your package. If you just need a module, then just have a module.
> Do you have a more realistic example?
> Also, as for tests, most people tend to go with your A choice there.
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago

Samir Faci
*insert title*
fortune | cowsay -f /usr/share/cows/tux.cow

Sent from my non-iphone laptop.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20140121/a673c254/attachment.html>

More information about the Chicago mailing list