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: