r/Python • • Oct 30 '26 • Heartwarming 1

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:

  • PasswordHash representing both algorithm configuration and a produced hash
  • PasswordHash.using creating 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

166 Upvotes

25 comments sorted by

View all comments

Show parent comment

13

u/nicholashairs Oct 30 '26

+1

Maintainer of python-json-logger here, which I took over from the original maintainer is similar circumstances (post pinned in my profile).

Something I'd recommend doing is regardless of the size of changes that you make for your first new release on the project is to bump the major version so that those that do not wish to use the new maintainer code can easily do so by pinning their version.

I'm not familiar with passlib, but as another solo maintainer of an important library I'm happy to help out and share experience where I can.

Good luck!

3

u/Amazing_Learn Oct 30 '26

Thanks, that's more or less what I wanted to do - make a couple of maintenance releases, and then bump a major version if I end up refactoring the project.

8

u/nicholashairs Oct 31 '26 edited Oct 31 '26

In case it wasn't clear, my recommendation is to do the major version bump for those maintenance releases