odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[14.0] [FIX] requirements.txt Python 3.9 compatibility

Open yaazkal opened this issue 2 years ago • 10 comments

This ensures the correct installation of gevent and greenlet when Python 3.9 is the version on the system. See issues #105084

Description of the issue/feature this PR addresses:

Installing on a system running Python 3.9.x it takes older versions of gevent and greenlet that seems to be not compatible with 3.9.x

Current behavior before PR: gevent won't install

Desired behavior after PR is merged: gevent will be installed successfully using a version compatible with python 3.9.x


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

yaazkal avatar Nov 13 '22 20:11 yaazkal

Pull request status dashboard

robodoo avatar Nov 13 '22 20:11 robodoo

Note this need to be replicated to 15 and 16

yaazkal avatar Nov 13 '22 22:11 yaazkal

Your fix only applies if the python version is exactly 3.9 so I don't think it will fix any of the issue you linked in the description.

The current version of the requirement is not correct since the 3.9 and 3.9.x versions of python won't have the same requirements. But looking at debian bullseye requirements greenlet==0.4.17 and gevent==20.9 are correct for python 3.9.2

https://packages.debian.org/bullseye/python3 https://packages.debian.org/bullseye/python3-greenlet https://packages.debian.org/bullseye/python3-gevent

So a correct fix would be to also change 3.9 to 3.10 in your case I think. I wont fix 3.10 issue but it may fix some 3.9.x one.

< 3.10
>= 3.10

@d-fence do you agree?

Xavier-Do avatar Nov 14 '22 11:11 Xavier-Do

Thanks @Xavier-Do for the Feedback. I didn't know Odoo where so Debian dependent. I was thinking more on Python versions than Debian specific packages, if this is the case, you can ignore my PR and my comments.

If you happen to have Python 3.9 on a different system, gevent will not compile/install as in the issues that I refer too.

That said, for Python 3.9 has more sense to use gevent==21.8.0 and therefor greenlet==1.1.2

That way you can even install Odoo on other unix-like systems like FreeBSD.

yaazkal avatar Nov 14 '22 15:11 yaazkal

Actually we are just trying to align on ubuntu/debian package version for requirements. This allows to run odoo installing the debian package without requirements. But requirements should be possible ton install.

The pr you are linking are talking about the 3.10 version of python and as I said your fix will only have an effect if the python version is exactly 3.9. If it is 3.9.2, it won't change anything. But we expect to have the lower versions of gevent and greenlet in [3.9,3.10[

Xavier-Do avatar Nov 14 '22 15:11 Xavier-Do

Thanks again @Xavier-Do. I've tested the patch running Python 3.9.15 on a system and it takes gevent==21.8.0 and greenlet==1.1.2 which is what is expected, so I guess it does work not only having exactly python 3.9

Now, about the Debian packages alignment I have a question (offtopic): wouldn't be possible to deal with them only at the .deb configuration rather than here in the python requirements? As of today it's hard to install Odoo in other unix like systems or even in other linux kernel based OS or in Windows. I mean, I guess this file is to deal with python dependencies, not OS python packages.

PS: I've unliked the issues talking about python 3.10 since it's not my intention for this patch. Also updated this PR description. This patch is to correctly install gevent in 3.9.x

yaazkal avatar Nov 14 '22 16:11 yaazkal

I may misunderstand the version behaviour in requirement I need to check that. We may test that on a debian with python 3.9.2

We try to align to the deb versions so that the requirement is as close as possible as a install from debian package, in order to have the same features/deprecation warnings. If a new feature is added in the last pip package we may use it without noticing that it isn't available in the corresponding debian package, and odoo should run without pip requirements ;)

Xavier-Do avatar Nov 15 '22 10:11 Xavier-Do

Thanks @Xavier-Do for answering back.

Do you want me to open extra PR for 15 and 16?

yaazkal avatar Nov 17 '22 00:11 yaazkal

No need to create pr, the forwardport bot will do that automatically if we merge this one.

As I said we are trying to follow main version of debian and ubuntu for requirements. In debian bullseye the python version is 3.9.1 and the gevent version is 20.9.0-2 I tried locally in a clean debian bullseye docker image and gevent 20.9.0 was installed without any issue. What error do you have?

EDIT. I see that the only remaining linked issue is a windows one. Do you have the issue on windows?

Xavier-Do avatar Nov 17 '22 11:11 Xavier-Do

I don't have it on windows but for sure it will happen there. I'm trying on FreeBSD. I didn't created an issue for FreeBSD but this PR.

yaazkal avatar Nov 18 '22 14:11 yaazkal

Dear @yaazkal,

Thank you for your report but we are closing it due to inactivity. We apology if we could not look at your request in time. If your report still makes sense, don't hesitate to reopen a new one. We will try to check it as soon as possible.

This is an automated message.

C3POdoo avatar Apr 16 '24 08:04 C3POdoo