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

Watermark doesn't catch classes/functions imported using from #44

Closed
matrs opened this issue Jan 2, 2019 · 5 comments
Closed

Watermark doesn't catch classes/functions imported using from #44

matrs opened this issue Jan 2, 2019 · 5 comments

Comments

@matrs
Copy link

matrs commented Jan 2, 2019

Hello,
first, thank you for this package.
I just noticed this behaviour when importing a subclass from Biopython:

from Bio import SeqIO

the watermark magic doesn't show the info of the imported package (Bio). I'm aware that I can solve this doing

import Bio

but i was wondering if it could be implemented given that for many libraries It is customary to use:

from X import Y

Cheers!

@rasbt
Copy link
Owner

rasbt commented Jan 2, 2019

Hi there,

could you show your usage example? I am wondering because there is currently no feature to print all the imported packages automatically (we may add that at some point though, as mentioned in #5)

So in order to show the package version, you would execute

%watermark -p Bio

@matrs
Copy link
Author

matrs commented Jan 3, 2019

Sorry, I wasn't clear enough.
I'm using %watermark -iv to print the version of all imported modules.
So when I use

from Bio import SeqIO

%watermark -iv doesn't print any information about the module Bio, as if It wasn't imported. Of course, it works if I use

import Bio

I was expecting that %watermark -iv printed information about Bio despite the way I imported it because the Bio module it's actually being imported in both cases. So this is a particular example of the general case where any submodule/class/function is imported using

from X import Y

and %watermark -iv doesn't print any information for X (or Y if you prefer that).

could you show your usage example? I am wondering because there is currently no feature to print all the imported packages automatically

But in the help says:
-iv, --iversions prints the name/version of all imported modules

@rasbt
Copy link
Owner

rasbt commented Jan 3, 2019

Oh sorry, I was confused and forgot that we already added the -iv flag ... for some reason, I thought this was still work in progress.

I agree with you that it would be super nice to support the from X import Y scenarios. And I think this is an easy fix. I think I can just implement it right-away in a few minutes

@rasbt
Copy link
Owner

rasbt commented Jan 3, 2019

That functionality should work in the the new 1.8.0 version now :)

@matrs
Copy link
Author

matrs commented Jan 3, 2019

Thank you , that was fast!

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

2 participants