Source code in a directory

4 views
Skip to first unread message

Joan Miller

unread,
Jan 24, 2010, 7:32:55 AM1/24/10
to The Hitchhiker's Guide to Packaging
I'm not agree in this advise [1]:

"Don't put your source in a directory called src or lib. This makes it
hard to run without installing."

You only to have to run 'python setup.py develop' and it's already
solved. There is not complications and you've all very well
structured. And in my case, I prefer put the code source in a
directory called 'pkg'.

[2] "When you're installing a distribution, you can install it in
develop mode instead with python setup.py develop. Using this mode, a
special link file is created in your site-packages directory. This
link points back to the current folder or 'root package'. Any changes
you make to the software here will be reflected immediately without
having to do an install again.

When you're ready to install for good do a real install."


[1] http://guide.python-distribute.org/example.html
[2] http://www.siafoo.net/article/77#install-vs-develop

Tarek Ziadé

unread,
Jan 27, 2010, 5:42:11 AM1/27/10
to packagi...@googlegroups.com
On Sun, Jan 24, 2010 at 1:32 PM, Joan Miller <pelo...@gmail.com> wrote:
> I'm not agree in this advise [1]:
>
> "Don't put your source in a directory called src or lib. This makes it
> hard to run without installing."
>
> You only to have to run 'python setup.py develop' and it's already
> solved. There is not complications and you've all very well
> structured. And in my case, I prefer put the code source in a
> directory called 'pkg'.

develop is a Setuptools command, so your advice doesn't work for a
plain Distutils
project. But we could add your advice for the "Setuptools way"

would you mind working on a diff ? or better, joining the project :)

Tarek

Joan Miller

unread,
Jan 28, 2010, 9:20:50 AM1/28/10
to The Hitchhiker's Guide to Packaging

On 27 ene, 10:42, Tarek Ziadé <ziade.ta...@gmail.com> wrote:


> On Sun, Jan 24, 2010 at 1:32 PM, Joan Miller <pelok...@gmail.com> wrote:
> > I'm not agree in this advise [1]:
>
> > "Don't put your source in a directory called src or lib. This makes it
> > hard to run without installing."
>
> > You only to have to run 'python setup.py develop' and it's already
> > solved. There is not complications and you've all very well
> > structured. And in my case, I prefer put the code source in a
> > directory called 'pkg'.

At the end I've changed 'pkg' by 'src' as the root of source tree
since it's widely used in python (together to 'lib').

> develop is a Setuptools command, so your advice doesn't work for a
> plain Distutils
> project. But we could add your advice for the "Setuptools way"

Today is widely used virtualenv so could be installed to run it
without installing it in your "main" system. And it also can be
installed in develop mode under a virtual environment

> would you mind working on a diff ? or better, joining the project :)

Sorry! but i have no more free time since that I'm working in several
free/open sources.

Ian Bicking

unread,
Jan 28, 2010, 11:27:11 AM1/28/10
to packagi...@googlegroups.com
On Thu, Jan 28, 2010 at 8:20 AM, Joan Miller <pelo...@gmail.com> wrote:
On 27 ene, 10:42, Tarek Ziadé <ziade.ta...@gmail.com> wrote:
> On Sun, Jan 24, 2010 at 1:32 PM, Joan Miller <pelok...@gmail.com> wrote:
> > I'm not agree in this advise [1]:
>
> > "Don't put your source in a directory called src or lib. This makes it
> > hard to run without installing."
>
> > You only to have to run 'python setup.py develop' and it's already
> > solved. There is not complications and you've all very well
> > structured. And in my case, I prefer put the code source in a
> > directory called 'pkg'.
At the end I've changed 'pkg' by 'src' as the root of source tree
since it's widely used in python (together to 'lib').

lib is the most common one I've seen.  src gives you the weird situation of src/Package/src/package (at least when you put your packages in src/).  We already have more nested dolls than I generally care for.


--
Ian Bicking  |  http://blog.ianbicking.org  |  http://topplabs.org/civichacker
Reply all
Reply to author
Forward
0 new messages