Skip to content
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

Python 3 support #21

Open
vsoch opened this issue Dec 2, 2015 · 4 comments
Open

Python 3 support #21

vsoch opened this issue Dec 2, 2015 · 4 comments
Assignees

Comments

@vsoch
Copy link
Member

vsoch commented Dec 2, 2015

Advice from @rwblair

http://python-future.org/compatible_idioms.html

@tangi75
Copy link
Contributor

tangi75 commented Oct 24, 2016

Here are the patches I've made to make expfactory-python work on Python 3 (no guarantee of completeness but you can run the tests) :

cd "python -c 'import site; print(site.getsitepackages()[0])'/expfactory/"
find . -name "*.py" | xargs sed -i -e 's/iteritems/items/g'
find . -name "*.py" | xargs sed -i -e 's/print \(.*\)$/print(\1)/'
find . -name "*.py" | xargs sed -i -e 's/SimpleHTTPServer/http.server/'
find . -name "*.py" | xargs sed -i -e 's/SocketServer/socketserver/'
sed -i -e 's/from exceptions import ValueError//' survey.py
sed -i -e 's/urllib2/urllib.request/' utils.py
sed -i -e 's/__init__/expfactory.__init__/' utils.py
sed -i -e '84s/"rb"/"r"/' utils.py
sed -i -e 's/basestring/str/' utils.py
sed -i -e '322s/^./ /' survey.py # replace leading tab with 8 spaces

@vsoch
Copy link
Member Author

vsoch commented Oct 24, 2016

This is very helpful! If you've made the changes, would you like to do a pull request? If not, we can definitely get this tested soon. Just a heads up - we are going to be going into production of version 2.0 in about a month or so, which will hopefully give you much better tools for deploying these experiments.

@vsoch
Copy link
Member Author

vsoch commented Oct 24, 2016

In case you haven't gotten your quota yet :)

@tangi75
Copy link
Contributor

tangi75 commented Oct 25, 2016

I just did the minimum hacks to make expfactory work on Python3 without caring about backward compatibility with Python2. I'll try to do a cleaner thing this week and submit a pull request.

@vsoch vsoch self-assigned this Oct 27, 2017
@vsoch vsoch added this to the Expfactory 2.0 (Singularity) milestone Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants