简体   繁体   中英

When to use buildout:eggs and when to install via zc.recipe.egg?

There seem to be more than one way to install eggs into a buildout.

Way 1:

[buildout]
...
eggs = 
     eggname
     othereggname
...

Way 2:

[buildout]
...
parts = eggs

[eggs]
recipe = zc.recipe.egg
eggs = eggname
     = othereggname

Both ways work. ( variation on way 2 would be to install each requirement as a separate part. )

What is the difference between these 2 methods?

For my projects, I'm using buildout with djangorecipe and mr.developer.

In both cases, the "eggs=" makes those eggs available to that part, which means they're getting installed.

The buildout eggs don't get any additional treatment.

The big difference is that "recipe = zc.recipe.egg" ALSO tries to create scripts for all the eggs defined there. (Scripts meaning the "console_scripts" entry points, not the old distutils "scripts=", btw)

The way I normally work: I use the eggs in [buildout] to list my most important eggs ("myproject"). In the djangorecipe part, I have basically an "eggs = ${buildout:eggs}".

And a [console_scripts] part with the zc.recipe.egg recipe to make clear that I want console scripts out of the eggs there. I put extra tools like pep8 in there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM