ros-infrastructure / catkin_pkg

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

Declare test dependencies in [test] extra #323

Closed cottsay closed 2 years ago

cottsay commented 2 years ago

Formally declaring the test dependencies somewhere is a good idea, and allows tools like colcon to discover them.

['extras_require']['test'] is where we put these dependencies in colcon itself, but there doesn't appear to be a strong consensus among the packaging community regarding where to list these, and many options aren't compatible with python 2, which is still supported in this package. This option seems to meet all of our needs.

Also make the 'mock' dependency conditional, now that this package supports using unittest.mock.

nuclearsandwich commented 2 years ago

['extras_require']['test'] is where we put these dependencies in colcon itself, but there doesn't appear to be a string consensus among the packaging community regarding where to list these, and many options aren't compatible with python 2, which is still supported in this package.

Presumably the proposed ['extras_require']['test'] is compatible as our test on Ubuntu 18.04 with python 2.7 succeed with this PR?

cottsay commented 2 years ago

Presumably the proposed ['extras_require']['test'] is compatible as our test on Ubuntu 18.04 with python 2.7 succeed with this PR?

Indeed it is. I also tested it specifically with the system's python interpreter and setuptools package in Bionic, and it seems to work just fine.