-
Notifications
You must be signed in to change notification settings - Fork 104
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
More python3 fixes #894
More python3 fixes #894
Conversation
* Use get_text_contents() to ensure we get strings. * Decode bytes from external commands. * Do not open text files in binary mode.
execfile() does not work on python3
Everything did build and this patch only touches the scons files so I'm not quite sure why the tests failed. |
It looks like the culprit is astropy 2.0. The default pip version for astropy switched from 1.3 to 2.0, and I'm guessing there must be something in there that is breaking some of the tests. @jmeyers314 It's also happening with your PR. Could you take a look? The failures seem to be mostly with tests that you wrote, so you are probably best equipped to evaluate whether (and how) the test needs to change or if there is something in the backend code that needs to be fixed to accommodate their change. (My off-the-cuff guess is it's something with the astropy.units module.) @timj In the meanwhile, if you want to change the pip install line in .travis.yaml to use astropy==1.3, that would probably make this PR pass the tests. |
Looking at this now... Looks like at least part of the problem is that Planck's constant has changed! (maybe related to the upcoming redefinition of the kilogram?)... Working on a fix... |
@rmjarvis I'm curious: where did you find that plot? I found this: http://www.codata.org/uploads/RMP.88.035009.pdf But that has a somewhat different version. |
Thanks! |
@@ -12,7 +12,8 @@ try: | |||
except: | |||
# If SCons is using an old python (2.4 is relatively common still), then the above may fail. |
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.
One thing I forgot to say was that the above code always fails so I'm not entirely sure what the purpose of the try block is. The comment is obviously out of date.
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.
Good point. The nada()
call looks like maybe a way to force the except block for testing. git blame
says it was me that added it, so probably I just forgot to remove it after testing that the except block was working properly. Oops. Did now. (Of course, the "2.4 is relatively common still" comment is indeed out of date. None of my systems have that anymore.)
This is the second batch of fixes required to build GalSim with a Python3 SCons.
I have successfully built GalSim using
scons-3.0.0.alpha.20170614.tar.gz
with Python3 but there is one issue I encountered with building of boost-python because those include files have bad Unicode in them for an author string. I've reported this upstream (and I have a local fix).