Commit e9ca4c4
authored
fix(google-auth): add cryptography bound for Python 3.14 (googleapis#17649)
### Summary of Changes
Added `"cryptography >= 41.0.5; python_version >= '3.14'"` in `setup.py`
and `cryptography==41.0.5` in `testing/constraints-3.14.txt`.
### Rationale
In Python 3.14, the legacy `setuptools` / `pkg_resources` module was
removed from the standard build environment.
Older `cryptography` versions (`< 41.0`, including `google-auth`'s
default lower bound `38.0.3`) utilized `pkg_resources` in 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.3` fails with a `ModuleNotFoundError: No module named
'pkg_resources'` build error.
PyCA (Python Cryptography Authority) removed `pkg_resources` and updated
setuptools-rust build hooks in `cryptography 41.0.5+`.
Setting `"cryptography >= 41.0.5; python_version >= '3.14'"` ensures:
1. **Python 3.10–3.13**: `google-auth` continues to support
`cryptography >= 38.0.3` (zero breaking changes for existing users).
2. **Python 3.14+**: `pip` automatically selects `cryptography >=
41.0.5` so 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:
1. **In a Python 3.14 environment**:
```bash
pyenv activate py314
pip install --no-binary :all: "cryptography==38.0.3"1 parent e9c6265 commit e9ca4c4
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments