Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Mirror environment variables into a buildout section.

Project Description

Detailed Documentation

Example usage

The value of this recipe is that its part can be referenced from other parts using the ${…} syntax. The recipe mirrors the current environment variables into its section, so that e.g. ${env:USER} will give the current user.

In addition to whatever is in the environment, UID and GID will be set to the effective user id and group id as reported by Python’s os module.

Let’s look at how this works:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = env
...
... [env]
... recipe = gocept.recipe.env
... """)

This configuration references an environment variable called buildout-test-info. Lets set it so we know its value:

>>> import os
>>> os.environ['buildout-test-info'] = '42'

Running the buildout gives us:

>>> print 'start', system(buildout) # doctest:+ELLIPSIS
start...
Installing env.
<BLANKLINE>

And the installed.cfg recorded the corresponding environment value:

>>> cat('.installed.cfg')
[buildout]
...
[env]
...
GID = ...
...
UID = ...
...
buildout-test-info = 42
...

Contributors

Change history

1.0 (2008-07-22)

  • Created recipe with ZopeSkel [Christian Theune <ct@gocept.com>].
Release History

Release History

This version
History Node

1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
gocept.recipe.env-1.0.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Jul 22, 2008

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