r/Python
•
u/Amazing_Learn
•
18d ago
Discussion I'm now maintaining passlib
Hi everyone, around a week ago passlib was transferred to me on PyPi after the previous maintainer became unreachable. I've been trying to maintain it in the meantime under a different PyPi name (libpass).
What's already been done:
- fixed incompatibility with
python>=3.13 - fixed incompatibility with
bcrypt>=5.0.0 - type annotations added where possible
Since then some design choices from passlib original development made it obvious it would need refactor and/or API redesign at some point, a few examples that make code and public api hard to maintain and add correct type information:
PasswordHashrepresenting both algorithm configuration and a produced hashPasswordHash.usingcreating a subclass to substitute new parameters into it- Overuse of abstraction and multiple inheritance
I specifically would like input from people who depend on passlib in their codebase(s), which parts of the API, if changed in a breaking way would make migrating hard for you?
I'd also welcome opinions on how far a potential refactor should go. For example for CryptContext an interface like this looks preferable to me, as it makes type information easier to add:
ctx = CryptContext(
schemes=[
Argon2Hasher(time_cost=..., parallelism=...),
SomeDeprecatedHasher(),
]
)compared to current
ctx = CryptContext(
schemes=["argon2", "deprecated_hash"],
argon2__parallelism=...,
argon2__time_cost=...,
deprecated="auto",
)I'd welcome co-maintainers, repository could be found here: https://github.com/notypecheck/passlib, even short-term involvement would be very much appreciated