Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python2 compatibility #618

Merged
merged 1 commit into from
Apr 6, 2021
Merged

Conversation

felixvd
Copy link
Contributor

@felixvd felixvd commented Apr 4, 2021

Our move_group Python Interface tutorial uses some Python3-exclusive functions, but our master branch builds on Kinetic and Melodic, where Python2 is the standard. These changes allow running the tutorial in Python 2.7.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • While waiting for someone to review your request, please consider reviewing another open pull request to support the maintainers

Copy link
Member

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being backwards compatible is really nice. Thank you for this.

I'm not sure if we are the right ones to try to convince users of this, but if they are using Melodic on 18.04 python2 is EOL and they should install python3 and configure their system to use it. Kinetic itself is EOL and users should probably not be using it. That being said, the errors that this would produce are not a nice way to tell users that.

@gavanderhoorn
Copy link
Member

@tylerjw wrote:

I'm not sure if we are the right ones to try to convince users of this, but if they are using Melodic on 18.04 python2 is EOL and they should install python3 and configure their system to use it

and then run into endless problems with ROS packages having been built and linked to the system Python 2 (I'm looking at you cv_bridge, but there are others)?

This isn't going to work, certainly not for new users, who have trouble enough as it is figuring out ROS.

@tylerjw
Copy link
Member

tylerjw commented Apr 4, 2021

In that case should ROS EOL Melodic or strongly discourage it somehow because it has a strong dependency on python2 (via 18.04 and all the released python code in Melodic)?

Is there some piece we should play in encouraging users to use Noetic because of python2?

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Apr 4, 2021

In that case should ROS EOL Melodic or strongly discourage it somehow because it has a strong dependency on python2 (via 18.04 and all the released python code in Melodic)?

ROS Discourse: Some things to know as Python 2 approaches EOL.

It is still supported.

So no need to do anything.

Whether newcomers should still use it is a different discussion.

Is there some piece we should play in encouraging users to use Noetic because of python2?

I'd expect users who'd have a problem with Python 2 will probably be able to figure out they'd need to switch to Noetic.

All those newfangled deeplearning libraries/frameworks require Python 3 most of the time anyway, so I expect this to solve itself.

@tylerjw
Copy link
Member

tylerjw commented Apr 4, 2021

All those newfangled deeplearning libraries/frameworks require Python 3 most of the time anyway, so I expect this to solve itself.

😆 good point, this is why all the cool kids are using python anyway.

@felixvd
Copy link
Contributor Author

felixvd commented Apr 5, 2021

Newer libraries not working in Python2 is the reason that migration came up in one of my projects. But colleagues also told me that they were at an exhibition and high schoolers laughed about them using Python 2, so there's that kind of pressure as well.

FWIW, I caught this when I was testing #617 on moveit's master-source container, which is on Ubuntu 18.04 for some reason. Maybe it's time we switch that to noetic-source.

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Apr 5, 2021

But colleagues also told me that they were at an exhibition and high schoolers laughed about them using Python 2, so there's that kind of pressure as well.

Perhaps your colleagues didn't laugh at the high-schoolers hard enough in return.

I find it's a sign of immaturity to mock the design / implementation choices of another developer without knowing his or her motivation for those choices.

I doubt those "high-schoolers" have ever developed an actual product, or have had to support an existing product or project.

Legacy is a thing, and except for startups which are very young, I doubt there are companies which don't maintain at least some legacy somewhere.

@mikeferguson
Copy link

Legacy is a thing, and except for startups which are very young, I doubt there are companies which don't maintain at least some legacy somewhere.

Ha - that's funny. In my experience, startups more than a few months old quickly have lots of legacy (especially in robotics) because they lack the manpower needed to keep migrating to newer versions and they often haven't properly planned for major field updates on shipped product.

@gavanderhoorn
Copy link
Member

Ha - that's funny. In my experience, startups more than a few months old

that's why I wrote "very young" ;)

@felixvd felixvd requested a review from mikeferguson April 5, 2021 14:20
@felixvd
Copy link
Contributor Author

felixvd commented Apr 5, 2021

Ha - that's funny

Your response already contains more text than this PR, so you are now honor-bound to review it

I find it's a sign of immaturity to mock the design / implementation choices of another developer without knowing his or her motivation for those choices.

True. High school students.

@mikeferguson
Copy link

Your response already contains more text than this PR, so you are now honor-bound to review it

Fair enough.

@v4hn v4hn merged commit 493360d into moveit:master Apr 6, 2021
Abishalini pushed a commit to Abishalini/moveit_tutorials that referenced this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants