ardupilotwaf: require minimum Python 3.8
Makes the comment honest.
Requires upgrading Cygwin to Python 3.9. Python 3.12 is available but it doesn't have all our packages. I think we will have to modernize a bit more.
Why is it that we want to move forward with our minimum Python version?
Doing so is likely to break a bunch of people's environments.
I'm mostly proposing that we make the comment correct. If we want to keep 3.6 the minimum I suppose that's okay, but it has not seen a release in nearly four years and is nearly ten years old.
We already tried the move a couple years ago (which is where the comment came from) but it had to be reverted because Ubuntu 18.04 was still on life support. Now that that's gone let's move.
Making 3.8 the minimum also does make it easier to test. We e.g. can't CI test 3.6 compatibility anymore.
Here are your previous thoughts: https://github.com/ArduPilot/ardupilot/pull/23287#discussion_r1174275730 :)
Why is it that we want to move forward with our minimum Python version?
Doing so is likely to break a bunch of people's environments.
I don't understand why this is even a question Peter, like my mother always used to say, if "a bunch of people" jumped off a cliff would you follow them?
Incidentally, if you can show we're currently broken on 3.6.9 / 3.7.0 we could probably merge this with the 3.8.0 requirement.
Ping @tpwrules - testing requested here.
Hopefully you can show that we're just broken on <3.8 and we can just specify it as the minimum required version :-)
tridge does want the cygwin binary downloaded and tested, 'though.
ubuntu 20.04 that is the minimal we are supporting is python 3.8 so that would work as the basis, under this the pip install will probably failed to find the right packages version anyway
pymavlink is now broken on Python 3.6.9 (eg. Bionic):
bionic64: Complete output from command python setup.py egg_info:
bionic64: Traceback (most recent call last):
bionic64: File "<string>", line 1, in <module>
bionic64: File "/tmp/pip-build-6wWD6q/pymavlink/setup.py", line 15, in <module>
bionic64: from Cython.Build import cythonize
bionic64: ImportError: No module named Cython.Build
vagrant@ubuntu-bionic:~$ python3 --version
Python 3.6.9
The Linux build requires syntax features only in 3.8:
$ ./waf configure --board=linux
Setting top to : /home/tpwatson/ardusimstuff/ardupilot
Setting out to : /home/tpwatson/ardusimstuff/ardupilot/build
Autoconfiguration : enabled
Checking for program 'python' : /usr/bin/python3
Checking for python version >= 3.6.9 : 3.6.9
Setting board to : linux
Traceback (most recent call last):
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Scripting.py", line 159, in waf_entry_point
run_commands()
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Scripting.py", line 255, in run_commands
ctx = run_command(cmd_name)
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Scripting.py", line 239, in run_command
ctx.execute()
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Configure.py", line 159, in execute
super(ConfigurationContext, self).execute()
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Context.py", line 214, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Context.py", line 296, in recurse
user_function(self)
File "/home/tpwatson/ardusimstuff/ardupilot/wscript", line 579, in configure
cfg.get_board().configure(cfg)
File "Tools/ardupilotwaf/boards.py", line 1464, in configure
cfg.load('linux')
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Configure.py", line 257, in load
module = Context.load_tool(tool, tooldir, ctx=self, with_sys_path=with_sys_path)
File "/home/tpwatson/ardusimstuff/ardupilot/modules/waf/waflib/Context.py", line 735, in load_tool
__import__(x % tool)
File "Tools/ardupilotwaf/linux.py", line 17, in <module>
import linux_hwdef # noqa:501
File "<fstring>", line 1
(len(dev)=)
^
SyntaxError: invalid syntax
But our wscript is rather gigantic and I'm not sure how to check before triggering a syntax error in the general case. Do we just have to keep the wscript compatible with any Python? Or accept that old Pythons might give syntax errors before we can complain about the version?
Rebased to generate fresh artifacts to test
Took a quadplane and a copter for a basic spin. Looks fine.