Skip to content

fix(deps): pin bcrypt<5 to fix passlib incompatibility#14

Merged
ulises-jeremias merged 1 commit into
mainfrom
fix/pin-bcrypt-lt-5
May 26, 2026
Merged

fix(deps): pin bcrypt<5 to fix passlib incompatibility#14
ulises-jeremias merged 1 commit into
mainfrom
fix/pin-bcrypt-lt-5

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Member

Summary

passlib 1.7.x cannot parse bcrypt 5.x version metadata — every example doing from passlib.context import CryptContext fails at import with (trapped) error reading bcrypt version (exit 1). This breaks X1 (examples execute) for 12_fastapi_complete/authentication_jwt and 12_fastapi_complete/oauth2.

Root cause

Dependabot PR #12 bumped bcrypt<5bcrypt<6. The validate-all-modules workflow excludes Dependabot PRs from running, so the regression landed on main silently. PR #13 (modules/ refactor) was the first non-Dependabot push to trigger CI on main, surfacing the bug.

Fix

  • pyproject.toml: revert pin to bcrypt<5 (both [project.dependencies] and [project.optional-dependencies.all])
  • .github/dependabot.yml: add ignore rule for bcrypt >=5.0 so this cannot silently land again until passlib publishes a compatible release

Test plan

  • Local: pip install -e ".[all]" resolves with bcrypt 4.x
  • CI: validate-all-modules returns to 16/16 modules passed (previously 15/16)

passlib 1.7.x cannot read bcrypt 5.x version metadata, causing every
example that does `from passlib.context import CryptContext` to fail
with "(trapped) error reading bcrypt version" (exit 1) at import time.

This was introduced silently when Dependabot PR #12 bumped bcrypt
from <5 to <6 (workflow excludes Dependabot from CI, so the bump
landed on main without surfacing the regression). The next non-
Dependabot CI run on main (PR #13 — modules/ refactor) caught it.

Fix:
- pyproject.toml: pin bcrypt<5 in both [project.dependencies] and the
  [project.optional-dependencies.all] extras
- .github/dependabot.yml: add ignore rule for bcrypt >=5.0 until
  passlib publishes a compatible release, so this regression cannot
  silently land again

Restores 12_fastapi_complete/authentication_jwt and 12_fastapi_complete/oauth2
X1 to pass in CI (16/16 modules clean expected).
@ulises-jeremias ulises-jeremias merged commit 663b3e9 into main May 26, 2026
2 checks passed
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.

1 participant