fix(google-auth): add cryptography bound for Python 3.14#17649
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the cryptography dependency requirements in setup.py to use version 41.0.5 or higher for Python 3.14 and above, and introduces a new constraints file constraints-3.14.txt for Python 3.14 testing. Feedback on the changes highlights that setuptools is included in the new constraints file but is missing from the primary dependency specification in setup.py, which violates repository guidelines.
| # Lower-bound constraints for Python 3.14 core dependencies. | ||
| # Pins cryptography==41.0.5 for CPython 3.14 C-extension compatibility. | ||
| pyasn1-modules==0.2.1 | ||
| setuptools==40.3.0 |
There was a problem hiding this comment.
According to the repository's general rules, libraries listed in constraints files must be present in the project's primary dependency specification (e.g., setup.py). setuptools is not listed in the primary DEPENDENCIES of setup.py. Please verify if setuptools should be removed from this constraints file or if it needs to be added to the primary dependency specification.
References
- When reviewing dependency changes, verify that libraries listed in constraints files are present in the project's primary dependency specification (e.g., setup.py) by checking the entire file, as they may be located outside the current diff window.
6ba0bfc to
1aa24a1
Compare
1aa24a1 to
5b3c6f5
Compare
Summary of Changes
Added
"cryptography >= 41.0.5; python_version >= '3.14'"insetup.pyandcryptography==41.0.5intesting/constraints-3.14.txt.Rationale
In Python 3.14, the legacy
setuptools/pkg_resourcesmodule was removed from the standard build environment.Older
cryptographyversions (< 41.0, includinggoogle-auth's default lower bound38.0.3) utilizedpkg_resourcesin their build hooks. When building from source (sdist) or installing on custom runtimes (such as Alpine Linux, ARM64, or non-manylinux environments),cryptography 38.0.3fails with aModuleNotFoundError: No module named 'pkg_resources'build error.PyCA (Python Cryptography Authority) removed
pkg_resourcesand updated setuptools-rust build hooks incryptography 41.0.5+.Setting
"cryptography >= 41.0.5; python_version >= '3.14'"ensures:google-authcontinues to supportcryptography >= 38.0.3(zero breaking changes for existing users).pipautomatically selectscryptography >= 41.0.5so installations and builds succeed cleanly across all platforms and architectures.How to Reproduce
To reproduce the build failure on Python 3.14 without this fix:
pyenv activate py314 pip install --no-binary :all: "cryptography==38.0.3"