Skip to content
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

nwis-client latest builds broken when installed on Python 3.6 #98

Closed
jameshalgren opened this issue Jun 29, 2021 · 3 comments
Closed

nwis-client latest builds broken when installed on Python 3.6 #98

jameshalgren opened this issue Jun 29, 2021 · 3 comments

Comments

@jameshalgren
Copy link

jameshalgren commented Jun 29, 2021

Importing the latest nwis-client using python 3.6

from hydrotools.nwis_client.iv import IVDataService

fails with

TypeError: 'type' object is not subscriptable

The error may be more ubiquitous than just the IVDataService import, but that is where we have had trouble with it.

A brief conversation with the developers suggested that a down stream dependency forces a bump to python 3.7 as the minimum requirement and they are considering workarounds to allow backward compatibility. The newer version is worth the effort, with order-of-magnitude faster retrieval speeds from the NWIS service. We do not have any real reason to continue using 3.6, so we may look at an upgrade path.

Workaround

For now, uninstalling the nwis-client, -restclient, and events modules

pip uninstall hydrotools.nwis_client
pip uninstall hydrotools.-restclient
pip uninstall hydrotools.events

then reinstalling the following versions allowed us to continuing using the service in the meantime on python 3.6.8

pip install hydrotools.-restclient==2.0.0a0
pip install hydrotools.nwis-client==2.0.0a0
@aaraney
Copy link
Member

aaraney commented Jun 29, 2021

@jameshalgren, having briefly looked into the dependencies required by the nwis_client, namely hydrotools._restclient which is causing this issue, it will not be feasible to roll back and support python 3.7. The package aiohttp which both the nwis_client and _restclient are highly dependent on requires >= 3.7. I tracked down the git blame for this decision by the aiohttp developers and they cited the python version lifecycle as the reason for dropping support for <=3.6. In short, python 3.6's end of life (EOL) is 2021-12-23.

My apologies for misleading you in our earlier conversation, I was unaware of python version requirement in the aiohttp package.

@jarq6c
Copy link
Collaborator

jarq6c commented Jun 29, 2021

FTR: Even before I was aware of aiohttp's decision, I was opposed to backwards compatibility with 3.6. The EOL justification is nice to cite though. Thanks @aaraney

@jameshalgren
Copy link
Author

All this is consistent with our plan to separate the data handling code from the processing code. Thank you for the additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants