pymavlink icon indicating copy to clipboard operation
pymavlink copied to clipboard

Please straighten out your supported Python versions and dependencies

Open sarnold opened this issue 1 year ago • 9 comments

I just came back to this after several years and there seems to be zero progress in terms of cleaning up Python version support or packaging. Meaning setup.py still requires future pkg even though several other places claim only py36 or later (and several variants thereof). This is getting ridiculous trying to maintain a package that won't let go of out-dated dependencies. The world moves on and even bionic has been declared lifeless. Please lurch forward into at least the early 21st century...

sarnold avatar Sep 13 '24 19:09 sarnold

I just came back to this after several years and there seems to be zero progress in terms of cleaning up Python version support or packaging. Meaning setup.py still requires future pkg even though several other places claim only py36 or later

We're not going out of our way to support Python2 any more - if it breaks it breaks.

But we are also not going out of our way to kill it right now in pymavlink. That day may come - and it will be a good day!

(and several variants thereof). This is getting ridiculous trying to maintain a package that won't let go of out-dated

I think we may be unaware of problems that our laggardly behaviour may be causing other people here.

Are you attempting to create system packages or the like?

dependencies. The world moves on and even bionic has been declared lifeless

.... python3 is a possibility on Bionic.

Please lurch forward into at least the early 21st century...

Wait, who doesn't like steam trains?

peterbarker avatar Sep 15 '24 09:09 peterbarker

Am I missing something? I don't see any reference to future in the *.py files in the project. I just built the package with python13 and without installing future. I haven't done extensive testing (so maybe something is broken), but I was able to run the sender/receiver examples from mavlink-routerd

Is future only required for python2?

bobpaul avatar Jan 13 '25 21:01 bobpaul

Derp, I can be kinda dumb sometimes. I had the mavlink project checked out (with pymavlink as a submodule) and I was doing git grep from within mavlink instead of in mavlink/pymavlink :-/

Attached is a patch that I think should maintain python2 compatibility without requiring the future module in python 3.11+. I understand sorted(mydict.items()) is a bit slower on python2.7 than using iteritems() from future, but it should still return the same result.

remove_future.patch.txt.

bobpaul avatar Jan 14 '25 13:01 bobpaul

Partially closed by https://github.com/ArduPilot/pymavlink/pull/1003 which officially says we're no longer doing Python2 and happy to actively remove support code.

peterbarker avatar Jan 29 '25 01:01 peterbarker

Derp, I can be kinda dumb sometimes. I had the mavlink project checked out (with pymavlink as a submodule) and I was doing git grep from within mavlink instead of in mavlink/pymavlink :-/

Attached is a patch that I think should maintain python2 compatibility without requiring the future module in python 3.11+. I understand sorted(mydict.items()) is a bit slower on python2.7 than using iteritems() from future, but it should still return the same result.

remove_future.patch.txt.

Could you create a PR with your fixes in it, please? Happy to walk you through that if you need it - generally knowing a github workflow is a useful life skill :-)

peterbarker avatar Jan 29 '25 01:01 peterbarker

Sure, though I would probably do things a bit differently if if's OK to actively remove support. PR #1000 already gets one of the files.

bobpaul avatar Feb 04 '25 16:02 bobpaul

Sure, though I would probably do things a bit differently if if's OK to actively remove support. PR #1000 already gets one of the files.

I've merged https://github.com/ArduPilot/pymavlink/pull/1025 which actively removed Python2 support :-)

peterbarker avatar Apr 22 '25 06:04 peterbarker

@peterbarker maybe we can close this one then?

rmackay9 avatar Apr 22 '25 10:04 rmackay9

@peterbarker maybe we can close this one then?

Need to investigate import of future module first, I think.

peterbarker avatar May 08 '25 04:05 peterbarker