8000 [15.0][REV][FIX] Pin cryptography to keep compatibility with Odoo's pyopenssl==19.0.0 by em230418 · Pull Request #3286 · OCA/server-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[15.0][REV][FIX] Pin cryptography to keep compatibility with Odoo's pyopenssl==19.0.0 #3286

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

Open
wants to merge 3 commits into
base: 15.0
Choose a base branch
from

Conversation

em230418
Copy link
Contributor

Reverted commit disallows to install auto_backup, when using offical Odoo 15.0 docker image, which is based on bullseye [1].
The bullseye has following python packages:

  • cryptography 3.3.2 with security patches [2]
  • pyopenssl 20.0.1 [3]

[1] https://github.com/odoo/docker/blob/5fb6a842747c296099d9384587cd89640eb7a615/15.0/Dockerfile#L1
[2] https://packages.debian.org/bullseye/python3-cryptography
[3] https://packages.debian.org/bullseye/python3-openssl

…sl==19.0.0"

Reverted commit disallows to install auto_backup, when using offical Odoo 15.0
docker image, which is based on bullseye [1].
The bullseye has following python packages:

- cryptography 3.3.2 with security patches [2]
- pyopenssl 20.0.1 [3]

[1] https://github.com/odoo/docker/blob/5fb6a842747c296099d9384587cd89640eb7a615/15.0/Dockerfile#L1
[2] https://packages.debian.org/bullseye/python3-cryptography
[3] https://packages.debian.org/bullseye/python3-openssl
@em230418
Copy link
Contributor Author

Hello, @sbidoul! Bumping you as maintainer of oca-ci. Could you please install packages from https://github.com/odoo/odoo/blob/15.0/requirements.txt and then install odoo itself?

Copy link
Member
@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

There still has to be some sort of pin if we don't want to run into odoo/odoo#99829 again. Have a look OCA/server-auth#429

@em230418
Copy link
Contributor Author

There still has to be some sort of pin if we don't want to run into odoo/odoo#99829 again. Have a look OCA/server-auth#429

server-auth is other repository and I don't see problems with pining cryptography<37 in that repository.

@em230418
Copy link
Contributor Author

There still has to be some sort of pin if we don't want to run into odoo/odoo#99829 again.

First python3 -m pip install requirements.txt from https://github.com/odoo/odoo/blob/15.0/requirements.txt and then install odoo. That is the thing I suggested to @sbidoul in my message to him in this thread.

@StefanRijnhart
Copy link
Member

Given that @sbidoul is actually a maintainer of Python's pip I would say he's among those of us in the OCA that is most knowledgeable about the installation of python requirements. Maybe you can reconsider adopting his own approach to this problem (in OCA/server-auth#429).

@em230418 em230418 force-pushed the 15.0-auto_backup-unpin branch from a39cd21 to 805393c Compare May 15, 2025 08:41
@em230418
Copy link
Contributor Author
em230418 commented May 15, 2025

Stéphane Bidoul, sorry for pinging for hasty reasons. In oca-ci packages are already installed like I assumed and asked.

@em230418 em230418 requested a review from StefanRijnhart May 15, 2025 08:52
Copy link
Member
@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

The reason will be displa 8000 yed to describe this comment to others. Learn more.

Sorry, I think having '<37' is way better than the current pinning, but I don't agree removing the pin entirely.

@em230418 em230418 force-pushed the 15.0-auto_backup-unpin branch from 805393c to f622afc Compare May 15, 2025 09:18
@StefanRijnhart
Copy link
Member

For the record, my suggestion is to follow OCA/server-auth#429 in adding '<37' in requirements.txt, not in test-requirements.txt.

@em230418
Copy link
Contributor Author

For the record, my suggestion is to follow OCA/server-auth#429 in adding '<37' in requirements.txt, not in test-requirements.txt.

requirements.txt is autogenerated from module. Adding "cryptography<37" to auto_backup manifest is not correct. It is not auto_backups' scope to deal with odoo's subsubdependency.

@em230418
Copy link
Contributor Author

It is not auto_backups' scope to deal with odoo's subsubdependency.

Pardon. It is not auto_backups' scope to deal with its own subsubdependency. For that we already have requirements.txt from odoo/odoo or OCA/OCB.

@sbidoul
Copy link
Member
sbidoul commented May 15, 2025

I wrote an explanation of the root cause of a similar problem in OCA/server-auth#424 (comment)

I also agree an exact pin must absolutely be avoided.

It is not auto_backups' scope to deal with its own subsubdependency

I tend to agree with that. And TBH I don't quite remember right now why I put the upper bound in the manifest in OCA/server-auth#429. I can see a benefit for some users, but also a downside for users who would want to use cryptography>=37 and take care of installing a compatible pyopenssl.

So I'm +1 with putting the upper bound on cryptography in test-requirements.txt and see how it goes.

BTW, these topics are super complex. For instance python3.8 -m pip install -r odoo/requirements.txt pysftp lead to a valid solution with cryptography 2.6.1 (both with pip and uv pip). These SAT solvers can lead to different valid solutions and which they prefer is not guaranteed in any documentation.

@sbidoul
Copy link
Member
sbidoul commented May 15, 2025

For the record, my suggestion is to follow OCA/server-auth#429 in adding '<37' in requirements.txt, not in test-requirements.txt.

@StefanRijnhart as I don't remember why I preferred that too in 2022 and now putting it in test-requirements.txt sounds somewhat better to me, do you have specific arguments in mind yourself?

@em230418 em230418 force-pushed the 15.0-auto_backup-unpin branch from f622afc to 71a3a3c Compare May 16, 2025 04:18
@em230418 em230418 requested a review from sbidoul May 16, 2025 05:27
Copy link
Member
@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

@sbidoul While it not being auto_backup's responsibility, as per OCA's implementation the dependency from the manifest with or without version ends up in requirements.txt, and this will be the basis for many deploys, either directly or indirectly, for the installation of these dependencies. I consider therefore adding the version to auto_backup's manifest as a valid workaround (or helpful guidance) for the indeed 'super complex' issue of preventing the breaking version of cryptography from being installed on any instance.
Then again, I respect your knowledge and authority on the issue so I will retract my blocking review and may abstain from further reviews.

@StefanRijnhart StefanRijnhart self-requested a review May 16, 2025 08:52
StefanRijnhart

This comment was marked as duplicate.

@StefanRijnhart StefanRijnhart dismissed their stale review May 16, 2025 08:55

As per the above

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.

3 participants
0