[Chicago] Python Packaging Question.

Jason Wirth wirth.jason at gmail.com
Wed Jan 22 04:41:28 CET 2014


I'm not a packaging expert but my advice is this:

Do you also use the package you're developing and edit it, like with pip
install --editable?

If so just pick one style and run with it until (if!) you run into problems.

And +1 root\tests\...

http://www.pip-installer.org/en/latest/usage.html

*Install Options:*

-e, --editable <path/url>

Install a project in editable mode (i.e. setuptools “develop mode”) from a
local project path or a VCS url.



-- 
Jason Wirth
    213.675.5294
    wirth.jason at gmail.com


On Tue, Jan 21, 2014 at 9: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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20140121/8548aa94/attachment.html>


More information about the Chicago mailing list