colcon / colcon-cmake

Extension for colcon to support CMake packages
http://colcon.readthedocs.io
Apache License 2.0
16 stars 25 forks source link

Pass string paths instead of PosixPath #93

Closed garyservin closed 3 years ago

garyservin commented 3 years ago

After https://github.com/colcon/colcon-cmake/commit/c9a13a63d2a3cb0f58a165ae5828c9d433fa187f was merged, running colcon test with --test-result-base fails with:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/task/__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_ros/task/catkin/test.py", line 53, in test
    return await extension.test()
  File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/test.py", line 143, in test
    _copy_file(latest_xml_path, str(dst / latest_xml_path.name))
  File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/test.py", line 160, in _copy_file
    shutil.copy2(src, dst)
  File "/usr/lib/python3.5/shutil.py", line 251, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.5/shutil.py", line 97, in copyfile
    if _samefile(src, dst):
  File "/usr/lib/python3.5/shutil.py", line 82, in _samefile
    return os.path.samefile(src, dst)
  File "/usr/lib/python3.5/genericpath.py", line 90, in samefile
    s1 = os.stat(f1)
TypeError: argument should be string, bytes or integer, not PosixPath

This is because paths are being passed as pathlib objects instead of strings, this PR fixes the issue. cc: @paulbovbel

dirk-thomas commented 3 years ago

Thanks for the patch. This fixes a regression introduced by #89.

garyservin commented 3 years ago

@dirk-thomas I see the new version including this has been released, but I don't see it yet on the ros2 repo http://repo.ros2.org/ubuntu/main/pool/main/p/python3-colcon-cmake/ . When can we expect it to be available?

Thanks!

dirk-thomas commented 3 years ago

@garyservin The new Debian package has only yesterday been imported into the ROS bootstrap repo (after the workflow for making Python releases has been changed, see colcon/colcon.readthedocs.org#75), from there into main ROS repos (http://build.ros2.org/job/import_upstream/290/), and from there to the main mirror at OSU (http://build.ros2.org/job/upload_main/105/). The new version of colcon-cmake is listed now in the directory you referenced.

garyservin commented 3 years ago

awesome, thanks!