pyca/cryptography — pull request #1280 by Ayrx (2014-07-23 14:19:54+00:00)
Title: [WIP] Restructure backends

This is a WIP that fixes #858.

An overview of what this PR does.

1. Split the project into three primary packages. `cryptography_core`, `cryptography_openssl` and `cryptography_commoncrypto`. `cryptography_core` is the package that installs the `cryptography.` namespace.

2. The namespace for each individual backend will follow the format of `cryptography_*`. Each backend specific package will register an `entry_point` with the `cryptography_core` package.

3. `default_backend()` automatically combines the installed backends by enumerating the `entry_points` installed. (/cc @dstufft, is restricting packages to certain operating systems something we can do? If so I believe `is_available()` can be removed entirely.) This should allow other backends (like the potential `cryptography_libscrypt`) to be consumed from `default_backend()` automatically when installed.

Some things that still needs to be done.

- [ ] Doing the compile work on package install instead of module import.
- [ ] Working on getting the tests to pass. This *should* simply involve moving the backend specific tests to their own packages.
- [ ] Figure out how to retain backwards compatibility for the OpenSSL and CommonCrypto bindings and backends module path.

For point #3, I currently think that having stubs for `cryptography.hazmat.backends.openssl.backend` and the other relevant paths in `cryptography_core` and deprecating them in favor of downstream projects (such as pyopenssl) calling the `cryptography_*` package directly is the best path. Thoughts?

This is currently very much a WIP so you guys might want to hold off on the nitpicky stuff in favor of looking over the bigger picture first. :)