Skip to content

Fix hard-to-debug import issues.#10282

Merged
mhvk merged 2 commits intoastropy:masterfrom
mhvk:too-many-imports-fix
May 3, 2020
Merged

Fix hard-to-debug import issues.#10282
mhvk merged 2 commits intoastropy:masterfrom
mhvk:too-many-imports-fix

Conversation

@mhvk
Copy link
Copy Markdown
Contributor

@mhvk mhvk commented May 3, 2020

Fixes the very annoying import of all of coordinates when just wanting to load io.ascii, which in turn led to Time being updated, etc.

Thanks @taldcroft for figuring this out (and again apologies for causing the issue in the first place).

@mhvk mhvk added table Bug Affects-dev PRs and issues that do not impact an existing Astropy release labels May 3, 2020
@mhvk mhvk added this to the v4.1 milestone May 3, 2020
@mhvk mhvk requested a review from taldcroft May 3, 2020 16:35
Copy link
Copy Markdown
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm seeing the same 32bit-and-parallel fail in my completely-unrelated What's New PR #10279. I guess @pllim was mentioning this and it sounds familiar as a known issue. Anyway, when astropy requires Python 3.7 then we will have custom module attributes and all this will just go away! I think a lot of other stuff will clean up too.

@mhvk mhvk added the zzz 💤 merge-when-ci-passes Do not use: We have auto-merge option now. label May 3, 2020
@mhvk
Copy link
Copy Markdown
Contributor Author

mhvk commented May 3, 2020

Merge only when also CI 32 bit passes!

@mhvk
Copy link
Copy Markdown
Contributor Author

mhvk commented May 3, 2020

Good, that got rid of two problems! Now if only I hadn't caused them in the first place...

@mhvk mhvk merged commit e45272a into astropy:master May 3, 2020
@mhvk mhvk deleted the too-many-imports-fix branch May 3, 2020 20:01
@mhvk
Copy link
Copy Markdown
Contributor Author

mhvk commented May 3, 2020

@taldcroft - out of curiosity, how will the custom attributes help? Maybe open an issue about it so we know to do it?

@taldcroft
Copy link
Copy Markdown
Member

In Python 3.7 you can have a module-level __getitem__. So that means __construct_mixin_classes can be an on-demand attribute of the module that only gets evaluated when it is needed. At first glance it seems like that would reduce some of the circular import problems, though to be honest I haven't followed the logic enough to be sure.

@taldcroft
Copy link
Copy Markdown
Member

I think we will support only Python 3.7+ for the first astropy release that is supported beyond 2021-12-23, which is the Python 3.6 end of support. So that is probably the Fall 2021 release.

@mhvk
Copy link
Copy Markdown
Contributor Author

mhvk commented May 3, 2020

Ah, yes, I had see that - but had not realized it could (or at least should) work for things like this.

@bsipocz
Copy link
Copy Markdown
Member

bsipocz commented May 3, 2020

I think the switch is earlier than end of 2021, at least there was some vague agreement to follow NEP29 which drops 3.6 this summer (so we can practically start cleaning up the code in the middle of the summer in prep for 4.2).
https://numpy.org/neps/nep-0029-deprecation_policy.html#drop-schedule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release Bug table zzz 💤 merge-when-ci-passes Do not use: We have auto-merge option now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants