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
Automatically run 2to3 when installing on Python 3 #3
Conversation
Looking at the Travis build, this prevented pandas from being installed - https://travis-ci.org/benhamner/Metrics/builds/5992585 ERROR: test.test_auc (unittest.loader.ModuleImportFailure)ImportError: Failed to import test module: test.test_auc Can you fix it? |
I think this may be a misconfiguration of Travis, rather than an issue of my changes breaking something, because I noticed that the build details say that it can't find requirements.txt, which is what tells it to install pandas in the first place. It might be necessary to change requirements = [x.strip() for x in open("requirements.txt")] to requirements = [x.strip() for x in open(os.path.join(os.path.dirname(__file__), "requirements.txt"))] so that it looks for requirements.txt in the right place, but this shouldn't have changed from what I did. I'll make the change on my end and see if your automatic travis build passes then. |
Well, that doesn't appear to have cut it. I think it's something you have to change with the Travis config, because of the error message "Could not locate requirements.txt. Override the install: key in your .travis.yml to install dependencies." |
This should fix things for installing python dependencies.
Seems like what I added previously was unnecessary, so I reverted that. I also changed this so it wasn't hard-coded for python 2.7.
I believe the way things were setup before my deactivating and re-activating the virtual environment lead to it using Python 2.7 even when it said it was going to use Python 3.3. For now, I can't come up with a good way to test on Python 3 without recompiling numpy each time, which is insanely time consuming.
Alright, after a lot of messing around with it, I believe I've fixed the YAML file. Annoyingly, there doesn't seem to be a simple way to get numpy working with Python 3.3 on Travis, so I gave up on getting this testing working for 3.3. It just tests 2.7, but the tests all pass now. |
I hate to be a pest, but this PR should be good to go now, and I'd really like to not have to install this using a custom git repository URL, so could you please pull this? |
Thanks for the reminder, merged! |
Automatically run 2to3 when installing on Python 3
Could you please update the version of ml_metrics that is on pypi to include these fixes? You may have to bump the version number up to get it to recognize the changes. Currently when I try to install via pip with python 3 it does not actually run 2to3 automatically like it's supposed to. |
I added a couple lines to setup.py to make 2to3 get run automatically by Distribute on Python 3 because we were running into some issues installing this on 3.3. I just followed the recommended steps here.