-
Notifications
You must be signed in to change notification settings - Fork 44
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
Full Python 3 compatibility #61
Conversation
@amir-qayyum-khan (or maybe @giocalitri if you have some downtime) can you look at this? |
I will take a look |
from urlparse import urlparse | ||
from urllib import urlencode | ||
except ImportError: # Python 3 | ||
from urllib.parse import urlparse, urlencode |
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.
I think we should use the six library for these imports
@GuillaumeDerval thanks a lot for your contribution, we really appreciated. I had some minor comments that actually made me think I should probably fix some other minor things in this project eventually. Thanks again. |
I applied most of your comments, and updated the README :-) Would you like that I squash the commits together? |
Thanks for the changes. |
@giocalitri I took a look at MIT-licensed code (here and here) and it's compatible with our BSD license. It's fine to merge from a licensing perspective. I still need to find a good test case. |
047ae47
to
506b25e
Compare
Any news on this? It would be nice a py3 compatible version on pip :-) |
@giocalitri can we merge & release this? |
I was about to raise an issue to address this very issue - do we have any movement on this? |
It's passed code review, but we haven't had time to do a functional test. Would you mind giving this branch a try and letting us know if it works for you? |
It installs just fine in a virtualenv, however it's not installing into a docker container: Create a Dockerfile in an otherwise empty directory FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
git \
python3.5 \
python3-pip
# Load Python modules from requirements.txt
RUN pip3 install git+https://github.com/GuillaumeDerval/pylti@py3-restore#egg=PyLTI then run produces an error:
|
We needed to add
to the Dockerfile, and then we could add The app installs, and django-lti-provider installs fine. I've not yet tested any LTI functionality though. |
I'm trying to use this library in Python 3 - can someone merge this and make a new release? |
FYI - until this is merged and released, I've forked pylti with these changes and made a new release here: https://github.com/ccnmtl/pylti/releases/tag/0.5.0 |
I'm sorry that this PR has been neglected @nikolas. Were you able to use this branch as is, or did you have to make further changes? |
No problem, it happens. Yeah, this branch is working as is for me, if that helps. |
I am going to merge this. |
I spent some hours to make PyLTI pass the tests again with Python 3 (tested with 2.7, 3.4 and 3.5, I'm not sure it will pass with Python 3.1, 3.2 and 3.3 since they don't support the u prefix from what I remember)
I dropped oauth, since oauth2 is a fork, but oauth2 itself has some problems, which I had to fix manually (see classes SignatureMethod_HMAC_SHA1_Unicode, SignatureMethod_PLAINTEXT_Unicode, Request_Fix_Duplicate) (joestump/python-oauth2#207 joestump/python-oauth2#197).
It fixes #58 as a bonus too.
100% of the test passes with both python 2.7, 3.4 and 3.5, and the lib was tested on edX with Python 3.5, it works flawlessly.