This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Many deployments provide scripts that tie the configurations into the software. This is often done to make it easier to work with specific deployments of the software.

The conventional Unix file hierarchy doesn’t really provide a good shared place for such scripts; the zc.recipe.deployment:script recipe generates these scripts in the deployment’s bin-directory, but we’d rather have the resulting scripts associated with the deployment itself.

The options for the recipe are the same as those for the zc.recipe.egg:script recipe, with the addition of a required deployment setting. The etc-directory from the deployment is used instead of the buildout’s bin-directory. This allows deployment-specific information to be embedded in the script via the initialization setting.

Let’s take a look at a simple case. We’ll need a package with a console_script entry point:

>>> write('setup.py', '''\
... from setuptools import setup
... setup(
...     name="testpkg",
...     package_dir={"": "src"},
...     py_modules=["testmodule"],
...     zip_safe=False,
...     entry_points={
...         "console_scripts": [
...             "myscript=testmodule:main",
...             ],
...         },
...     )
... ''')
>>> mkdir('src')
>>> write('src', 'testmodule.py', '''\
... some_setting = "42"
... def main():
...     print some_setting
... ''')
>>> write('buildout.cfg',
... '''
... [buildout]
... develop = .
... parts = somescript
...
... [mydep]
... recipe = zc.recipe.deployment
... prefix = %s
... user = %s
... etc-user = %s
...
... [somescript]
... recipe = zc.recipe.script
... deployment = mydep
... eggs = testpkg
... scripts = myscript
... initialization =
...     import testmodule
...     testmodule.some_setting = "24"
... ''' % (sample_buildout, user, user))
>>> print system(join('bin', 'buildout')), # doctest: +NORMALIZE_WHITESPACE
Develop: 'PREFIX/.'
Installing mydep.
zc.recipe.deployment:
    Creating 'PREFIX/etc/mydep',
    mode 755, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/var/cache/mydep',
    mode 755, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/var/lib/mydep',
    mode 755, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/var/log/mydep',
    mode 755, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/var/run/mydep',
    mode 750, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/etc/cron.d',
    mode 755, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/etc/init.d',
    mode 755, user 'USER', group 'GROUP'
zc.recipe.deployment:
    Creating 'PREFIX/etc/logrotate.d',
    mode 755, user 'USER', group 'GROUP'
Installing somescript.
Generated script 'PREFIX/etc/mydep/myscript'.
>>> print ls("etc/mydep")
drwxr-xr-x USER GROUP etc/mydep
>>> cat("etc/mydep/myscript") # doctest: +NORMALIZE_WHITESPACE
#!/usr/bin/python
<BLANKLINE>
import sys
sys.path[0:0] = [
    'PREFIX/src',
    ]
<BLANKLINE>
import testmodule
testmodule.some_setting = "24"
<BLANKLINE>
import testmodule
<BLANKLINE>
if __name__ == '__main__':
    sys.exit(testmodule.main())

Release history

1.0.2 (2014-08-19)

Fix packaging bug (include src/zc/recipe/script/README.txt).

1.0.1 (2014-08-19)

Initial public release.

1.0.0 (2011-12-29)

Initial release (ZC internal).

Release History

Release History

1.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
zc.recipe.script-1.0.2.tar.gz (4.7 kB) Copy SHA256 Checksum SHA256 Source Aug 19, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting