From af5ba099b3d9fc35508b994e3cad6ea8c932f9d4 Mon Sep 17 00:00:00 2001 From: guido Date: Mon, 16 Mar 2009 16:16:08 +0100 Subject: [PATCH] [svn r62971] Re-added 'gendoc.py' script to build the py lib documentation, now using the externalized apigen package. The package should be on the PYTHONPATH, if not the script warns. --HG-- branch : trunk --- py/bin/gendoc.py | 22 ++++++++++++++++++++++ py/conftest.py | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 py/bin/gendoc.py diff --git a/py/bin/gendoc.py b/py/bin/gendoc.py new file mode 100755 index 000000000..0411ce82d --- /dev/null +++ b/py/bin/gendoc.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import sys +import os +from _findpy import py +try: + import apigen +except ImportError: + print 'Can not find apigen - make sure PYTHONPATH is set correctly!' + py.std.sys.exit() +else: + args = list(sys.argv[1:]) + argkeys = [a.split('=')[0] for a in args] + if '--apigen' not in argkeys: + args.append('--apigen') + if '--apigenscript' not in argkeys: + fpath = os.path.join( + os.path.dirname(apigen.__file__), 'tool', 'py_build', 'build.py') + args.append('--apigenscript=%s' % (fpath,)) + if '--apigenpath' not in argkeys: + args.append('--apigenpath=/tmp/pylib-api') + py.test.cmdline.main(args) diff --git a/py/conftest.py b/py/conftest.py index 01ae62cb3..0f6f6464d 100644 --- a/py/conftest.py +++ b/py/conftest.py @@ -1,6 +1,6 @@ dist_rsync_roots = ['.'] # XXX -pytest_plugins = 'pytest_doctest', 'pytest_pytester', 'pytest_restdoc' +pytest_plugins = 'pytest_doctest', 'pytest_pytester', 'pytest_restdoc', 'pytest_apigen' import py class PylibTestPlugin: