colcon / colcon-core

Command line tool to build sets of software packages
http://colcon.readthedocs.io
Apache License 2.0
103 stars 46 forks source link

Deprecation warning on Iron Tutorial Party: TypeCollectorDecorator SuppressTypeConversions #554

Closed SteveMacenski closed 1 year ago

SteveMacenski commented 1 year ago
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:9: UserWarning: 'colcon_core.argument_parser.type_collector.TypeCollectorDecorator' has been deprecated
  class TypeCollectorDecorator(ArgumentParserDecorator):
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:62: UserWarning: 'colcon_core.argument_parser.type_collector.SuppressTypeConversions' has been deprecated, use 'colcon_core.argument_parser.action_collector.SuppressTypeConversions' instead

First output when building a clean workspace containing Nav2 (but I suspect any)

vinnnyr commented 1 year ago

I can report that I get this warning as well on my machine when invoking colcon

cottsay commented 1 year ago

I need more information. Is there more of this backtrace that you omitted?

vinnnyr commented 1 year ago

no more to this backtrace, but this is what I get

colcon build --packages-select my_package
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:9: UserWarning: 'colcon_core.argument_parser.type_collector.TypeCollectorDecorator' has been deprecated
  class TypeCollectorDecorator(ArgumentParserDecorator):
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:62: UserWarning: 'colcon_core.argument_parser.type_collector.SuppressTypeConversions' has been deprecated, use 'colcon_core.argument_parser.action_collector.SuppressTypeConversions' instead
  class SuppressTypeConversions:
SteveMacenski commented 1 year ago

That's all I get

steve@mo:~/Documents/hi_ws$ colcon build --parallel-workers 3
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:9: UserWarning: 'colcon_core.argument_parser.type_collector.TypeCollectorDecorator' has been deprecated
  class TypeCollectorDecorator(ArgumentParserDecorator):
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:62: UserWarning: 'colcon_core.argument_parser.type_collector.SuppressTypeConversions' has been deprecated, use 'colcon_core.argument_parser.action_collector.SuppressTypeConversions' instead
  class SuppressTypeConversions:
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Finished <<< nav2_common [0.91s]                                                               
Starting >>> nav2_msgs
Starting >>> nav2_voxel_grid
Finished <<< nav2_voxel_grid [0.52s]                                                            
Finished <<< nav_2d_msgs [1.61s]                 
And so on
cottsay commented 1 year ago

The only way I can see this happening is that you've updated colcon-core but not colcon-defaults or colcon-mixin.

The current versions:

Can you check your package versions? How did you install colcon?

You can also run colcon version-check to check all of your colcon extension versions at once.

SteveMacenski commented 1 year ago

Installed via normal install instructions for installing ROS distributions. I dog food the basic install instructions to make sure whatever end-users of Nav2 see is also what I see. If there's something more that needs to be put in the iron documentation so that this isn't an issue, that may be a good idea. I followed the instructions verbatim

steve@mo:~/Documents/navigation2_ws$ colcon version-check
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:9: UserWarning: 'colcon_core.argument_parser.type_collector.TypeCollectorDecorator' has been deprecated
  class TypeCollectorDecorator(ArgumentParserDecorator):
/usr/lib/python3/dist-packages/colcon_core/argument_parser/type_collector.py:62: UserWarning: 'colcon_core.argument_parser.type_collector.SuppressTypeConversions' has been deprecated, use 'colcon_core.argument_parser.action_collector.SuppressTypeConversions' instead
  class SuppressTypeConversions:
colcon-argcomplete 0.3.3: up-to-date
colcon-bash 0.4.2: up-to-date
colcon-cd 0.1.1: up-to-date
colcon-cmake 0.2.27: up-to-date
colcon-core 0.12.1: up-to-date
colcon-defaults 0.2.8: up-to-date
colcon-devtools 0.2.3: up-to-date
colcon-installed-package-information 0.1.0: up-to-date
colcon-library-path 0.2.1: up-to-date
colcon-metadata 0.2.5: up-to-date
colcon-mixin 0.2.2: newer version available (0.2.3)
colcon-notification 0.2.15: up-to-date
colcon-output 0.2.13: up-to-date
colcon-override-check 0.0.1: up-to-date
colcon-package-information 0.3.3: up-to-date
colcon-package-selection 0.2.10: up-to-date
colcon-parallel-executor 0.2.4: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.7: up-to-date
colcon-python-setup-py 0.2.8: up-to-date
colcon-recursive-crawl 0.2.1: up-to-date
colcon-ros 0.3.23: up-to-date
colcon-test-result 0.3.8: up-to-date
colcon-zsh 0.4.0: up-to-date
cottsay commented 1 year ago

Is this a brand new install? Can you apt update && apt upgrade to get the new packages?

SteveMacenski commented 1 year ago

Yes, I did that as part of the instructions and tried again, it didn't report anything that needed updates (including colcon, even though above it says colcon-mixin 0.2.2: newer version available (0.2.3)).

cottsay commented 1 year ago

I still can't reproduce this. The installation instructions don't mention installing python3-colcon-mixin, so this must not be a "fresh" installation of Jammy. Even more confusing is that the package is available up-to-date for Jammy on packages.ros.org. Are you mixing pip packages with apt?

What do these look like?

$ dpkg-query -s python3-colcon-mixin
$ python3 -c "import colcon_mixin; print(colcon_mixin.__path__)"
SteveMacenski commented 1 year ago

That is true, this is not fresh, this is my existing machine on bare metal (I also wanted to test if Iron had collisions between Rolling / Humble side by side, and very happy to see everything working well)

steve@mo:~/Documents/navigation2_ws$ dpkg-query -s python3-colcon-mixin
dpkg-query: package 'python3-colcon-mixin' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.

steve@mo:~/Documents/navigation2_ws$ python3 -c "import colcon_mixin; print(colcon_mixin.__path__)"
['/home/steve/.local/lib/python3.10/site-packages/colcon_mixin']
steve@mo:~/Documents/navigation2_ws$ 
cottsay commented 1 year ago

Thanks for the context.

You've installed colcon_mixin using pip into your user's home directory, so apt/dpkg isn't aware of it or responsible for updating it. You should use pip install -U colcon_mixin to regularly update that package and any other packages you've installed using pip.

Alternatively, just use the debs so they're updated with the other packages on your system. pip uninstall colcon_mixin && apt install python3-colcon-mixin should do the trick, but again, there may be other packages installed via pip which are out of date.

In any case, this deprecation is working as intended. The deprecated classes will be removed someday, but clearly there are systems in the wild which would be broken if were to remove them now, so we'll need to wait a while longer.

cottsay commented 1 year ago

For further context, the deprecation was introduced in #477 and released in colcon-core 1.12.0 on February 1st, 2023.

SteveMacenski commented 1 year ago

That indeed fixed it. I'm not 100% sure how I got that mixed up, thanks! I don't think this needs to stay open then (@vinnnyr any objections?)

vinnnyr commented 1 year ago

nope no objections! resolution makes sense. I just wanted to chime in and say "me too" :)