SecurityInnovation / PGPy

Pretty Good Privacy for Python
BSD 3-Clause "New" or "Revised" License
313 stars 98 forks source link

Merge many outstanding PRs, add a bunch of type signatures, improve code quality #450

Open dkg opened 1 year ago

dkg commented 1 year ago

This PR collects many of the outstanding bugfix/cleanup PRs, plus #440 ("SOP" CLI functionality), and then also includes a bunch of type signature annotations. I offer this collection of changes all together because of some sequencing issues (e.g. collections.abc cleanup interacting with the PGPSignatures additions), and there were a few minor merge conflicts that i've resolved so no one else will have to.

A longer-term goal is to be able to deploy a typechecker to offer an additional layer of static analysis on the PGPy codebase, but the module is still far from clean when run through mypy. This is just a start.

The next bit of work i have queued after this, inspired by the typechecking cleanup, will offer some subtle but hopefully not dangerous API changes -- ones that i think shouldn't be a problem for most consumers of PGPy, but i want them to be vetted separately from this, so i'm offering this as a sort of checkpoint on the way there.

dkg commented 1 year ago

for reference, merging this PR would also close: #413, #427, #428, #437, #440, #442, #443, #444, #445, #446, #447, #448, and #449.

dkg commented 1 year ago

I'm continuing to work on this series, including more code cleanup without introducing any significant API changes, bu it's not ready to merge yet. I'll remove the "WIP" label when it's done.

dkg commented 1 year ago

I think this is ready for review. I'm continuing work on #451 separately