Example #1
0
 def run(self):
     subprocess.call('sphinx-apidoc -f -o doc/source keystone',
                     shell=True)
     for builder in ['html', 'man']:
         self.builder = builder
         self.finalize_options()
         BuildDoc.run(self)
Example #2
0
 def run(self):
     base_dir = os.path.dirname(os.path.abspath(__file__))
     subprocess.Popen(["python", "generate_autodoc_index.py"], cwd=os.path.join(base_dir, "doc")).communicate()
     for builder in ["html", "man"]:
         self.builder = builder
         self.finalize_options()
         BuildDoc.run(self)
 def run(self):
     src_dir = (self.distribution.package_dir or {'': ''})['']
     src_dir = os.path.join(os.getcwd(), src_dir)
     sphinx.apidoc.main(
         ['', '-f', '-o', os.path.join(self.source_dir, '_apidoc'),
          src_dir])
     BuildDoc.run(self)
Example #4
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
     self.update_gh_pages = False
     self.gh_origin_url = "[email protected]:ParaToolsInc/taucmdr.git"
     self.gh_user_name = None # Use github global conf
     self.gh_user_email = None # Use github global conf
     self.gh_commit_msg = "Updated documentation via build_sphinx"
Example #5
0
    def run(self):
        """ Execute the build_sphinx command.

        The HTML and PDF docs will be included in the tarball. So this script
        MUST be executed before creating the distributable tarball.
        """

        # Build the Users Guide in HTML and TeX format
        for builder in ('html', 'pdf'):
            # Tidy up before every build
            try:
                os.remove(os.path.join(self.source_dir, 'index.rst'))
            except OSError:
                pass
            shutil.rmtree(self.doctree_dir, True)

            self.builder = builder
            self.builder_target_dir = os.path.join(self.build_dir, builder)
            self.mkpath(self.builder_target_dir)
            builder_index = 'index_{0}.txt'.format(builder)
            copy_file(os.path.join(self.source_dir, builder_index), 
                os.path.join(self.source_dir, 'index.rst'))
            BuildDoc.run(self)

        # Copy the docs to their final destination:
        # HTML docs (Users Guide and License) -> ./vitables/htmldocs
        # PDF guide -> ./doc
        output_dir = os.path.join("vitables", "htmldocs")
        if not os.access(output_dir, os.F_OK):
            # Include the HTML guide and the license in the package
            copy_tree(os.path.join(self.build_dir,"html"), output_dir)
            shutil.rmtree(os.path.join(output_dir,"_sources"))
            copy_file('LICENSE.html', output_dir)
        copy_file(os.path.join(self.build_dir, "pdf", 
            "UsersGuide.pdf"), "doc")
Example #6
0
 def initialize_options(self):
     SphinxBuildDoc.initialize_options(self)
     self.clean_docs = False
     self.no_intersphinx = False
     self.open_docs_in_browser = False
     self.warnings_returncode = False
     self.traceback = False
Example #7
0
 def run(self):
     ret = subprocess.call(
         [sys.executable, sys.argv[0], 'build_ext', '-i']
     )
     if ret != 0:
         raise RuntimeError("Building Scipy failed!")
     SphinxBuildDoc.run(self)
 def run(self):
     # We need to create some assets in the source tree first...
     from robot.libdoc import libdoc
     out_file = os.path.join(self.source_dir, 'robot-doc.html')
     libdoc('DrupalLibrary::None', out_file)
     # ... before running the regular Sphinx builder
     BuildDoc.run(self)
Example #9
0
        def run(self):

            # make sure the python path is pointing to the newly built
            # code so that the documentation is built on this and not a
            # previously installed version

            build = self.get_finalized_command('build')
            sys.path.insert(0, os.path.abspath(build.build_lib))

            # Copy gui files to the path:
            dst = os.path.join(os.path.abspath(build.build_lib), "pyFAI", "gui")
            if not os.path.isdir(dst):
                os.makedirs(dst)
            for i in os.listdir("gui"):
                if i.endswith(".ui"):
                    src = os.path.join("gui", i)
                    idst = os.path.join(dst, i)
                    if not os.path.exists(idst):
                        shutil.copy(src, idst)

            # Build the Users Guide in HTML and TeX format
            for builder in ('html', 'latex'):
                self.builder = builder
                self.builder_target_dir = os.path.join(self.build_dir, builder)
                self.mkpath(self.builder_target_dir)
                BuildDoc.run(self)
            sys.path.pop(0)
Example #10
0
 def run(self):
     # Make sure the python path is pointing to the newly built
     # code so that the documentation is built on this and not a
     # previously installed version.
     build = self.get_finalized_command('build')
     sys.path.insert(0, os.path.abspath(build.build_lib))
     SphinxBuildDoc.run(self)
     sys.path.pop(0)
Example #11
0
 def run(self):
     if self.update_gh_pages:
         self._clone_gh_pages()
     self._copy_docs_source()
     self._generate_api_docs()
     BuildDoc.run(self)
     if self.update_gh_pages:
         self._push_gh_pages()
Example #12
0
 def run(self):
     output_dir = os.path.join(__location__, "docs/_rst")
     module_dir = os.path.join(__location__, MAIN_PACKAGE)
     cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
     cmd_line = cmd_line_template.format(outputdir=output_dir,
                                         moduledir=module_dir)
     apidoc.main(cmd_line.split(" "))
     BuildDoc.run(self)
Example #13
0
 def run(self):
     # in place build
     ret = subprocess.call([sys.executable, sys.argv[0], 'build_ext', '-i'])
     if ret != 0:
         raise RuntimeError("Building atoman failed (%d)" % ret)
     
     # build doc
     BuildDoc.run(self)
Example #14
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
     # Fix up defaults for option dicts
     build_doc = self.distribution.get_option_dict("build_sphinx")
     if "source_dir" not in build_doc:
         self.source_dir = "doc/source"
     if "build_dir" not in build_doc:
         self.build_dir = "doc/build"
     self.all_files = False
Example #15
0
 def run(self):
     self.run_command('api_docs')
     # We need to be in the doc directory for to plot_directive
     # and API generation to work
     os.chdir('doc')
     try:
         BuildDoc.run(self)
     finally:
         os.chdir('..')
     self.zip_docs()
Example #16
0
 def run(self):
     self.run_command("api_docs")
     # We need to be in the doc directory for to plot_directive
     # and API generation to work
     os.chdir("doc")
     try:
         BuildDoc.run(self)
     finally:
         os.chdir("..")
     self.zip_docs()
Example #17
0
 def run(self):
     build = self.get_finalized_command('build')
     sys.path.insert(0, os.path.abspath(build.build_lib))
     self.builder_target_dir = 'build/doc/{0}/doc'.format(DISTNAME)
     BuildDoc.user_options
     try:
         BuildDoc.run(self)
     except UnicodeDecodeError:
         print >>sys.stderr, "ERROR: unable to build documentation because Sphinx do not handle source path with non-ASCII characters. Please try to move the source package to another location (path with *only* ASCII characters)."
     sys.path.pop(0)
Example #18
0
 def run(self):
     if self.builder == "doctest":
         import sphinx.ext.doctest as doctest
         # Capture the DocTestBuilder class in order to return the total
         # number of failures when exiting
         ref = capture_objs(doctest.DocTestBuilder)
         BuildDoc.run(self)
         errno = ref[-1].total_failures
         sys.exit(errno)
     else:
         BuildDoc.run(self)
Example #19
0
            def run(self):
                if not os.getenv('SPHINX_DEBUG'):
                    self.generate_autoindex()

                for builder in ['html', 'man']:
                    self.builder = builder
                    self.finalize_options()
                    self.project = self.distribution.get_name()
                    self.version = self.distribution.get_version()
                    self.release = self.distribution.get_version()
                    BuildDoc.run(self)
Example #20
0
        def run(self):

            """ Execute the build_sphinx command.

            The HTML and PDF docs are included in the tarball. So even if 
            sphinx or pdflatex are not installed on the user's system she will 
            get the full documentation installed when installing ViTables in 
            the usual way::

                # python setup.py install

            because the build_sphinx command will not be executed by default.

            If user is installing from a binary package (which will not include
            the docs, I think), in order to ensure that she will always end up with
            the docs being installed, the package should depend on the sphinx and
            pdflatex packages and the `sphinx_found` variable should be set to 
            True.
            """

            # Build the Users Guide in HTML and TeX format
            for builder in ('html', 'latex'):
                # Tidy up before every build
                try:
                    os.remove(os.path.join(self.source_dir, 'index.rst'))
                except OSError:
                    pass
                shutil.rmtree(self.doctree_dir, True)

                self.builder = builder
                self.builder_target_dir = os.path.join(self.build_dir, builder)
                self.mkpath(self.builder_target_dir)
                builder_index = 'index_{0}.txt'.format(builder)
                copy_file(os.path.join(self.source_dir, builder_index), 
                    os.path.join(self.source_dir, 'index.rst'))
                BuildDoc.run(self)

            # Build the Users Guide in PDF format
            builder_latex_dir = os.path.join(self.build_dir, 'latex')
            make_path = find_executable("make")
            spawn([make_path, "-C", builder_latex_dir, "all-pdf"])

            # Copy the docs to their final destination:
            # HTML docs (Users Guide and License) -> ./vitables/htmldocs
            # PDF guide -> ./doc
            output_dir = os.path.join("vitables", "htmldocs")
            if not os.access(output_dir, os.F_OK):
                # Include the HTML guide and the license in the package
                copy_tree(os.path.join(self.build_dir,"html"), output_dir)
                shutil.rmtree(os.path.join(output_dir,"_sources"))
                copy_file('LICENSE.html', output_dir)
            copy_file(os.path.join(builder_latex_dir, 
                "UsersGuide.pdf"), "doc")
Example #21
0
        def run(self):
            # make sure the python path is pointing to the newly built
            # code so that the documentation is built on this and not a
            # previously installed version

            build = self.get_finalized_command('build')
            sys.path.insert(0, os.path.abspath(build.build_lib))
            # we need to reload PyMca from the build directory and not
            # the one from the source directory which does not contain
            # the extensions
            BuildDoc.run(self)
            sys.path.pop(0)
Example #22
0
File: setup.py Project: kif/fabio
        def run(self):
            # make sure the python path is pointing to the newly built
            # code so that the documentation is built on this and not a
            # previously installed version

            build = self.get_finalized_command('build')
            sys.path.insert(0, os.path.abspath(build.build_lib))

            # Build the Users Guide in HTML and TeX format
            for builder in ['doctest']:
                self.builder = builder
                self.builder_target_dir = os.path.join(self.build_dir, builder)
                self.mkpath(self.builder_target_dir)
                BuildDoc.run(self)
            sys.path.pop(0)
Example #23
0
            def run(self):
                option_dict = self.distribution.get_option_dict(
                    'build_sphinx')
                if ('autoindex' in option_dict and
                        not os.getenv('SPHINX_DEBUG')):
                    self.generate_autoindex(option_dict)
                if 'warnerrors' in option_dict:
                    application.Sphinx = LocalSphinx

                for builder in self.builders:
                    self.builder = builder
                    self.finalize_options()
                    self.project = self.distribution.get_name()
                    self.version = self.distribution.get_version()
                    self.release = self.distribution.get_version()
                    BuildDoc.run(self)
Example #24
0
        def run(self):
            from os.path import split,join

            from distutils.cmd import DistutilsOptionError

            #If possible, creat the _static dir
            if self.build_dir is not None:
                # the _static dir should be in the same place as the _build dir
                # for Astropy
                basedir, subdir = split(self.build_dir)
                if subdir == '':  # the path has a trailing /...
                    basedir, subdir = split(basedir)
                staticdir = join(basedir, '_static')
                if os.path.isfile(staticdir):
                    raise DistutilsOptionError(
                        'Attempted to build_sphinx such in a location where' +
                        staticdir + 'is a file.  Must be a directory.')
                self.mkpath(staticdir)

            #Now make sure Astropy is built and inject it into the sphinx path
            #self.reinitialize_command('build', inplace=False)
            self.run_command('build')
            build_cmd = self.get_finalized_command('build')
            new_path = os.path.abspath(build_cmd.build_lib)
            sys.path.insert(0, os.path.abspath(new_path))

            return BuildDoc.run(self)
Example #25
0
 def run(self):
     self.run_command('api_docs')
     # We need to be in the doc directory for to plot_directive
     # and API generation to work
     """
     os.chdir('doc')
     try:
         BuildDoc.run(self)
     finally:
         os.chdir('..')
     """
     # It put's the build in a doc/doc/_build directory with the
     # above?!?!  I'm leaving the code above here but commented out
     # in case I'm missing something?
     BuildDoc.run(self)
     self.zip_docs()
Example #26
0
        def run(self):
            # Make sure dismalpy is built for autodoc features
            ret = subprocess.call([sys.executable, sys.argv[0], 'build_ext', '-i'])
            if ret != 0:
                raise RuntimeError("Building Dismalpy failed!")

            # Regenerate notebooks
            cwd = os.path.abspath(os.path.dirname(__file__))
            print("Re-generating notebooks")
            p = subprocess.call([sys.executable,
                                 os.path.join(cwd, 'tools', 'sphinxify_notebooks.py'),
                                 ], cwd=cwd)
            if p != 0:
                raise RuntimeError("Notebook generation failed!")

            # Build the documentation
            BuildDoc.run(self)
Example #27
0
 def run(self):
     import sphinx.ext.doctest as doctest
     output_dir = os.path.join(__location__, "docs/_rst")
     module_dir = os.path.join(__location__, MAIN_PACKAGE)
     cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
     cmd_line = cmd_line_template.format(outputdir=output_dir,
                                         moduledir=module_dir)
     apidoc.main(cmd_line.split(" "))
     if self.builder == "doctest":
         # Capture the DocTestBuilder class in order to return the total
         # number of failures when exiting
         ref = capture_objs(doctest.DocTestBuilder)
         BuildDoc.run(self)
         errno = ref[-1].total_failures
         sys.exit(errno)
     else:
         BuildDoc.run(self)
Example #28
0
    def finalize_options(self):
        # Clear out previous sphinx builds, if requested
        if self.clean_docs:
            dirstorm = [os.path.join(self.source_dir, "api")]
            if self.build_dir is None:
                dirstorm.append("docs/_build")
            else:
                dirstorm.append(self.build_dir)

            for d in dirstorm:
                if os.path.isdir(d):
                    log.info("Cleaning directory " + d)
                    shutil.rmtree(d)
                else:
                    log.info("Not cleaning directory " + d + " because " "not present or not a directory")

        SphinxBuildDoc.finalize_options(self)
Example #29
0
        def run(self):
            # make sure the python path is pointing to the newly built
            # code so that the documentation is built on this and not a
            # previously installed version

            build = self.get_finalized_command('build')
            sys.path.insert(0, os.path.abspath(build.build_lib))
            script_dir = os.path.abspath("scripts")
            os.environ["PATH"] = "%s%s%s" % (script_dir, os.pathsep, os.environ.get("PATH", ""))
            # Build the Users Guide in HTML and TeX format
            for builder in ('html', 'latex'):
                self.builder = builder
                self.builder_target_dir = os.path.join(self.build_dir, builder)
                self.mkpath(self.builder_target_dir)
                BuildDoc.run(self)
            sys.path.pop(0)
            os.environ["PATH"] = os.pathsep.join(os.environ.get("PATH").split(os.pathsep)[1:])
Example #30
0
 def finalize_options(self):
     from os.path import isfile    
     from distutils.cmd import DistutilsOptionError
     
     if self.build_dir is not None:
         if isfile(self.build_dir):
             raise DistutilsOptionError('Attempted to build_sphinx into a file '+self.build_dir)
         self.mkpath(self.build_dir)
     return BuildDoc.finalize_options(self)
Example #31
0
 def run(self):
     for builder in ['html', 'man']:
         self.builder = builder
         self.finalize_options()
         BuildDoc.run(self)
Example #32
0
 def __call__(self, *args, **kwargs):
     from sphinx.setup_command import BuildDoc
     return BuildDoc(*args, **kwargs)
Example #33
0
 def run(self):
     # for locale in self.get_sphinx_locale_list():
     base_build_sphinx.run(self)
Example #34
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
     self.builder = 'man'
     self.source_dir = 'doc/sphinx/source'
     self.build_dir = 'build'
Example #35
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
     self.builder = "man"
     self.source_dir = "doc/sphinx/source"
     self.build_dir = "build"
Example #36
0
 def run(self):
     for builder in ['html']:  # 'man','latex'
         self.builder = builder
         self.finalize_options()
         BuildDoc.run(self)
Example #37
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
     self.builder = 'man'
Example #38
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
Example #39
0
 def finalize_options(self):
     BuildDoc.finalize_options(self)
Example #40
0
 def run(self):
     ret = subprocess.call(
         [sys.executable, sys.argv[0], 'build_ext', '--inplace'])
     if ret != 0:
         raise RuntimeError("Building Cosmogenic failed!")
     BuildDoc.run(self)
Example #41
0
 def initialize_options(self):
     SphinxBuildDoc.initialize_options(self)
     self.clean_docs = False
     self.no_intersphinx = False
     self.open_docs_in_browser = False
     self.warnings_returncode = False
Example #42
0
 def run(self):
     ret = subprocess.call(
         [sys.executable, sys.argv[0], 'build_ext', '-i'])
     if ret != 0:
         raise RuntimeError("Building Scipy failed!")
     BuildDoc.run(self)
Example #43
0
 def initialize_options(self):
     BuildDoc.initialize_options(self)
     self.thumbnails_source = 'qt'
     self.skip_api = False
     self.skip_catalog = False
Example #44
0
 def finalize_options(self):
     """ Override the default for the documentation build
         directory.
     """
     self.build_dir = os.path.join(*DOC_BUILD_DIR.split(os.sep)[:-1])
     BuildDoc.finalize_options(self)
Example #45
0
 def initialize_options(self):
     """Default to manpage builder."""
     BuildDoc.initialize_options(self)
     self.builder = 'man'