Package: isotoma.recipe.depcheck
Dependency checker buildout recipeIf you are relying on the OS to provide some facilities for your software, this
recipe can help verify that the dependencies exist.The recipe can check for any of the following:If certain files exist in the filesystem and that they are executableIf certain locales are available on the systemIf buildout is being run as a particular userIf certain users are present on the systemIf buildout is being run by any of a list of python versionsNote that locales are checked in an Ubuntu-specific way, so may not work for
you.If any dependencies fail, and the “action” option isn’t set to “warn”, the
recipe will raise an exception.An example:[foo]
program = /usr/sbin/foo

[bar]
binary = /usr/sbin/bar
locale = nl_NL.UTF-8

[dependencies]
recipe = isotoma.recipe.depcheck
executable =
    ${foo:program}
    ${bar:binary}
locale = ${bar:locale}
current-user = webappuser
users =
    taskqueue
    www-data
python =
    2.5
    2.6
    2.7
action = warnParametersexecutableA list of one or more paths to files that must be executabledirectoryA list of one or more paths to inodes that must exist and be directoriesfileA list of one or more paths to inodes that must exist and be fileslocale-fileThe name of a file on disk to look for locales in (defaults to the Ubuntu location)localeA list of one or more locales to check are in locale-filecurrent-userEnsures that buildout is being run by the user specified.usersA list of users that must have accounts on the local system. (Users must
be present in /etc/passwd)pythonA list of python versions that buildout be executed under (useful if your
application is py2.4-only, etc.)actionEither “warn” or “fail”. The default is to “fail” if a dependency isn’t met.LicenseCopyright 2010 Isotoma LimitedLicensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.Changelog0.0.9 (2014-11-20)Fix support for older pythons.0.0.8 (2014-11-20)Use the output of locales command if required.0.0.7 (2013-01-15)Checking for executables would error out if the file was missing. Now only
tries to stat the file if it is there.0.0.6 (2012-04-08)Nothing changed yet.0.0.5 (2011-09-09)The locale option was opening and parsing the (ubuntu) locales file each time
the recipe was run, regardless of whether or not the user specified “locale =”
Now it doesn’t.0.0.4 (2011-09-07)Check dependencies when the recipe’s __init__ method is called, not the
install method, so that dependency checks are run as early as possible.0.0.3 (2011-09-06)Report on all dependency requirements prior to raising a UserErrorThe buildout-created bin/test now runs the unit recipe’s unit testsAdded option “action = warn” (default is “action = fail”) to just alert the
user to dependency failures, but allow the buildout to continue.Added option “current-user”, to ensure that the buildout is being run as the
required system user, e.g. “django”.Added option “users” to ensure that particular users are present on the system
WARNING however that this retrieves its user list from /etc/passwd, so LDAP
and the likes are not supported.Added option “python” to check that the correct python version is being used.
Multiple python versions are allowed, one-per-line. Only major and minor
version numbers are accounted for, i.e. 2.6, NOT 2.6.3.0.0.2 (2011-08-16)Better error handling