Skip to content

Commit

Permalink
Fix document generation on the buildfarm for some ament_python pkgs (#52
Browse files Browse the repository at this point in the history
)

* Copy modules along with pkg_src_directory

Signed-off-by: Yadunund <[email protected]>

* Update rosdoc2/verbs/build/builders/sphinx_builder.py

Co-authored-by: Chris Lalancette <[email protected]>

---------

Signed-off-by: Yadunund <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
  • Loading branch information
Yadunund and clalancette authored Apr 11, 2023
1 parent 0a79553 commit 47c4683
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions rosdoc2/verbs/build/builders/sphinx_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def build(self, *, doc_build_folder, output_staging_directory):
os.path.join(
package_xml_directory,
self.build_context.python_source))
# If not provided, try to find the package source direcotry
# If not provided, try to find the package source directory
else:
package_list = setuptools.find_packages(where=package_xml_directory)
if self.build_context.package.name in package_list:
Expand Down Expand Up @@ -609,10 +609,18 @@ def generate_wrapping_rosdoc2_sphinx_project_into_directory(
os.path.abspath(user_sourcedir),
os.path.abspath(directory),
dirs_exist_ok=True)
shutil.copytree(
os.path.abspath(package_src_directory),
os.path.abspath(directory),
dirs_exist_ok=True)
if self.build_context.build_type == 'ament_python':
# shutil.copy tree will recursively copy an entire
# directory rooted at the provided src directory.
# If we supply package_src_directory as src,
# it will copy the contents within package_src_directory.
# However, we want to copy the package_src_directory itself
# such that the python modules will reside within this folder
# at the destination directory.
shutil.copytree(
os.path.abspath(os.path.join(package_src_directory, '..')),
os.path.abspath(directory),
dirs_exist_ok=True)
except OSError as e:
print(f'Failed to copy user content: {e}')

Expand Down

0 comments on commit 47c4683

Please sign in to comment.