fix: upgrade boto3 and pin cryptography/pyopenssl for Python 3.14 compatibility#26
fix: upgrade boto3 and pin cryptography/pyopenssl for Python 3.14 compatibility#26AssemBahnasy wants to merge 2 commits into
Conversation
Confidence Score: 4/5The cryptography pin is too tight and will cause resolver conflicts in environments with other packages requiring cryptography 43+. The pyproject.toml Reviews (2): Last reviewed commit: "fix: use compatible-release pins (~=) fo..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR updates Python dependencies to prevent startup crashes on Python 3.14 caused by an import chain involving older botocore/urllib3.contrib.pyopenssl and incompatible pyopenssl/cryptography combinations.
Changes:
- Upgrades
boto3to>=1.35.0to pick upbotocorebehavior compatible withurllib32.x (removing the legacypyopensslcontrib import path). - Adds explicit minimum versions for
cryptographyandpyopensslto avoid incompatibilities withcryptography42.x.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
On Python 3.14, importing
s3_backup_settingscrashes at startup with:AttributeError: module 'lib' has no attribute 'GEN_EMAIL'
The failure chain is:
boto3~=1.34.143→botocore.httpsession→urllib3.contrib.pyopenssl→OpenSSL.crypto→ crashThe
GEN_EMAILconstant was removed incryptography42.x. The old pinnedboto3version pulls in an olderbotocorethat unconditionally importsurllib3.contrib.pyopenssl, which in turn loadspyopenssl— and any installedpyopensslbuilt against the oldcryptographyABI fails to initialise.This makes the entire site unable to boot on Python 3.14, since Frappe loads doctype controllers during the session boot sequence.
Changes
boto3~=1.34.143→boto3>=1.35.0—botocore1.35+ targetsurllib32.x, which removed thepyopensslcontrib module entirely, cutting the import chain at its root.cryptography>=42.0.0— ensures thecryptographylibrary is new enough thatpyopensslcan initialise correctly even if it ends up installed as a transitive dependency.pyopenssl>=24.0.0— the first release series compatible withcryptography42.x.Testing
Verified by deploying to a Frappe Cloud site running Python 3.14 — site boots and the S3 Backup Settings doctype loads without error.