ros-infrastructure / catkin_pkg

Standalone Python library for the catkin build system.
https://github.com/ros/catkin
Other
47 stars 91 forks source link

fix encode/decode problems during changelog generation #178

Closed dirk-thomas closed 7 years ago

dirk-thomas commented 7 years ago

Replaces and fixes #177.

dirk-thomas commented 7 years ago

I have updated the patch. @mintar @130s Can you please both double check the proposed change and comment if it fixes the problem for your use case (for Python 2 as well as Python 3).

130s commented 7 years ago

With updated commit catkin_generate_changelog works as expected for my packages (#179). I can only speak for Python2 (don't have Python3 envronment). Thanks!

$ git fetch origin
remote: Counting objects: 5, done.
remote: Total 5 (delta 3), reused 5 (delta 3), pack-reused 0
Unpacking objects: 100% (5/5), done.
From github.com:ros-infrastructure/catkin_pkg
 + 352e7f8...f6429e6 fix_encode_decode_error -> origin/fix_encode_decode_error  (forced update)
rosnoodle@kudu1:~/ncws/src/ros-infrastructure/catkin_pkg$ git rebase origin/fix_encode_decode_error
First, rewinding head to replay your work on top of it...
Applying: fix encode/decode problems
Using index info to reconstruct a base tree...
M       src/catkin_pkg/changelog_generator.py
M       src/catkin_pkg/changelog_generator_vcs.py
M       src/catkin_pkg/cli/tag_changelog.py
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
rosnoodle@kudu1:~/ncws/src/ros-infrastructure/catkin_pkg$ git log

commit f6429e6afc072934250facacf0a2375d2b703231
Author: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Date:   Fri Jun 2 08:54:38 2017 -0700

    fix encode/decode problems
:
$ which catkin_generate_changelog
/home/rosnoodle/ncws/src/ros-infrastructure/catkin_pkg/bin/catkin_generate_changelog

rosnoodle@kudu1:/tmp/moveit_kinetic/moveit$ cd /home/rosnoodle/cws_planning/src/ros-planning/moveit
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ catkin_generate_changelog
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ git status
On branch k/changelog097
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   moveit_plugins/moveit_controller_manager_example/CHANGELOG.rst
        modified:   moveit_plugins/moveit_fake_controller_manager/CHANGELOG.rst
        modified:   moveit_plugins/moveit_ros_control_interface/CHANGELOG.rst
        modified:   moveit_ros/perception/CHANGELOG.rst
        modified:   moveit_runtime/CHANGELOG.rst

no changes added to commit (use "git add" and/or "git commit -a")
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ git status
On branch k/changelog097
nothing to commit, working directory clean
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ catkin_generate_changelog
Found packages: chomp_motion_planner, moveit, moveit_commander, moveit_controller_manager_example, moveit_core, moveit_experimental, moveit_fake_controller_manager, moveit_kinematics, moveit_planners, moveit_planners_chomp, moveit_planners_ompl, moveit_plugins, moveit_ros, moveit_ros_benchmarks, moveit_ros_control_interface, moveit_ros_manipulation, moveit_ros_move_group, moveit_ros_perception, moveit_ros_planning, moveit_ros_planning_interface, moveit_ros_robot_interaction, moveit_ros_visualization, moveit_ros_warehouse, moveit_runtime, moveit_setup_assistant, moveit_simple_controller_manager
Querying commit information since latest tag...
Updating forthcoming section of changelog files...
- updating 'moveit_plugins/moveit_ros_control_interface/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_controller_manager_example/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_fake_controller_manager/CHANGELOG.rst'
- updating 'moveit_runtime/CHANGELOG.rst'
- updating 'moveit_ros/perception/CHANGELOG.rst'
- updating 'moveit_experimental/CHANGELOG.rst'
- updating 'moveit_ros/move_group/CHANGELOG.rst'
- updating 'moveit_setup_assistant/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_plugins/CHANGELOG.rst'
- updating 'moveit_ros/benchmarks/CHANGELOG.rst'
- updating 'moveit_ros/warehouse/CHANGELOG.rst'
- updating 'moveit_kinematics/CHANGELOG.rst'
- updating 'moveit_commander/CHANGELOG.rst'
- updating 'moveit_ros/visualization/CHANGELOG.rst'
- updating 'moveit_ros/planning_interface/CHANGELOG.rst'
- updating 'moveit_ros/robot_interaction/CHANGELOG.rst'
- updating 'moveit_ros/planning/CHANGELOG.rst'
- updating 'moveit_core/CHANGELOG.rst'
- updating 'moveit_planners/moveit_planners/CHANGELOG.rst'
- updating 'moveit_ros/manipulation/CHANGELOG.rst'
- updating 'moveit_planners/chomp/chomp_motion_planner/CHANGELOG.rst'
- updating 'moveit_ros/moveit_ros/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_simple_controller_manager/CHANGELOG.rst'
- updating 'moveit_planners/ompl/CHANGELOG.rst'
- updating 'moveit_planners/chomp/chomp_interface/CHANGELOG.rst'
- updating 'moveit/CHANGELOG.rst'
Done.
Please review the extracted commit messages and consolidate the changelog entries before committing the files!
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ git status
On branch k/changelog097
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   moveit/CHANGELOG.rst
        modified:   moveit_commander/CHANGELOG.rst
        modified:   moveit_core/CHANGELOG.rst
        modified:   moveit_experimental/CHANGELOG.rst
        modified:   moveit_kinematics/CHANGELOG.rst
        modified:   moveit_planners/chomp/chomp_interface/CHANGELOG.rst
        modified:   moveit_planners/chomp/chomp_motion_planner/CHANGELOG.rst
        modified:   moveit_planners/moveit_planners/CHANGELOG.rst
        modified:   moveit_planners/ompl/CHANGELOG.rst
        modified:   moveit_plugins/moveit_controller_manager_example/CHANGELOG.rst
        modified:   moveit_plugins/moveit_fake_controller_manager/CHANGELOG.rst
        modified:   moveit_plugins/moveit_plugins/CHANGELOG.rst
        modified:   moveit_plugins/moveit_ros_control_interface/CHANGELOG.rst
        modified:   moveit_plugins/moveit_simple_controller_manager/CHANGELOG.rst
        modified:   moveit_ros/benchmarks/CHANGELOG.rst
        modified:   moveit_ros/manipulation/CHANGELOG.rst
        modified:   moveit_ros/move_group/CHANGELOG.rst
        modified:   moveit_ros/moveit_ros/CHANGELOG.rst
        modified:   moveit_ros/perception/CHANGELOG.rst
        modified:   moveit_ros/planning/CHANGELOG.rst
        modified:   moveit_ros/planning_interface/CHANGELOG.rst
        modified:   moveit_ros/robot_interaction/CHANGELOG.rst
        modified:   moveit_ros/visualization/CHANGELOG.rst
        modified:   moveit_ros/warehouse/CHANGELOG.rst
        modified:   moveit_runtime/CHANGELOG.rst
        modified:   moveit_setup_assistant/CHANGELOG.rst

no changes added to commit (use "git add" and/or "git commit -a")
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ which python
/usr/bin/python
rosnoodle@kudu1:~/cws_planning/src/ros-planning/moveit$ python --version
Python 2.7.6
dirk-thomas commented 7 years ago

@130s Thanks for checking Python 2. Since you already manipulate your PYTHONPATH you can simply call

python3 `which catkin_generate_changelog`

to test with Python 3.

130s commented 7 years ago

I see, didn't know that easy to test on Python3 :p

On the same terminal I used at https://github.com/ros-infrastructure/catkin_pkg/pull/178#issuecomment-306271847 where I stashed the change,

$ python3 `which catkin_generate_changelog`
Traceback (most recent call last):
  File "/home/rosnoodle/ncws/src/ros-infrastructure/catkin_pkg/bin/catkin_generate_changelog", line 5, in <module>
    from catkin_pkg.cli.generate_changelog import main_catching_runtime_error
  File "/home/rosnoodle/ncws/src/ros-infrastructure/catkin_pkg/src/catkin_pkg/cli/generate_changelog.py", line 10, in <module>
    from catkin_pkg.changelog import CHANGELOG_FILENAME
  File "/home/rosnoodle/ncws/src/ros-infrastructure/catkin_pkg/src/catkin_pkg/changelog.py", line 48, in <module>
    import dateutil.parser
ImportError: No module named 'dateutil'
dirk-thomas commented 7 years ago

@130s You could resolve the missing dependency by installing python3-dateutil.

130s commented 7 years ago

After manually installing python-dateutil and python3-docutil it went well on my computer. Thanks.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
:
$ python3 `which catkin_generate_changelog`
Found packages: chomp_motion_planner, moveit, moveit_commander, moveit_controller_manager_example, moveit_core, moveit_experimental, moveit_fake_controller_manager, moveit_kinematics, moveit_planners, moveit_planners_chomp, moveit_planners_ompl, moveit_plugins, moveit_ros, moveit_ros_benchmarks, moveit_ros_control_interface, moveit_ros_manipulation, moveit_ros_move_group, moveit_ros_perception, moveit_ros_planning, moveit_ros_planning_interface, moveit_ros_robot_interaction, moveit_ros_visualization, moveit_ros_warehouse, moveit_runtime, moveit_setup_assistant, moveit_simple_controller_manager
Querying commit information since latest tag...
Updating forthcoming section of changelog files...
- updating 'moveit_planners/chomp/chomp_motion_planner/CHANGELOG.rst'
- updating 'moveit_ros/move_group/CHANGELOG.rst'
- updating 'moveit/CHANGELOG.rst'
- updating 'moveit_planners/moveit_planners/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_simple_controller_manager/CHANGELOG.rst'
- updating 'moveit_ros/planning/CHANGELOG.rst'
- updating 'moveit_commander/CHANGELOG.rst'
- updating 'moveit_planners/chomp/chomp_interface/CHANGELOG.rst'
- updating 'moveit_ros/visualization/CHANGELOG.rst'
- updating 'moveit_ros/planning_interface/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_controller_manager_example/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_fake_controller_manager/CHANGELOG.rst'
- updating 'moveit_kinematics/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_ros_control_interface/CHANGELOG.rst'
- updating 'moveit_ros/benchmarks/CHANGELOG.rst'
- updating 'moveit_ros/robot_interaction/CHANGELOG.rst'
- updating 'moveit_ros/manipulation/CHANGELOG.rst'
- updating 'moveit_runtime/CHANGELOG.rst'
- updating 'moveit_ros/warehouse/CHANGELOG.rst'
- updating 'moveit_planners/ompl/CHANGELOG.rst'
- updating 'moveit_plugins/moveit_plugins/CHANGELOG.rst'
- updating 'moveit_ros/moveit_ros/CHANGELOG.rst'
- updating 'moveit_setup_assistant/CHANGELOG.rst'
- updating 'moveit_ros/perception/CHANGELOG.rst'
- updating 'moveit_core/CHANGELOG.rst'
- updating 'moveit_experimental/CHANGELOG.rst'
Done.
Please review the extracted commit messages and consolidate the changelog entries before committing the files!
dirk-thomas commented 7 years ago

@130s Thanks for checking!

I will wait for feedback from @mintar until tomorrow. Anyway I will try to release a new version tomorrow morning (PDT).

mintar commented 7 years ago

This PR fails on Python 3 due to an unrelated error (raw_input). I've fixed that in #180 . That PR works both on Python 2 + 3 and includes detailed instructions how you can verify it yourselves.