Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Buildout - including per-user site-packages dir.

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


beamesleach at gmail

Jun 25, 2013, 9:49 AM

Post #1 of 5 (78 views)
Permalink
Buildout - including per-user site-packages dir.

Hi,

I'm trying to configure buildout.cfg so that paster looks for eggs in my
home folder's site packages directory, as per PEP 370[1].

In buildout.cfg, I have the line:

include-site-packages = true

But packages I've installed in my home folder aren't found when my app is
run (with paster). Is there an extra buildout option, which will allow
searching of home folders?

Alternatively, I just noticed I have an empty sitecustomize.py file in
parts/etc/, but I have no 'sitecustomize.py.in' file in etc/. If I do add
a 'sitecustomize.py.in' file to etc/, what extra steps will be required,
for 'sitecustomize.py.in' to get copied over to 'parts/etc/'?

Cheers,
Alex

p.s. versions.cfg in use:
http://grok.zope.org/releaseinfo/1.5.5/versions.cfg


[1]: http://www.python.org/dev/peps/pep-0370/
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


albl500 at york

Jun 25, 2013, 10:06 AM

Post #2 of 5 (76 views)
Permalink
Buildout - including per-user site-packages dir. [In reply to]

Hi,

I'm trying to configure buildout.cfg so that paster looks for eggs in my
home folder's site packages directory, as per PEP 370[1].

In buildout.cfg, I have the line:

include-site-packages = true

But packages I've installed in my home folder aren't found when my app is
run (with paster). Is there an extra buildout option, which will allow
searching of home folders?

Alternatively, I just noticed I have an empty sitecustomize.py file in
parts/etc/, but I have no 'sitecustomize.py.in' file in etc/. If I do add
a 'sitecustomize.py.in' file to etc/, what extra steps will be required,
for 'sitecustomize.py.in' to get copied over to 'parts/etc/'?

Cheers,
Alex



[1]: http://www.python.org/dev/peps/pep-0370/

p.s. versions.cfg in use:
http://grok.zope.org/releaseinfo/1.5.5/versions.cfg
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


raggam-nl at adm

Jun 25, 2013, 11:13 AM

Post #3 of 5 (75 views)
Permalink
Re: Buildout - including per-user site-packages dir. [In reply to]

AFAIK, you just need to create a .buildout directory in your home
directory, put the file "default.cfg" in it with this content:

[buildout]
eggs-directory = /home/YOURS/.buildout/eggs
download-cache = /home/YOURS/.buildout/downloads
extends-cache = /home/YOURS/.buildout/extends

and create the directories referenced here.

cheers,
johannes


On Die, 2013-06-25 at 18:06 +0100, Alex Leach wrote:
> Hi,
>
> I'm trying to configure buildout.cfg so that paster looks for eggs in my
> home folder's site packages directory, as per PEP 370[1].
>
> In buildout.cfg, I have the line:
>
> include-site-packages = true
>
> But packages I've installed in my home folder aren't found when my app is
> run (with paster). Is there an extra buildout option, which will allow
> searching of home folders?
>
> Alternatively, I just noticed I have an empty sitecustomize.py file in
> parts/etc/, but I have no 'sitecustomize.py.in' file in etc/. If I do add
> a 'sitecustomize.py.in' file to etc/, what extra steps will be required,
> for 'sitecustomize.py.in' to get copied over to 'parts/etc/'?
>
> Cheers,
> Alex
>
>
>
> [1]: http://www.python.org/dev/peps/pep-0370/
>
> p.s. versions.cfg in use:
> http://grok.zope.org/releaseinfo/1.5.5/versions.cfg
> _______________________________________________
> Zope-Dev maillist - Zope-Dev [at] zope
> https://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> https://mail.zope.org/mailman/listinfo/zope-announce
> https://mail.zope.org/mailman/listinfo/zope )

--
programmatic web development
di(fh) johannes raggam / thet
python plone zope development
mail: office [at] programmatic
web: http://programmatic.pro
http://bluedynamics.com
Attachments: signature.asc (0.19 KB)


albl500 at york

Jun 25, 2013, 11:44 AM

Post #4 of 5 (75 views)
Permalink
Re: Buildout - including per-user site-packages dir. [In reply to]

Hi Johannes,

Thanks for the reply.

On Tue, 25 Jun 2013 19:13:15 +0100, Johannes Raggam <raggam-nl [at] adm>
wrote:

> AFAIK, you just need to create a .buildout directory in your home
> directory, put the file "default.cfg" in it with this content:
>
> [buildout]
> eggs-directory = /home/YOURS/.buildout/eggs
> download-cache = /home/YOURS/.buildout/downloads
> extends-cache = /home/YOURS/.buildout/extends
>
> and create the directories referenced here.

I saw that, but the packages I've installed into '~/.local/lib/python...'
aren't (yet) on PyPi, so this isn't really what I need.

I've actually got it working now, without any new sitecustomize.py file..
I think changing the package recipe in buildout.cfg fixed it, but it could
have been something I did in configure.zcml.in, as I've been separating
some things out into other namespace packages recently, and that was one
file that needed tweaking.

The buildout configuration that seemed to fix this, was to add 'recipe =
zc.recipe.egg:scripts' to my package's section, and
'allowed-eggs-from-site-packages = peak' to the `[buildout]` section. That
second one also helped resolve some dependency / conflict issues I was
having with PasteScript - I also have it installed system-wide for some
reason - and seems to reduce the need for duplicating some system
packages. I like it :)


Thanks again,

Alex
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


albl500 at york

Jun 26, 2013, 1:42 AM

Post #5 of 5 (66 views)
Permalink
Re: Buildout - including per-user site-packages dir. [In reply to]

Hi again,

I got the same error with zpasswd, so had to repeat the process with that
section of buildout.cfg, too... Thought I'd explain the specifics, while I
remember...


On Tue, 25 Jun 2013 19:44:48 +0100, Alex Leach <albl500 [at] york> wrote:
>
> The buildout configuration that seemed to fix this, was to add 'recipe =
> zc.recipe.egg:scripts' to my package's section, and
> 'allowed-eggs-from-site-packages = peak' to the `[buildout]` section.

I found the documentation on these options, unsurprisingly on the
zc.recipe.egg and z3c.recipe.scripts PyPi pages.
('allowed-eggs-from-site-packages = peak' is not what I thought it was
yesterday, so please ignore it).

I don't think I had edited the zpasswd section before yesterday, so it
should have been exactly as it was, when initially generated by
`grokproject`:

[zpasswd]
recipe = z3c.recipe.scripts
eggs =
my_package
zope.password
entry-points =
zpasswd=zope.password.zpasswd:main


I'm not entirely sure why zpasswd has to import every module in
my_package, but it seems to try. So the above configuration causes zpasswd
to fail, when a required package is installed into the user's
site-packages folder.

It's worth mentioning, if you're unfamiliar with the user's site-packages
folder, that it is supported by every Python build system I've tried:
distutils, distutils2, numpy.distutils and setuptools. The following
setup.py command, which works on all of these build systems, installs a
package into the user's site-packages folder:-

$ python setup.py install --user



With the documentation in front of my, I added these options to zpasswd,
but none of these add the user's site-packages folder to the search path:-

include-site-packages = true
exec-sitecustomize = true
relative-paths = true
extra-paths = ${buildout:directory}/eggs
interpreter = python-console


However, changing the recipe does:

recipe = zc.recipe.egg:script

So, my conclusion is that it's a feature / limitation / regression in
z3c.recipe.scripts. I only say regression, because on the
z3c.recipe.scripts PyPi page, I've just read:-

"The script recipe installs eggs into a buildout eggs directory, exactly
like zc.recipe.egg [...]."

Well, not exactly... This is one difference. I'll continue to use
zc.recipe.egg, as that works as desired in this situation, but it feels
like I'm downgrading, which is never fun...

Hope that clarifies things, anyway.

Kind regards,
Alex
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.