Need help with a usecase
Hello I'm new to Buildout and need to figure out how to accomplish a (seemingly) simple usecase: Install my project from source into an isolated environment. My project has a Distribute-based setup.py and I'd like to install it and its dependencies to an isolated environment. I gather this should be doable using Buildout, but how? I've experimented a bit and read the documentation on PyPi, but so far I have not succeeded. Thanks! Arve
On Mon, Apr 18, 2011 at 8:28 AM, Arve Knudsen
Hello I'm new to Buildout and need to figure out how to accomplish a (seemingly) simple usecase: Install my project from source into an isolated environment. My project has a Distribute-based setup.py and I'd like to install it and its dependencies to an isolated environment. I gather this should be doable using Buildout, but how? I've experimented a bit and read the documentation on PyPi, but so far I have not succeeded.
See: http://pypi.python.org/pypi/zc.sourcerelease You *might* also find: http://www.riversnake.com/pycon2011/full/ helpful, although it is linux oriented. Jim -- Jim Fulton http://www.linkedin.com/in/jimfulton
On Mon, Apr 18, 2011 at 3:14 PM, Jim Fulton
On Mon, Apr 18, 2011 at 8:28 AM, Arve Knudsen
wrote: Hello I'm new to Buildout and need to figure out how to accomplish a (seemingly) simple usecase: Install my project from source into an isolated environment. My project has a Distribute-based setup.py and I'd like to install it and its dependencies to an isolated environment. I gather this should be doable using Buildout, but how? I've experimented a bit and read the documentation on PyPi, but so far I have not succeeded.
See:
http://pypi.python.org/pypi/zc.sourcerelease
You *might* also find:
http://www.riversnake.com/pycon2011/full/
helpful, although it is linux oriented.
Thanks for the info, Jim, but I honestly still don't see how to accomplish my usecase as a whole. The difference I see from the standard Buildout usecase is to install (with buildout) from a directory rather than to find a distribution at e.g. PyPI. Arve
On Mon, Apr 18, 2011 at 9:25 AM, Arve Knudsen
On Mon, Apr 18, 2011 at 3:14 PM, Jim Fulton
wrote: On Mon, Apr 18, 2011 at 8:28 AM, Arve Knudsen
wrote: Hello I'm new to Buildout and need to figure out how to accomplish a (seemingly) simple usecase: Install my project from source into an isolated environment. My project has a Distribute-based setup.py and I'd like to install it and its dependencies to an isolated environment. I gather this should be doable using Buildout, but how? I've experimented a bit and read the documentation on PyPi, but so far I have not succeeded.
See:
http://pypi.python.org/pypi/zc.sourcerelease
You *might* also find:
http://www.riversnake.com/pycon2011/full/
helpful, although it is linux oriented.
Thanks for the info, Jim, but I honestly still don't see how to accomplish my usecase as a whole. The difference I see from the standard Buildout usecase is to install (with buildout) from a directory rather than to find a distribution at e.g. PyPI.
Maybe you should explain your use case more. I guessed what you meant. I was obviously wrong. Jim -- Jim Fulton http://www.linkedin.com/in/jimfulton
On Mon, Apr 18, 2011 at 3:36 PM, Jim Fulton
Maybe you should explain your use case more. I guessed what you meant. I was obviously wrong.
My project (checked out from Git to be specific) comes with a Distribute-based setup.py, and I'd like to install it into an isolated Python environment. That is, the equivalent of running 'python setup.py.install' in my project directory, but into an isolated environment. I was hoping I could use Buildout for this. Arve
On Mon, Apr 18, 2011 at 10:04 AM, Arve Knudsen
On Mon, Apr 18, 2011 at 3:36 PM, Jim Fulton
wrote: Maybe you should explain your use case more. I guessed what you meant. I was obviously wrong.
My project (checked out from Git to be specific) comes with a Distribute-based setup.py, and I'd like to install it into an isolated Python environment. That is, the equivalent of running 'python setup.py.install' in my project directory, but into an isolated environment. I was hoping I could use Buildout for this.
Your specific requirements is better matched by virtualenv. Jim -- Jim Fulton http://www.linkedin.com/in/jimfulton
On Mon, Apr 18, 2011 at 4:32 PM, Jim Fulton
On Mon, Apr 18, 2011 at 10:04 AM, Arve Knudsen
wrote: On Mon, Apr 18, 2011 at 3:36 PM, Jim Fulton
wrote: Maybe you should explain your use case more. I guessed what you meant. I was obviously wrong.
My project (checked out from Git to be specific) comes with a Distribute-based setup.py, and I'd like to install it into an isolated Python environment. That is, the equivalent of running 'python setup.py.install' in my project directory, but into an isolated environment. I was hoping I could use Buildout for this.
Your specific requirements is better matched by virtualenv.
Aha. I appreciate the clear answer :) Arve
On 18-04-11 16:32, Jim Fulton wrote:
My project (checked out from Git to be specific) comes with a
Distribute-based setup.py, and I'd like to install it into an isolated Python environment. That is, the equivalent of running 'python setup.py.install' in my project directory, but into an isolated environment. I was hoping I could use Buildout for this. Your specific requirements is better matched by virtualenv.
It *is* possible with buildout in case you want to experiment :-) Put this in your buildout.cfg: [buildout] develop = . parts = scripts [scripts] recipe = zc.recipe.egg eggs = your-egg-name Grab a bootstrap.py, run it and run bin/buildout. The one thing that, to me, still is a big advantage of buildout over virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand. For quick installs and try-outs I prefer virtualenv, though :-) Reinout
Hi Reinout, On 04/19/2011 02:46 AM, Reinout van Rees wrote:
The one thing that, to me, still is a big advantage of buildout over virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand.
There are good reasons why one might prefer buildout over virtualenv, but this is not one of them ;-) A virtualenv also has a bin/ directory with scripts in it (including the interpreter, bin/python). You can run any of those scripts directly (with no activation) and they will run within the virtualenv. Activation is a shell convenience that is entirely unnecessary to the operation of virtualenv. All it does is put the virtualenv's bin/ directory first on your $PATH, so its scripts will take priority over globally-installed scripts. Carl
On Tue, Apr 19, 2011 at 11:35 AM, Carl Meyer
Hi Reinout,
On 04/19/2011 02:46 AM, Reinout van Rees wrote:
The one thing that, to me, still is a big advantage of buildout over virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand.
There are good reasons why one might prefer buildout over virtualenv, but this is not one of them ;-) A virtualenv also has a bin/ directory with scripts in it (including the interpreter, bin/python). You can run any of those scripts directly (with no activation) and they will run within the virtualenv.
Activation is a shell convenience that is entirely unnecessary to the operation of virtualenv. All it does is put the virtualenv's bin/ directory first on your $PATH, so its scripts will take priority over globally-installed scripts.
That's cool. I wish I'd known that. :) Jim -- Jim Fulton http://www.linkedin.com/in/jimfulton
Le 19/04/2011 18:05, Jim Fulton a écrit :
On Tue, Apr 19, 2011 at 11:35 AM, Carl Meyer
wrote: Activation is a shell convenience that is entirely unnecessary to the operation of virtualenv. All it does is put the virtualenv's bin/ directory first on your $PATH, so its scripts will take priority over globally-installed scripts.
That's cool. I wish I'd known that. :)
Carl’s PyCon 2011 talk explains it: http://pycon.blip.tv/file/4881525/ Reverse-engineering Ian Bicking's brain: inside pip and virtualenv Regards
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/19/2011 03:46 AM, Reinout van Rees wrote:
On 18-04-11 16:32, Jim Fulton wrote:
My project (checked out from Git to be specific) comes with a
Distribute-based setup.py, and I'd like to install it into an isolated Python environment. That is, the equivalent of running 'python setup.py.install' in my project directory, but into an isolated environment. I was hoping I could use Buildout for this. Your specific requirements is better matched by virtualenv.
It *is* possible with buildout in case you want to experiment :-) Put this in your buildout.cfg:
[buildout] develop = . parts = scripts
[scripts] recipe = zc.recipe.egg eggs = your-egg-name
Grab a bootstrap.py, run it and run bin/buildout.
The one thing that, to me, still is a big advantage of buildout over virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand.
You don't ever *need* to activate a virtualenv to run its scripts -- you just type 'bin/foo' from the VE root, or '/path/to/VE/bin/foo' from elsewhere. After using VE for years, I have literally never used activate, while using multiple VE's daily. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2t5yUACgkQ+gerLs4ltQ4KLACguvDEhCAlHdgLGajFZEqjlP+4 Cm8An3gTzHp7E9IkFA+aUpTl2P64n/2S =tHbE -----END PGP SIGNATURE-----
On 19-04-11 21:48, Tres Seaver wrote:
The one thing that, to me, still is a big advantage of buildout over
virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand. You don't ever*need* to activate a virtualenv to run its scripts -- you just type 'bin/foo' from the VE root, or '/path/to/VE/bin/foo' from elsewhere. After using VE for years, I have literally never used activate, while using multiple VE's daily.
That's weird: I never noticed that I didn't need to activate it! It sure makes virtualenv much more useful. I feel quite silly for not noticing it before... Reinout
Hi, On 2011-04-19 09:46:42 +0200, Reinout van Rees said:
The one thing that, to me, still is a big advantage of buildout over virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand.
But which is easy with the workon command from virtualenvwrapper. Kai
Hi Reinout
I didn't notice this topic was going on without me :) In the meantime I
received help at StackOverflow:
http://stackoverflow.com/questions/5703456/how-can-i-install-my-project-from....
Your solution is identical to what I ended up with, except that I used the
recipe z3c.recipe.scripts, because I understood that it improves on
zc.recipe.egg.
Thanks,
Arve
On Tue, Apr 19, 2011 at 9:46 AM, Reinout van Rees
On 18-04-11 16:32, Jim Fulton wrote:
My project (checked out from Git to be specific) comes with a
Distribute-based setup.py, and I'd like to install it into an isolated Python environment. That is, the equivalent of running 'python setup.py.install' in my project directory, but into an isolated environment. I was hoping I could use Buildout for this.
Your specific requirements is better matched by virtualenv.
It *is* possible with buildout in case you want to experiment :-) Put this in your buildout.cfg:
[buildout] develop = . parts = scripts
[scripts] recipe = zc.recipe.egg eggs = your-egg-name
Grab a bootstrap.py, run it and run bin/buildout.
The one thing that, to me, still is a big advantage of buildout over virtualenv in cases like this: you can just run the scripts in bin/* as-is. You do not need to activate the virtualenv beforehand.
For quick installs and try-outs I prefer virtualenv, though :-)
Reinout
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
On Mon, Apr 18, 2011 at 3:14 PM, Jim Fulton
wrote: On Mon, Apr 18, 2011 at 8:28 AM, Arve Knudsen
wrote: Hello I'm new to Buildout and need to figure out how to accomplish a (seemingly) simple usecase: Install my project from source into an isolated environment. My project has a Distribute-based setup.py and I'd like to install it and its dependencies to an isolated environment. I gather this should be doable using Buildout, but how? I've experimented a bit and read the documentation on PyPi, but so far I have not succeeded.
See:
http://pypi.python.org/pypi/zc.sourcerelease
You *might* also find:
http://www.riversnake.com/pycon2011/full/
helpful, although it is linux oriented.
Thanks for the info, Jim, but I honestly still don't see how to accomplish my usecase as a whole. The difference I see from the standard Buildout usecase is to install (with buildout) from a directory rather than to find a distribution at e.g. PyPI.
Look at the develop= option in the [buildout] section. There's a (little) discussion of it here: http://plone.org/documentation/manual/developer-manual/managing-projects-wit... There are no doubt better references, that was just the first one I came across. I use this for testing and developing, but never for deployment. Eric.
participants (8)
-
Arve Knudsen
-
Carl Meyer
-
Eric Smith
-
Jim Fulton
-
Kai Diefenbach
-
Reinout van Rees
-
Tres Seaver
-
Éric Araujo