Repository navigation
Fixes for Python 3.7 - #7617
Fixes for Python 3.7#7617
Conversation
Python 3.7.0 (default, Jun 28 2018, 18:00:41) [GCC 8.1.1 20180531] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import astropy >>> dir(astropy) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'list' object is not callable
|
Hi there @saimn 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
|
Hmm, annoying to have a regression like this, floating point operations should be stable. From a practical perspective I can't see any problem in using |
|
@saimn - agreed with @taldcroft that |
|
@mhvk @taldcroft - Ok, thanks for the input, I have updated the test with |
mhvk
left a comment
There was a problem hiding this comment.
PR looks good; just a small comment on a comment.
|
|
||
| from types import ModuleType as __module_type__ | ||
| # Clean up top-level namespace--delete everything that isn't in __dir__ | ||
| # Clean up top-level namespace--delete everything that isn't in __dir_inc__ |
There was a problem hiding this comment.
Must admit I find this auto-cleanup bad form, but that's somewhat out of scope of this PR!
There was a problem hiding this comment.
Not really a cleanup, I had to change the use of __dir__ to list the attributes that shall not be deleted because setting a list to __dir__ no more works.
There was a problem hiding this comment.
@saimn - I meant that I found the whole stanza rather bad form, not your change to it! It just seems that by being a bit more careful in the code itself, one can avoid introducing these unwanted things in the namespace (or delete them after their use). Anyway, as said, definitely out of scope here!
There was a problem hiding this comment.
@mhvk - Ah ok! I agree with you, we could find a simpler way to keep the namespace clean.
| # py.test reads files with the 'U' flag, which is | ||
| # deprecated. | ||
| r"'U' mode is deprecated", | ||
| # inspect raises this slightly different warning on Python 3.6. |
There was a problem hiding this comment.
Should this be Python 3.6 and 3.7?
|
I think this needs a changelog entry, and we'll probably want to backport this to the LTS branch, so I think it should go in the next LTS release section. I know this might require a manual backport. |
|
@astrofrog - it may too early to state that Astropy now supports Python 3.7, as there may be other errors with the other dependencies ? |
|
My sense would be to merge this as is -- well, there should be a run where all tests passed! -- and then open a new issue about python 3.7 support. For now, I added appropriate labels. |
It was passing for the previous commit, it is flagged as failed because it kept the astrobot status for the changelog. And I did not want to waste CI time with the latest commit while just editing a comment. |
|
OK, in that case I'm happy to merge! I'll add a note to #7416 to remind us to note python 3.7 support in the changelog. |
|
|
||
|
|
||
| import collections | ||
| import collections.abc |
There was a problem hiding this comment.
We can't have this for the 2.0.x backport. I'll remove this change from the backport, but anyway, expect that it won't cause any roubles given the last commit of the PR.
There was a problem hiding this comment.
Yes, the warning is filtered for lxml, so should be fine.
Running the test suite on Python 3.7 with a few optional dependencies (the ones easily installable, but not scipy or matplotlib).
With these fixes:
The annoying one is that overriding
astropy's__dir__attribute with a list no more works, not sure if it was really supported before ...One remaining failure with FitsTime, a rounding error, but I don't know if using
isclosewould be adequate here (@mhvk, @taldcroft ?):Full log here: https://gist.github.com/saimn/88e5120119363ff53590e900ea76142a