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

smart_open Version 1.8.1 Incompatibilities #80

Closed
BennettRand opened this issue Apr 17, 2019 · 6 comments · Fixed by #81 or #88
Closed

smart_open Version 1.8.1 Incompatibilities #80

BennettRand opened this issue Apr 17, 2019 · 6 comments · Fixed by #81 or #88

Comments

@BennettRand
Copy link

The smart_open.smart_open function has been deprecated in version 1.8.1 of the smart_open library in favor of smart_open.open.

This throws a warning in the console whenever a sample sheet is opened.
piskvorky/smart_open#268

Version 1.8.1 also added SSH/SCP/SFTP support which throws a warning if paramiko is not installed.
piskvorky/smart_open#267

This could be solved by adding a paramiko requirement and changing smart_open calls or setting the version of smart_open to 1.8.0 in the setup file.

@clintval
Copy link
Owner

Well that's annoying. But thanks for pointing out!

@clintval
Copy link
Owner

I confirm the warning, which is ugly.

python3.6/site-packages/smart_open/ssh.py:34: UserWarning: paramiko missing, opening SSH/SCP/SFTP paths will be disabled.  `pip install paramiko` to suppress
    warnings.warn('paramiko missing, opening SSH/SCP/SFTP paths will be disabled.  `pip install paramiko` to suppress')

Since smart_open now requires more large dependencies such as boto3, requests, and paramiko I'm inclined to make smart_open support in this library optional on install:

https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies

This will keep the sample-sheet library slimmer by default, and for default use cases (reading the files from disk).

@clintval
Copy link
Owner

Hi @BennettRand, I just released version 0.9.0 of this library and have dropped smart_open from the install requirements.

The library still supports opening any kind of objects using the smart_open library, but you have to install seperately.

Like:

❯ pip install sample_sheet>=0.9.0 smart_open

Or:

❯ pip install 'sample_sheet[smart_open]'

@averagehat
Copy link

Is smart_open the default? I installed via pip (without [smart_open]) into a fresh miniconda install, and hit this while following the QuickStart docs; reinstalling with sample_sheet[smart_open] fixed it.

>>> import sys; print(sys.version)
3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0]
>>> import sample_sheet
Traceback (most recent call last):
  File "/home/mpanciera/nova/novaseq-sync/miniconda/lib/python3.7/site-packages/sample_sheet/__init__.py", line 29, in <module>
    from smart_open import open  # Migration for smart_open 1.8.1 # type: ignore
ModuleNotFoundError: No module named 'smart_open'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mpanciera/nova/novaseq-sync/miniconda/lib/python3.7/site-packages/sample_sheet/__init__.py", line 31, in <module>
    from smart_open import smart_open as open  # type: ignore
ModuleNotFoundError: No module named 'smart_open'
>>> 
[mpanciera@node22 novaseq-sync]$ pip freeze | grep sample
sample-sheet==0.9.2

@clintval
Copy link
Owner

clintval commented Aug 8, 2019

Welp. I can fix. Thanks @averagehat

@clintval
Copy link
Owner

@averagehat thanks for reporting. I had introduced a bug in 0.9.2. I have tested under matrix of sample-sheet and smart_open versions and am happy to report I've fixed the mess.

I just released 1.9.3, so please consider reinstalling, or upgrading.

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