Skip to content

support -iv edge cases? #58

@jGaboardi

Description

@jGaboardi

I am wondering if there is an efficient way to support fetching the versions of Python packages that don't follow the __version__ convention, gurobi's Python API for example?

In [1]: %load_ext watermark                                                                                                      

In [2]: %watermark -w                                                                                                            
watermark 2.0.2

In [3]: import gurobi                                                                                                            

In [4]: import gurobipy                                                                                                          

In [5]: %watermark -iv                                                                                                           


In [6]: gurobi.gurobi.version()                                                                                                  
Out[6]: (9, 0, 0)

In [7]: gurobipy.gurobi.version()                                                                                                
Out[7]: (9, 0, 0)

In [8]: %watermark                                                                                                               
2019-12-25T17:55:30-05:00

CPython 3.7.3
IPython 7.10.2

compiler   : Clang 9.0.0 (tags/RELEASE_900/final)
system     : Darwin
release    : 19.2.0
machine    : x86_64
processor  : i386
CPU cores  : 4
interpreter: 64bit

Or would this have to be (1) a brute-force search through the entire directory; or (2) a manual print() for the version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions