Astroquery: Python 3.7 incompatibiliy in conesearch.py

Created on 3 Jul 2018  路  5Comments  路  Source: astropy/astroquery

In Python 3.7 async and await are reserved keywords (check https://docs.python.org/3/whatsnew/3.7.html). Therefore astroquery/vo_conesearch/conesearch.py cannot be imported anymore, a simple

from astroquery.vo_conesearch import conesearch

fails with

Traceback (most recent call last):

  File "/home/lupinix/venv/lib64/python3.7/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-4-c5082e327d69>", line 1, in <module>
    from astroquery.vo_conesearch import conesearch

  File "/home/lupinix/venv/lib64/python3.7/site-packages/astroquery/vo_conesearch/conesearch.py", line 26
    from .async import AsyncBase
              ^
SyntaxError: invalid syntax

As a fix I suggest to rename file astroquery/vo_conesearch/async.py and fix the imports accordingly. Would that be safe (and which files import async, do we need doc changes?)? I have to fix it in Fedora packaging soon as Python 3.7 has been imported now.

Greetings,
Christian

bug vo_conesearch

All 5 comments

Thanks for reporting this! And feel free to submit a patch if you already have one.

No patch yet, would be renaming async.py and changing the import in conesearch.py safe or are there any caveats to be expected (or other imports of async)?

AFAIK async is not used outside of cone search, so probably okay to rename. @keflavich or @bsipocz, any pkg wide policy on this?

@pllim - No custom policy afaik, it seems to me that that the async namespace was never exposed to the users in any API docs, so we can refactor it as much as we like.

Has been addressed by #1185

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomdonaldson picture tomdonaldson  路  4Comments

keithini picture keithini  路  4Comments

Titanosaurus picture Titanosaurus  路  8Comments

Roman-UCLU picture Roman-UCLU  路  6Comments

bsipocz picture bsipocz  路  8Comments