moving OpenEmbedded-core to Python 3
Hello everyone,
we want to deprecate Python 2 in oe-core and set Python 3 as the default, preferred choice. What does this mean?
1) Introducing new Python 2 dependencies via new recipes or additional DEPENDS etc. in existing recipes will be discouraged: you'll have to provide a reason.
2) Bitbake itself is at the moment Python 2 only - which will be addressed.
3) OE-core recipes that are currently dependent on Python 2 will be moved to Python 3 whenever possible (e.g. when nothing in oe-core requires them to be built against python 2). This may break some of your code, so please do try any patchsets before they land in master (or stable release), and suggest alternatives.
4) Of course, there is a large mass of Python 2 code out there, which may never be ported to Python 3, so Python 2 will continue to be provided at least until it's no longer supported upstream (the current date is 2020).
I'll prepare an initial patchset for review, so please keep an eye on it.
Thanks,
Alex
Quoted 4 lines · Alexander Kanavin
Hello everyone,
we want to deprecate Python 2 in oe-core and set Python 3 as the default, preferred choice. What does this mean?
What is the target to make Python3 default, 2.2?
Quoted 4 lines
1) Introducing new Python 2 dependencies via new recipes or additional DEPENDS etc. in existing recipes will be discouraged: you'll have to provide a reason.
Will there be any kind of QA warning for these dependencies? this will help scope how many recipes need to be looked at. there are a lot of layers out there.
Quoted 2 lines
2) Bitbake itself is at the moment Python 2 only - which will be addressed.
What will the env setup script display then?
Quoted 7 lines
3) OE-core recipes that are currently dependent on Python 2 will be moved to Python 3 whenever possible (e.g. when nothing in oe-core requires them to be built against python 2). This may break some of your code, so please do try any patchsets before they land in master (or stable release), and suggest alternatives.
Quoted 6 lines
4) Of course, there is a large mass of Python 2 code out there, which may never be ported to Python 3, so Python 2 will continue to be provided at least until it's no longer supported upstream (the current date is 2020).
I'll prepare an initial patchset for review, so please keep an eye on it.
thanks for doing the the initial work.
- armin
Quoted 4 lines
Thanks,
Alex
Quoted 4 lines · On 04/25/2016 06:11 PM, akuster808 wrote:
Quoted 2 lines
we want to deprecate Python 2 in oe-core and set Python 3 as the default, preferred choice. What does this mean?
What is the target to make Python3 default, 2.2?
There is no specific target when the task is 'totally done', it's an ongoing activity that will span multiple releases. I plan to have the initial patchset merged into master in 2.2 cycle, but there's more work to be done when upstream components currently stuck in python 2 will finally more to python 3, and fixing up any loose ends, obscure regressions etc.
Quoted 7 lines
Quoted 3 lines
1) Introducing new Python 2 dependencies via new recipes or additional DEPENDS etc. in existing recipes will be discouraged: you'll have to provide a reason.
Will there be any kind of QA warning for these dependencies? this will help scope how many recipes need to be looked at. there are a lot of layers out there.
I think there will not be. There are too many recipes in oe-core that are python 2 only (and even more outside of oe-core), and it's too much work to add warning suppressions to them all. Also, we don't want to force python 3 transition on anyone outside of oe-core, people can do it at their own pace and schedule.
Quoted 3 lines
Quoted 1 line
2) Bitbake itself is at the moment Python 2 only - which will be addressed.
What will the env setup script display then?
This is a question for bitbake developers I guess, not me.
Alex
Quoted 17 lines · Alexander Kanavin
Hello everyone,
we want to deprecate Python 2 in oe-core and set Python 3 as the default, preferred choice. What does this mean?
1) Introducing new Python 2 dependencies via new recipes or additional DEPENDS etc. in existing recipes will be discouraged: you'll have to provide a reason.
2) Bitbake itself is at the moment Python 2 only - which will be addressed.
3) OE-core recipes that are currently dependent on Python 2 will be moved to Python 3 whenever possible (e.g. when nothing in oe-core requires them to be built against python 2). This may break some of your code, so please do try any patchsets before they land in master (or stable release), and suggest alternatives.
Quoted 6 lines
4) Of course, there is a large mass of Python 2 code out there, which may never be ported to Python 3, so Python 2 will continue to be provided at least until it's no longer supported upstream (the current date is 2020).
I'll prepare an initial patchset for review, so please keep an eye on it.
Can you clarify the scope, are you addressing the case where target images would prefer python3
and you are making sure that packages that use python on target are ready for using it.
bitbake itself is a separate task but then we do write scriptlets that are executed as part of
build, are you addressing those too ?
Thirdly, there is general pythonic code in metadata meant to control build policies
Which of these are you addressing specifically.
Quoted 8 lines
Thanks,
Alex
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 4 lines · Khem Raj
Can you clarify the scope, are you addressing the case where target images would prefer python3
and you are making sure that packages that use python on target are ready for using it.
There is no way to set a 'preference' for Python 3. Either version of Python is pulled into images either through dependencies, or explicit inclusion into some package list.
I'm going to move recipes that are dependent on Python 2 to Python 3, whenever possible. I'm not porting the upstream code from Python 2 from Python 3, just configuring the recipes to use Python 3, when the Python code in them has already been ported.
Quoted 3 lines
bitbake itself is a separate task but then we do write scriptlets that are executed as part of
build, are you addressing those too ?
Not sure what you mean here exactly, but if the scriptlets are executed by bitbake, then I'm not addressing that.
Quoted 2 lines
Thirdly, there is general pythonic code in metadata meant to control build policies
Again, can you provide an example?
Quoted 1 line
Which of these are you addressing specifically.
Please start using the question mark (?), so I can see more easily what is a question when responding.
Thanks,
Alex
Quoted 13 lines · Alexander Kanavin
Quoted 4 lines · Khem Raj
Can you clarify the scope, are you addressing the case where target images would prefer python3
and you are making sure that packages that use python on target are ready for using it.There is no way to set a 'preference' for Python 3. Either version of Python is pulled into images either through dependencies, or explicit inclusion into some package list.
I'm going to move recipes that are dependent on Python 2 to Python 3, whenever possible. I'm not porting the upstream code from Python 2 from Python 3, just configuring the recipes to use Python 3, when the Python code in them has already been ported.
OK, that is a safer bet.
Quoted 6 lines
Quoted 4 lines
bitbake itself is a separate task but then we do write scriptlets that are executed as part of
build, are you addressing those too ?Not sure what you mean here exactly, but if the scriptlets are executed by bitbake, then I'm not addressing that.
I was referring to bitbake itself needs python2 to run but if we have code like classes etc. or external fetchers with assume python2 since bitbake is python2
Quoted 5 lines
Quoted 3 lines
Thirdly, there is general pythonic code in metadata meant to control build policies
Again, can you provide an example?
Snippets are all around in metadata where we use python snippets inside recipes or configuration metadata. in general we should be using python3 more, but scoping these changes clearly would help to set the expectations from user point of view.
Quoted 11 lines
Quoted 2 lines
Which of these are you addressing specifically.
Please start using the question mark (?), so I can see more easily what is a question when responding.
Thanks,
Alex