Example #1
0
def epydoc():
    '''Build and move the EpyDoc API documentation'''
    from epydoc import cli

    old_argv = tuple(sys.argv)

    try:
        sys.argv[:] = [
            '',
            '--config',
            'epydocrc',
        ]

        options, names = cli.parse_arguments()
    finally:
        sys.argv[:] = old_argv

    options.target = path('dist') / 'doc' / 'api'
    options.target.rmtree()
    options.target.makedirs()

    options.configfiles = ('epydocrc', )

    options.verbosity = options.verbosity or 1

    cli.main(options, ('pyrakoon', ))
Example #2
0
 def run(self):
     if not doc:
         raise ImportError('Epydoc is not available')
     rmtree('doc', ignore_errors=True)
     os.mkdir('doc')
     sys.argv = ['epydoc', '-v', '--name', NAME, '--url', URL, '-o', 'doc', PACKAGE]
     options, names = doc.parse_arguments()
     doc.main(options, names)
Example #3
0
def epydoc():
    """ Build Epydoc documentation """
    from epydoc import cli
    options, names = cli.parse_arguments()
    options.target = path("dist") / "docs" / "api"
    options.target.rmtree()
    options.target.makedirs()

    cli.main(options, ['emergent'])
Example #4
0
 def run(self):
     if not doc:
         raise ImportError('Epydoc is not available')
     rmtree('doc', ignore_errors=True)
     os.mkdir('doc')
     sys.argv = [
         'epydoc', '-v', '--name', NAME, '--url', URL, '-o', 'doc', PACKAGE
     ]
     options, names = doc.parse_arguments()
     doc.main(options, names)
Example #5
0
def epydoc():
    '''Build and move the EpyDoc API documentation'''
    from epydoc import cli

    old_argv = tuple(sys.argv)

    try:
        sys.argv[:] = ['', '--config', 'epydocrc', ]

        options, names = cli.parse_arguments()
    finally:
        sys.argv[:] = old_argv

    options.target = path('dist') / 'doc' / 'api'
    options.target.rmtree()
    options.target.makedirs()

    options.configfiles = ('epydocrc', )

    options.verbosity = options.verbosity or 1

    cli.main(options, ('pyrakoon', ))
Example #6
0
def build_docs(options):
    """Builds documentation for the project."""
    # Epydoc smartly makes its own output directory if the output
    # directory doesn't exist, but is not so smart that it will
    # recursively create the parents of the output directory if they
    # don't exist. Since we have the output directory path here we
    # might as well create it rather than parsing out just the parents
    # and leaving the directory itself to epydoc.
    if not os.path.exists(options.docs_output):
        os.makedirs(options.docs_output)

    # NOTE(nathaniel): Epydoc actually imports modules during analysis,
    # Melange's modules in turn import App Engine modules, and App Engine
    # modules complain if the right Django and App Engine settings aren't
    # in place at import time. Consequently, we must mutate the current
    # environment to be that of an App Engine test before we can build
    # Melange's documentation.
    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
    os.environ['SERVER_SOFTWARE'] = 'build'
    appengine_testbed = testbed.Testbed()
    appengine_testbed.activate()
    appengine_testbed.init_datastore_v3_stub()

    # NOTE(nathaniel): Deriving the options to pass to (epydoc.)cli.main this
    # way is horsehockey, but epydoc doesn't actually expose a proper API.
    stored_actual_argv = sys.argv
    sys.argv = [
        'unused_fake_executuable',
        '--config=%s' % options.docs_config,
        '--output=%s' % options.docs_output,
    ]
    epydoc_options, epydoc_names = cli.parse_arguments()
    sys.argv = stored_actual_argv

    # NOTE(nathaniel): As of 13 January 2014 this call emits two false
    # positive "Bad argument - expected name or tuple" errors. See
    # https://sourceforge.net/p/epydoc/bugs/363/ for progress.
    cli.main(epydoc_options, epydoc_names)
Example #7
0
def build_docs(options):
  """Builds documentation for the project."""
  # Epydoc smartly makes its own output directory if the output
  # directory doesn't exist, but is not so smart that it will
  # recursively create the parents of the output directory if they
  # don't exist. Since we have the output directory path here we
  # might as well create it rather than parsing out just the parents
  # and leaving the directory itself to epydoc.
  if not os.path.exists(options.docs_output):
    os.makedirs(options.docs_output)

  # NOTE(nathaniel): Epydoc actually imports modules during analysis,
  # Melange's modules in turn import App Engine modules, and App Engine
  # modules complain if the right Django and App Engine settings aren't
  # in place at import time. Consequently, we must mutate the current
  # environment to be that of an App Engine test before we can build
  # Melange's documentation.
  os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
  os.environ['SERVER_SOFTWARE'] = 'build'
  appengine_testbed = testbed.Testbed()
  appengine_testbed.activate()
  appengine_testbed.init_datastore_v3_stub()

  # NOTE(nathaniel): Deriving the options to pass to (epydoc.)cli.main this
  # way is horsehockey, but epydoc doesn't actually expose a proper API.
  stored_actual_argv = sys.argv
  sys.argv = [
      'unused_fake_executuable',
      '--config=%s' % options.docs_config,
      '--output=%s' % options.docs_output,
      ]
  epydoc_options, epydoc_names = cli.parse_arguments()
  sys.argv = stored_actual_argv

  # NOTE(nathaniel): As of 13 January 2014 this call emits two false
  # positive "Bad argument - expected name or tuple" errors. See
  # https://sourceforge.net/p/epydoc/bugs/363/ for progress.
  cli.main(epydoc_options, epydoc_names)