Beispiel #1
0
def document_packages(manifest_packages, catkin_packages, build_order,
                      repos_to_doc, sources, tags_db, full_apt_deps,
                      ros_dep, repo_map, repo_path, docspace, ros_distro,
                      homepage, doc_job):
    repo_tags = {}
    for package in build_order:
        #don't document packages that we're supposed to build but not supposed to document
        if not repo_map[package]['name'] in repos_to_doc:
            print "Package: %s, in repo: %s, is not supposed to be documented. Skipping." % (package, repo_map[package]['name'])
            continue

        #Pull the package from the correct place
        if package in catkin_packages:
            package_path = catkin_packages[package]
        else:
            package_path = manifest_packages[package]

        #Build a tagfile list from dependencies for use by rosdoc
        build_tagfile(full_apt_deps, tags_db, 'rosdoc_tags.yaml', package, build_order, docspace, ros_distro)

        relative_doc_path = "%s/doc/%s/api/%s" % (docspace, ros_distro, package)
        pkg_doc_path = os.path.realpath(relative_doc_path)
        relative_tags_path = "%s/api/%s/tags/%s.tag" % (ros_distro, package, package)
        tags_path = os.path.realpath("%s/doc/%s" % (docspace, relative_tags_path))
        print "Documenting %s [%s]..." % (package, package_path)
        #Generate the command we'll use to document the stack
        command = ['bash', '-c', '%s \
                   && export ROS_PACKAGE_PATH=%s:$ROS_PACKAGE_PATH \
                   && rosdoc_lite %s -o %s -g %s -t rosdoc_tags.yaml' \
                   %(' && '.join(sources), repo_path, package_path, pkg_doc_path, tags_path) ]
        #proc = subprocess.Popen(command, stdout=subprocess.PIPE)
        proc = subprocess.Popen(command)
        proc.communicate()

        #Some doc runs won't generate tag files, so we need to check if they
        #exist before adding them to the list
        if(os.path.exists(tags_path)):
            package_tags = {'location':'%s/%s'%(homepage, relative_tags_path),
                                 'docs_url':'../../../api/%s/html'%(package),
                                 'package':'%s'%package}

            #If the package has a deb name, then we'll store the tags for it
            #alongside that name
            if ros_dep.has_ros(package):
                pkg_deb_name = ros_dep.to_apt(package)[0]
                tags_db.set_tags(pkg_deb_name, [package_tags])
            #Otherwise, we'll store tags for it alongside it's repo, which we
            #assume can be made into a deb name
            else:
                repo_tags.setdefault(repo_map[package]['name'], []).append(package_tags)

        #We also need to add information to each package manifest that we only
        #have availalbe in this script like vcs location and type
        write_distro_specific_manifest(os.path.join(pkg_doc_path, 'manifest.yaml'),
                                       package, repo_map[package]['type'], repo_map[package]['url'], "%s/%s/api/%s/html" %(homepage, ros_distro, package),
                                       tags_db, repo_map[package]['name'], doc_job, repo_map[package]['version'])

        print "Done"
    return repo_tags
Beispiel #2
0
def document_packages(manifest_packages, catkin_packages, build_order,
                      repos_to_doc, sources, tags_db, full_apt_deps,
                      ros_dep, repo_map, repo_path, docspace, ros_distro,
                      homepage, doc_job, tags_location, doc_path,
                      rosdistro_release_file, rosdistro_source_file):
    repo_tags = {}
    for package in build_order:
        #don't document packages that we're supposed to build but not supposed to document
        if not repo_map[package]['name'] in repos_to_doc:
            print("Package: %s, in repo: %s, is not supposed to be documented. Skipping." % (package, repo_map[package]['name']))
            continue

        #Pull the package from the correct place
        if package in catkin_packages:
            package_path = catkin_packages[package]
        else:
            package_path = manifest_packages[package]

        print("Documenting %s [%s]..." % (package, package_path))

        pkg_status = None
        pkg_status_description = None
        pkg_release_jobs = []
        pkg_devel_jobs = []
        if package in catkin_packages:
            has_changelog_rst = document_package_changelog(package, package_path, doc_path)
            if rosdistro_release_file and package in rosdistro_release_file.packages:
                pkg_data = rosdistro_release_file.packages[package]
                repo_data = rosdistro_release_file.repositories[pkg_data.repository_name]
                if pkg_data.status is not None:
                    pkg_status = pkg_data.status
                elif repo_data.status is not None:
                    pkg_status = repo_data.status
                if pkg_data.status_description is not None:
                    pkg_status_description = pkg_data.status_description
                elif repo_data.status_description is not None:
                    pkg_status_description = repo_data.status_description
                if repo_data.version is not None:
                    pkg_release_jobs.append('ros-%s-%s_sourcedeb' % (ros_distro, package.replace('_', '-')))
                    for distro in rosdistro_release_file.platforms.get('ubuntu', []):
                        for arch in ['amd64', 'i386']:
                            pkg_release_jobs.append('ros-%s-%s_binarydeb_%s_%s' % (ros_distro, package.replace('_', '-'), distro, arch))

                if pkg_data.repository_name in rosdistro_source_file.repositories:
                    pkg_devel_jobs.append('devel-%s-%s' % (ros_distro, pkg_data.repository_name))
        else:
            has_changelog_rst = None

        #Build a tagfile list from dependencies for use by rosdoc
        build_tagfile(full_apt_deps, tags_db, 'rosdoc_tags.yaml', package, build_order, docspace, ros_distro, tags_location)

        relative_doc_path = "%s/doc/%s/api/%s" % (docspace, ros_distro, package)
        pkg_doc_path = os.path.realpath(relative_doc_path)
        relative_tags_path = "%s/tags/%s.tag" % (ros_distro, package)
        tags_path = os.path.realpath("%s/doc/%s" % (docspace, relative_tags_path))
        #Generate the command we'll use to document the stack
        command = ['bash', '-c', '%s \
                   && export ROS_PACKAGE_PATH=%s:$ROS_PACKAGE_PATH \
                   && rosdoc_lite %s -o %s -g %s -t rosdoc_tags.yaml'
                   % (' && '.join(sources), repo_path, package_path, pkg_doc_path, tags_path)]
        print('Invoking: %s' % ' '.join(command))
        rc = subprocess.call(command, stderr=subprocess.STDOUT)
        print('rosdoc_lite return code %d' % rc)

        add_canonical_link(pkg_doc_path, "%s/%s/api/%s" % (homepage, ros_distro, package))

        #Some doc runs won't generate tag files, so we need to check if they
        #exist before adding them to the list
        if(os.path.exists(tags_path)):
            package_tags = {'location': '%s' % (os.path.basename(relative_tags_path)),
                            'docs_url': '../../../api/%s/html' % (package),
                            'package': '%s' % package}

            # fetch generator specific output folders from rosdoc_lite
            from rosdoc_lite import get_generator_output_folders
            output_folders = get_generator_output_folders(package_path)
            print('output_folders', output_folders)
            for generator, output_folder in output_folders.items():
                package_tags['%s_output_folder' % generator] = output_folder

            #If the package has a deb name, then we'll store the tags for it
            #alongside that name
            if ros_dep.has_ros(package):
                pkg_deb_name = ros_dep.to_apt(package)[0]
                tags_db.set_tags(pkg_deb_name, [package_tags])
            #Otherwise, we'll store tags for it alongside it's repo, which we
            #assume can be made into a deb name
            else:
                repo_tags.setdefault(repo_map[package]['name'], []).append(package_tags)

        #We also need to add information to each package manifest that we only
        #have available in this script like vcs location and type
        write_distro_specific_manifest(os.path.join(pkg_doc_path, 'manifest.yaml'),
                                       package, repo_map[package]['type'], repo_map[package]['url'], "%s/%s/api/%s/html" % (homepage, ros_distro, package),
                                       tags_db, repo_map[package]['name'], doc_job, repo_map[package]['version'], has_changelog_rst, pkg_status, pkg_status_description,
                                       pkg_release_jobs, pkg_devel_jobs)

        print("Done")
    return repo_tags
Beispiel #3
0
def document_packages(manifest_packages, catkin_packages, build_order,
                      repos_to_doc, sources, tags_db, full_apt_deps,
                      ros_dep, repo_map, repo_path, docspace, ros_distro,
                      homepage, doc_job, tags_location, doc_path,
                      rosdistro_release_file, rosdistro_source_file):
    repo_tags = {}
    email_pattern = re.compile('([a-zA-Z0-9._%\+-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,6})')
    for package in build_order:
        #don't document packages that we're supposed to build but not supposed to document
        if not repo_map[package]['name'] in repos_to_doc:
            print "Package: %s, in repo: %s, is not supposed to be documented. Skipping." % (package, repo_map[package]['name'])
            continue

        #Pull the package from the correct place
        if package in catkin_packages:
            package_path = catkin_packages[package]
        else:
            package_path = manifest_packages[package]

        print "Documenting %s [%s]..." % (package, package_path)

        pkg_status = None
        pkg_status_description = None
        pkg_release_jobs = []
        pkg_devel_jobs = []
        if package in catkin_packages:
            has_changelog_rst = document_package_changelog(package, package_path, doc_path)
            if rosdistro_release_file and package in rosdistro_release_file.packages:
                pkg_data = rosdistro_release_file.packages[package]
                repo_data = rosdistro_release_file.repositories[pkg_data.repository_name]
                if pkg_data.status is not None:
                    pkg_status = pkg_data.status
                elif repo_data.status is not None:
                    pkg_status = repo_data.status
                if pkg_data.status_description is not None:
                    pkg_status_description = pkg_data.status_description
                elif repo_data.status_description is not None:
                    pkg_status_description = repo_data.status_description
                if repo_data.version is not None:
                    pkg_release_jobs.append('ros-%s-%s_sourcedeb' % (ros_distro, package.replace('_', '-')))
                    for distro in rosdistro_release_file.platforms.get('ubuntu', []):
                        for arch in ['amd64', 'i386']:
                            pkg_release_jobs.append('ros-%s-%s_binarydeb_%s_%s' % (ros_distro, package.replace('_', '-'), distro, arch))

                if pkg_data.repository_name in rosdistro_source_file.repositories:
                    pkg_devel_jobs.append('devel-%s-%s' % (ros_distro, pkg_data.repository_name))
        else:
            has_changelog_rst = None

        #Build a tagfile list from dependencies for use by rosdoc
        build_tagfile(full_apt_deps, tags_db, 'rosdoc_tags.yaml', package, build_order, docspace, ros_distro, tags_location)

        relative_doc_path = "%s/doc/%s/api/%s" % (docspace, ros_distro, package)
        pkg_doc_path = os.path.realpath(relative_doc_path)
        relative_tags_path = "%s/tags/%s.tag" % (ros_distro, package)
        tags_path = os.path.realpath("%s/doc/%s" % (docspace, relative_tags_path))
        #Generate the command we'll use to document the stack
        command = ['bash', '-c', '%s \
                   && export ROS_PACKAGE_PATH=%s:$ROS_PACKAGE_PATH \
                   && rosdoc_lite %s -o %s -g %s -t rosdoc_tags.yaml' \
                   % (' && '.join(sources), repo_path, package_path, pkg_doc_path, tags_path)]
        print('Invoking: %s' % ' '.join(command))
        rc = subprocess.call(command, stderr=subprocess.STDOUT)
        print('rosdoc_lite return code %d' % rc)

        add_canonical_link(pkg_doc_path, "%s/%s/api/%s" % (homepage, ros_distro, package))

        #Some doc runs won't generate tag files, so we need to check if they
        #exist before adding them to the list
        if(os.path.exists(tags_path)):
            package_tags = {'location': '%s' % (os.path.basename(relative_tags_path)),
                                 'docs_url': '../../../api/%s/html' % (package),
                                 'package': '%s' % package}

            #If the package has a deb name, then we'll store the tags for it
            #alongside that name
            if ros_dep.has_ros(package):
                pkg_deb_name = ros_dep.to_apt(package)[0]
                tags_db.set_tags(pkg_deb_name, [package_tags])
            #Otherwise, we'll store tags for it alongside it's repo, which we
            #assume can be made into a deb name
            else:
                repo_tags.setdefault(repo_map[package]['name'], []).append(package_tags)

        #We also need to add information to each package manifest that we only
        #have available in this script like vcs location and type
        write_distro_specific_manifest(os.path.join(pkg_doc_path, 'manifest.yaml'),
                                       package, repo_map[package]['type'], repo_map[package]['url'], "%s/%s/api/%s/html" % (homepage, ros_distro, package),
                                       tags_db, repo_map[package]['name'], doc_job, repo_map[package]['version'], has_changelog_rst, pkg_status, pkg_status_description,
                                       pkg_release_jobs, pkg_devel_jobs)

        print "Done"
    return repo_tags
def document_packages(
    manifest_packages,
    catkin_packages,
    build_order,
    repos_to_doc,
    sources,
    tags_db,
    full_apt_deps,
    ros_dep,
    repo_map,
    repo_path,
    docspace,
    ros_distro,
    homepage,
    doc_job,
    tags_location,
    doc_path,
    rosdistro_release_file,
    rosdistro_source_file,
):
    repo_tags = {}
    for package in build_order:
        # don't document packages that we're supposed to build but not supposed to document
        if not repo_map[package]["name"] in repos_to_doc:
            print(
                "Package: %s, in repo: %s, is not supposed to be documented. Skipping."
                % (package, repo_map[package]["name"])
            )
            continue

        # Pull the package from the correct place
        if package in catkin_packages:
            package_path = catkin_packages[package]
        else:
            package_path = manifest_packages[package]

        print("Documenting %s [%s]..." % (package, package_path))

        pkg_status = None
        pkg_status_description = None
        pkg_release_jobs = []
        pkg_devel_jobs = []
        if package in catkin_packages:
            has_changelog_rst = document_package_changelog(package, package_path, doc_path)
            if rosdistro_release_file and package in rosdistro_release_file.packages:
                pkg_data = rosdistro_release_file.packages[package]
                repo_data = rosdistro_release_file.repositories[pkg_data.repository_name]
                if pkg_data.status is not None:
                    pkg_status = pkg_data.status
                elif repo_data.status is not None:
                    pkg_status = repo_data.status
                if pkg_data.status_description is not None:
                    pkg_status_description = pkg_data.status_description
                elif repo_data.status_description is not None:
                    pkg_status_description = repo_data.status_description
                if repo_data.version is not None:
                    pkg_release_jobs.append("ros-%s-%s_sourcedeb" % (ros_distro, package.replace("_", "-")))
                    for distro in rosdistro_release_file.platforms.get("ubuntu", []):
                        for arch in ["amd64", "i386"]:
                            pkg_release_jobs.append(
                                "ros-%s-%s_binarydeb_%s_%s" % (ros_distro, package.replace("_", "-"), distro, arch)
                            )

                if pkg_data.repository_name in rosdistro_source_file.repositories:
                    pkg_devel_jobs.append("devel-%s-%s" % (ros_distro, pkg_data.repository_name))
        else:
            has_changelog_rst = None

        # Build a tagfile list from dependencies for use by rosdoc
        build_tagfile(
            full_apt_deps, tags_db, "rosdoc_tags.yaml", package, build_order, docspace, ros_distro, tags_location
        )

        relative_doc_path = "%s/doc/%s/api/%s" % (docspace, ros_distro, package)
        pkg_doc_path = os.path.realpath(relative_doc_path)
        relative_tags_path = "%s/tags/%s.tag" % (ros_distro, package)
        tags_path = os.path.realpath("%s/doc/%s" % (docspace, relative_tags_path))
        # Generate the command we'll use to document the stack
        command = [
            "bash",
            "-c",
            "%s \
                   && export ROS_PACKAGE_PATH=%s:$ROS_PACKAGE_PATH \
                   && rosdoc_lite %s -o %s -g %s -t rosdoc_tags.yaml"
            % (" && ".join(sources), repo_path, package_path, pkg_doc_path, tags_path),
        ]
        print("Invoking: %s" % " ".join(command))
        rc = subprocess.call(command, stderr=subprocess.STDOUT)
        print("rosdoc_lite return code %d" % rc)

        add_canonical_link(pkg_doc_path, "%s/%s/api/%s" % (homepage, ros_distro, package))

        # Some doc runs won't generate tag files, so we need to check if they
        # exist before adding them to the list
        if os.path.exists(tags_path):
            package_tags = {
                "location": "%s" % (os.path.basename(relative_tags_path)),
                "docs_url": "../../../api/%s/html" % (package),
                "package": "%s" % package,
            }

            # fetch generator specific output folders from rosdoc_lite
            from rosdoc_lite import get_generator_output_folders

            output_folders = get_generator_output_folders(package_path)
            print("output_folders", output_folders)
            for generator, output_folder in output_folders.items():
                package_tags["%s_output_folder" % generator] = output_folder

            # If the package has a deb name, then we'll store the tags for it
            # alongside that name
            if ros_dep.has_ros(package):
                pkg_deb_name = ros_dep.to_apt(package)[0]
                tags_db.set_tags(pkg_deb_name, [package_tags])
            # Otherwise, we'll store tags for it alongside it's repo, which we
            # assume can be made into a deb name
            else:
                repo_tags.setdefault(repo_map[package]["name"], []).append(package_tags)

        # We also need to add information to each package manifest that we only
        # have available in this script like vcs location and type
        write_distro_specific_manifest(
            os.path.join(pkg_doc_path, "manifest.yaml"),
            package,
            repo_map[package]["type"],
            repo_map[package]["url"],
            "%s/%s/api/%s/html" % (homepage, ros_distro, package),
            tags_db,
            repo_map[package]["name"],
            doc_job,
            repo_map[package]["version"],
            has_changelog_rst,
            pkg_status,
            pkg_status_description,
            pkg_release_jobs,
            pkg_devel_jobs,
        )

        print("Done")
    return repo_tags
Beispiel #5
0
def document_packages(manifest_packages, catkin_packages, build_order,
                      repos_to_doc, sources, tags_db, full_apt_deps, ros_dep,
                      repo_map, repo_path, docspace, ros_distro, homepage,
                      doc_job, tags_location, doc_path):
    repo_tags = {}
    for package in build_order:
        #don't document packages that we're supposed to build but not supposed to document
        if not repo_map[package]['name'] in repos_to_doc:
            print "Package: %s, in repo: %s, is not supposed to be documented. Skipping." % (
                package, repo_map[package]['name'])
            continue

        #Pull the package from the correct place
        if package in catkin_packages:
            package_path = catkin_packages[package]
            has_changelog_rst = document_package_changelog(
                package, package_path, doc_path)
        else:
            package_path = manifest_packages[package]
            has_changelog_rst = None

        #Build a tagfile list from dependencies for use by rosdoc
        build_tagfile(full_apt_deps, tags_db, 'rosdoc_tags.yaml', package,
                      build_order, docspace, ros_distro, tags_location)

        relative_doc_path = "%s/doc/%s/api/%s" % (docspace, ros_distro,
                                                  package)
        pkg_doc_path = os.path.realpath(relative_doc_path)
        relative_tags_path = "%s/tags/%s.tag" % (ros_distro, package)
        tags_path = os.path.realpath("%s/doc/%s" %
                                     (docspace, relative_tags_path))
        print "Documenting %s [%s]..." % (package, package_path)
        #Generate the command we'll use to document the stack
        command = ['bash', '-c', '%s \
                   && export ROS_PACKAGE_PATH=%s:$ROS_PACKAGE_PATH \
                   && rosdoc_lite %s -o %s -g %s -t rosdoc_tags.yaml -q' \
                   % (' && '.join(sources), repo_path, package_path, pkg_doc_path, tags_path)]
        proc = subprocess.Popen(command, stdout=subprocess.PIPE)
        #proc = subprocess.Popen(command)
        proc.communicate()

        #Some doc runs won't generate tag files, so we need to check if they
        #exist before adding them to the list
        if (os.path.exists(tags_path)):
            package_tags = {
                'location': '%s' % (os.path.basename(relative_tags_path)),
                'docs_url': '../../../api/%s/html' % (package),
                'package': '%s' % package
            }

            #If the package has a deb name, then we'll store the tags for it
            #alongside that name
            if ros_dep.has_ros(package):
                pkg_deb_name = ros_dep.to_apt(package)[0]
                tags_db.set_tags(pkg_deb_name, [package_tags])
            #Otherwise, we'll store tags for it alongside it's repo, which we
            #assume can be made into a deb name
            else:
                repo_tags.setdefault(repo_map[package]['name'],
                                     []).append(package_tags)

        #We also need to add information to each package manifest that we only
        #have availalbe in this script like vcs location and type
        write_distro_specific_manifest(
            os.path.join(pkg_doc_path, 'manifest.yaml'), package,
            repo_map[package]['type'], repo_map[package]['url'],
            "%s/%s/api/%s/html" % (homepage, ros_distro, package), tags_db,
            repo_map[package]['name'], doc_job, repo_map[package]['version'],
            has_changelog_rst)

        print "Done"
    return repo_tags