Installing the dependencies in the develop egg setup.py

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Installing the dependencies in the develop egg setup.py

L. Guruprasad
Hi all,

I am having a develop egg in my buildout setup and its setup.py
specifies a dependency in the install_requires field.

When bin/buildout command is run, the dependencies are not installed.
But when I mention the dependency in the buildout.cfg file, it does gets
installed and becomes available to the environment. Alternatively,
running bin/buildout setup <path to setup.py> file installs the
dependency correctly and it works. What could be the issue here?

Here is my buildout.cfg
<snip>
[buildout]
extensions = mr.developer
auto-checkout = <project name>
develop = src/wsb
eggs = <project name>
parts = django

[sources]
<project name> = hg <repository URL>

[django]
recipe=djangorecipe
projectegg = <project name>
extra-paths = src/
settings = settings

</snip>

and the setup.py in the project
<snip>
#! /usr/bin/env python

from distutils.core import setup

setup(name='project name',
       version='version number',
       description='description text',
       author='guruprasad',
       author_email='[hidden email]',
       url='project URL',
       install_requires=['recaptcha-client']
       )

</snip>

Thanks in advance.

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Benji York
On Tue, Aug 30, 2011 at 5:50 AM, L. Guruprasad <[hidden email]> wrote:
[...]
> When bin/buildout command is run, the dependencies are not installed.
[...]
> [buildout]
> extensions = mr.developer
> auto-checkout = <project name>
> develop = src/wsb

Is your setup.py in src/wsb?  If not, the "develop" line should point to
the directory that contains it.  The line is often simply "develop = ."
(unless you have more than one develop egg in the project).
--
Benji York
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
Hi,

On Tue, Aug 30, 2011 at 5:06 PM, Benji York <[hidden email]> wrote:

> On Tue, Aug 30, 2011 at 5:50 AM, L. Guruprasad <[hidden email]> wrote:
> [...]
>> When bin/buildout command is run, the dependencies are not installed.
> [...]
>> [buildout]
>> extensions = mr.developer
>> auto-checkout = <project name>
>> develop = src/wsb
>
> Is your setup.py in src/wsb?  If not, the "develop" line should point to
> the directory that contains it.  The line is often simply "develop = ."
> (unless you have more than one develop egg in the project).

My source code is indeed in src/wsb and there is a setup.py in
src/wsb. But still the dependencies mentioned in that setup.py don't
get installed.

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Maurits van Rees-3
In reply to this post by L. Guruprasad
Op 30-08-11 11:50, L. Guruprasad schreef:

> Hi all,
>
> I am having a develop egg in my buildout setup and its setup.py
> specifies a dependency in the install_requires field.
>
> When bin/buildout command is run, the dependencies are not installed.
> But when I mention the dependency in the buildout.cfg file, it does gets
> installed and becomes available to the environment. Alternatively,
> running bin/buildout setup <path to setup.py> file installs the
> dependency correctly and it works. What could be the issue here?
>
> Here is my buildout.cfg
> <snip>
> [buildout]
> extensions = mr.developer
> auto-checkout = <project name>
> develop = src/wsb
> eggs = <project name>
> parts = django
 >

> [sources]
> <project name> = hg <repository URL>
>
> [django]
> recipe=djangorecipe
> projectegg = <project name>
> extra-paths = src/
> settings = settings
>
> </snip>
>
> and the setup.py in the project
> <snip>
> #! /usr/bin/env python
>
> from distutils.core import setup
>
> setup(name='project name',
> version='version number',
> description='description text',
> author='guruprasad',
> author_email='[hidden email]',
> url='project URL',
> install_requires=['recaptcha-client']
> )
>
> </snip>


You should have a line 'sources = sources' in the [buildout] section,
otherwise the [sources] section is not used (unless that is the default,
but explicit may be better than implicit here).  When you run buildout
do you actually get a 'src/<project name>' directory?

It looks to me like src/wsb is not actually used.  You tell buildout
that it can find a development package in src/wsb if it wants to, but I
do not see a section that actually wants to use a package with that name.

Or is 'wsb' the same as 'project name'?

Is 'projectegg' the correct spelling in djangorecipe?  I see this in a
buildout config I have here:

[django]
recipe = djangorecipe
version = 1.2.4
settings = production
eggs =
     ${buildout:eggs}
project = projectname
wsgi = true

This is with djangorecipe 0.20.  A colleague made this buildout so I
don't know details about this recipe.

Just some thoughts.

--
Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
Hi,
On Wed, Aug 31, 2011 at 6:01 PM, Maurits van Rees
<[hidden email]> wrote:
> Op 30-08-11 11:50, L. Guruprasad schreef:

> You should have a line 'sources = sources' in the [buildout] section,
> otherwise the [sources] section is not used (unless that is the default, but
> explicit may be better than implicit here).  When you run buildout do you
> actually get a 'src/<project name>' directory?

'wsb' is the name of the project. By default, the 'mr.developer'
extension checks out the source code under 'src' folder. Also by
default, it checks out the sources mentioned under the 'sources'
section. The 'sources' option in the 'buildout' section is to change
that default to something else.


>
> It looks to me like src/wsb is not actually used.  You tell buildout that it
> can find a development package in src/wsb if it wants to, but I do not see a
> section that actually wants to use a package with that name.

Here is my buildout.cfg
<snip>
[buildout]
extensions = mr.developer
auto-checkout = wsb
develop = src/wsb
eggs = wsb
parts = django

[sources]
wsb = hg <repository URL>

[django]
recipe=djangorecipe
projectegg = wsb
extra-paths = src/
settings = settings

</snip>

> Or is 'wsb' the same as 'project name'?

Yes, wsb is the name of the project.

> Is 'projectegg' the correct spelling in djangorecipe?  I see this in a
> buildout config I have here:
>
> [django]
> recipe = djangorecipe
> version = 1.2.4
> settings = production
> eggs =
>    ${buildout:eggs}
> project = projectname
> wsgi = true
>

djangorecipe automatically installs django and creates a default
django project by the name 'project'. The setting 'project' is used to
change the name of that default project that gets created. Here I
don't want a default project to be created and instead want to use an
existing develop egg, so the 'projectegg' setting can be used to
specify that to djangorecipe.

When I run buildout with this buildout.cfg, everything works fine and
djangorecipe sees the checked out develop egg that mr.developer
downloaded from my repository and sets the bin/django command
appropriately. But my problem here is that the dependencies mentioned
in the setup.py of the develop egg don't get installed automatically.

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Reinout van Rees
On 01-09-11 07:29, Guruprasad wrote:

> Here is my buildout.cfg
> <snip>
> [buildout]
> extensions = mr.developer
> auto-checkout = wsb
> develop = src/wsb
> eggs = wsb
> parts = django
>
> [sources]
> wsb = hg<repository URL>

You should not need to have that "develop = src/wsb" line! When you
enable a source with mr.developer, it gets installed as a development
egg automatically.

So: you're doing things double, which *might* be the cause of the
problems you see.


Reinout

--
Reinout van Rees                    http://reinout.vanrees.org/
[hidden email]             http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
Hi,

On Thu, Sep 1, 2011 at 3:54 PM, Reinout van Rees <[hidden email]> wrote:
> On 01-09-11 07:29, Guruprasad wrote:
> You should not need to have that "develop = src/wsb" line! When you enable a
> source with mr.developer, it gets installed as a development egg
> automatically.
>
> So: you're doing things double, which *might* be the cause of the problems
> you see.

Even after removing the duplication, it doesn't work :-(

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Maurits van Rees-3
Op 01-09-11 13:34, Guruprasad schreef:

> Hi,
>
> On Thu, Sep 1, 2011 at 3:54 PM, Reinout van Rees<[hidden email]>  wrote:
>> On 01-09-11 07:29, Guruprasad wrote:
>> You should not need to have that "develop = src/wsb" line! When you enable a
>> source with mr.developer, it gets installed as a development egg
>> automatically.
>>
>> So: you're doing things double, which *might* be the cause of the problems
>> you see.
>
> Even after removing the duplication, it doesn't work :-(

Your setup.py says:
from distutils.core import setup

I wonder if it would work if instead you say:

from setuptools import setup

And possibly add 'setuptools' in the install_requires in your setup.py.

Just guessing; I might be totally wrong.

--
Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
Hi,

On Sat, Sep 3, 2011 at 8:22 AM, Maurits van Rees
<[hidden email]> wrote:

> Op 01-09-11 13:34, Guruprasad schreef:
>> Even after removing the duplication, it doesn't work :-(
>
> Your setup.py says:
> from distutils.core import setup
>
> I wonder if it would work if instead you say:
>
> from setuptools import setup
>
> And possibly add 'setuptools' in the install_requires in your setup.py.
>
> Just guessing; I might be totally wrong.

Let me try that and get back. :-)

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
In reply to this post by Maurits van Rees-3
On Saturday 03 September 2011 08:22 AM, Maurits van Rees wrote:

> Your setup.py says:
> from distutils.core import setup
>
> I wonder if it would work if instead you say:
>
> from setuptools import setup
>
> And possibly add 'setuptools' in the install_requires in your setup.py.
>
> Just guessing; I might be totally wrong.

With a lot of enthusiasm and hope I tried it, but the end result was the
same disappointing one. :-(

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Maurits van Rees-3
In reply to this post by L. Guruprasad
Op 01-09-11 07:29, Guruprasad schreef:

> Hi,
> On Wed, Aug 31, 2011 at 6:01 PM, Maurits van Rees
> <[hidden email]>  wrote:
>> It looks to me like src/wsb is not actually used.  You tell buildout that it
>> can find a development package in src/wsb if it wants to, but I do not see a
>> section that actually wants to use a package with that name.
>
> Here is my buildout.cfg
> <snip>
> [buildout]
> extensions = mr.developer
> auto-checkout = wsb
> develop = src/wsb
> eggs = wsb
> parts = django
>
> [sources]
> wsb = hg<repository URL>
>
> [django]
> recipe=djangorecipe
> projectegg = wsb
> extra-paths = src/
> settings = settings

I reproduced your setup.  The problems is indeed that src/wsb is not
actually used, or perhaps better said: the package there is not
installed in the buildout.  This is because djangorecipe does not
actually know that it needs to install the wsb package.  Maybe it
should, as you do have the line 'projectegg = wsb'.

For me it works when I add 'eggs = ${buildout:eggs}' to the recipe, so
like this:

[django]
recipe=djangorecipe
projectegg = wsb
eggs = ${buildout:eggs}
extra-paths = src/
settings = settings

(Or explicitly: eggs = wsb)

The difference in the resulting bin/django script is that these two
extra lines are added to the path:

   '.../tmp/guru/src/wsb',
   '.../recaptcha_client-1.0.6-py2.6.egg',


I hope this helps,

--
Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
On Wednesday 07 September 2011 09:45 PM, Maurits van Rees wrote:

> Op 01-09-11 07:29, Guruprasad schreef:
> I reproduced your setup. The problems is indeed that src/wsb is not
> actually used, or perhaps better said: the package there is not
> installed in the buildout. This is because djangorecipe does not
> actually know that it needs to install the wsb package. Maybe it should,
> as you do have the line 'projectegg = wsb'.
>
> For me it works when I add 'eggs = ${buildout:eggs}' to the recipe, so
> like this:
>
> [django]
> recipe=djangorecipe
> projectegg = wsb
> eggs = ${buildout:eggs}
> extra-paths = src/
> settings = settings
>
> (Or explicitly: eggs = wsb)
>
> The difference in the resulting bin/django script is that these two
> extra lines are added to the path:
>
> '.../tmp/guru/src/wsb',
> '.../recaptcha_client-1.0.6-py2.6.egg',
>
>
> I hope this helps,

Bingo! It worked! Thanks! You made my day! :-) As you have pointed out,
though I have a develop egg, djangorecipe needs to know that it has to
use the egg and install it.

But now my question is if I have just a develop egg in my buildout.cfg
with dependencies listed in setup.py and no other parts/recipes used,
buildout will not install the dependencies right?

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Reinout van Rees
On 07-09-11 18:47, L. Guruprasad wrote:
> But now my question is if I have just a develop egg in my buildout.cfg
> with dependencies listed in setup.py and no other parts/recipes used,
> buildout will not install the dependencies right?

In that case, nothing effectively uses the egg. Because buildout
installs the develop egg, it probably grabs the dependencies just fine.

But if you don't actually use the egg, you won't see the results
anywhere. Perhaps just a zc.recipe.egg part?


Reinout

--
Reinout van Rees                    http://reinout.vanrees.org/
[hidden email]             http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

L. Guruprasad
On Thursday 08 September 2011 01:07 AM, Reinout van Rees wrote:

> On 07-09-11 18:47, L. Guruprasad wrote:
>> But now my question is if I have just a develop egg in my buildout.cfg
>> with dependencies listed in setup.py and no other parts/recipes used,
>> buildout will not install the dependencies right?
>
> In that case, nothing effectively uses the egg. Because buildout
> installs the develop egg, it probably grabs the dependencies just fine.
>
> But if you don't actually use the egg, you won't see the results
> anywhere. Perhaps just a zc.recipe.egg part?

Supposing I have a develop egg that uses 'recaptcha-client' as a dependency,

My buildout.cfg will look something like:
[buildout]
extensions = mr.developer
auto-checkout = wsb
develop = src/wsb
eggs = wsb
parts =

[sources]
wsb = hg <path to repo>

and my setup.py will have 'recaptcha-client' in 'install_requires'
field. The develop egg will need the 'recaptcha-client', but buildout
doesn't install it with the above configuration. Have I understood
buildout incorrectly that I am trying something that is also incorrect?

Thanks & Regards,
Guruprasad
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Installing the dependencies in the develop egg setup.py

Reinout van Rees
On 07-09-11 21:59, L. Guruprasad wrote:
> and my setup.py will have 'recaptcha-client' in 'install_requires'
> field. The develop egg will need the 'recaptcha-client', but buildout
> doesn't install it with the above configuration. Have I understood
> buildout incorrectly that I am trying something that is also incorrect?

The one think you're missing: you're not telling buildout to actually
install/do anything!

With your buildout.cfg, buildout *does* make the develop egg including
recaptcha client available to any part that might need it. But in this
buildout, you don't have any parts.

As an example, look in your bin/buildout. THere's a sys.path thingy in
there with setuptools and buildout. You'll need something else in there
with wsb and recaptcha and so in sys.path.


Can you add "console_scripts" to your parts list and then add this part
and try again?

[console_scripts]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}

And then check the contents of bin/python.



Reinout

--
Reinout van Rees                    http://reinout.vanrees.org/
[hidden email]             http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig