-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rm pycryptodome #141
base: master
Are you sure you want to change the base?
rm pycryptodome #141
Conversation
Scoped Keys are deprecated and pycryptodome is not pure python making it a problem for people wanting to `pip install keen` on some systems. pycryptodome is a dependency of only scoped keys. To make the tests pass, you'll need to have it installed but that is enabled via the test_requires within setup.py. A fun error message is displayed when anything scoped keys are imported. This may make `from keen import *` fail, but that's bad python to begin with so I don't feel very bad about that. This includes a documentation update reflecting the manual step required for the deprecated feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, but looks fine.
ie.args = (ie.args[0] + ' -- Scoped Keys are deprecated in favor' | ||
' of Access Keys. To use Scoped Keys anyway, run: ' | ||
'`pip install pycryptodome` and try this again.',) | ||
raise ie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will blow away the original stack, right? raise ie
in python 2 will blow away the stack anyway since you have to use the 3-arg raise
, and in python 3, by replacing the entire args
tuple we're disregarding any information previously stored on the exception except the message, right? In this case, maybe the message is enough, but if not, we could use the six
module's reraise
which I think forwards to the future
utils in python 2 and uses the raise ... from ...
and/or the with_traceback()
facility in python 3. Just a thought.
Neat. I didn't know about reraise.
…On Oct 25, 2017 6:33 PM, "Justin Mason" ***@***.***> wrote:
***@***.**** approved this pull request.
Minor comment, but looks fine.
------------------------------
In keen/scoped_keys.py
<#141 (comment)>
:
>
+try:
+ from Crypto.Cipher import AES
+except ImportError as ie:
+ ie.args = (ie.args[0] + ' -- Scoped Keys are deprecated in favor'
+ ' of Access Keys. To use Scoped Keys anyway, run: '
+ '`pip install pycryptodome` and try this again.',)
+ raise ie
This will blow away the original stack, right? raise ie in python 2 will
blow away the stack anyway since you have to use the 3-arg raise, and in
python 3, by replacing the entire args tuple we're disregarding any
information previously stored on the exception except the message, right?
In this case, maybe the message is enough, but if not, we could use the
six module's reraise which I think forwards to the future utils in python
2 and uses the raise ... from ... facility in python 3. Just a thought.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#141 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACitbywOx3fECfFiv7-BAJdED8O5_DMmks5sv9NLgaJpZM4QDU1s>
.
|
I'd like to give |
I am thinking I can also use environment markers and |
Scoped Keys are deprecated and pycryptodome is not pure python
making it a problem for people wanting to
pip install keen
onsome systems. pycryptodome is a dependency of only scoped keys.
To make the tests pass, you'll need to have it installed but that
is enabled via the test_requires within setup.py. A fun error
message is displayed when anything scoped keys are imported. This
may make
from keen import *
fail, but that's bad python to beginwith so I don't feel very bad about that.
This includes a documentation update reflecting the manual step
required for the deprecated feature.
Testing
Try running the test suite without pycryptodome installed. It should still succeed.
Try
import keen.scoped_keys
without pycryptodome installed. It should fail with a message.Related tickets
#131