Add support for versioning in dataiku-api-client package
Add support for versioning in dataiku-api-client package so that either of these approaches can be used to find out what version of the dataiku-api-client one has installed:
from importlib.metadata import version version('dataiku-api-client') import dataikuapi dataikuapi.__version__
Also why can't we have the package name match the import name like in most other Python packages? Thanks
Comments
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,161 Neuron
Note the reason this is needed is that when using the dataikuapi package outside DSS you should always have a dataikuapi package version >= than the DSS version of the environment you are trying to connect to.
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,161 Neuron
Actually the first way works outside of Dataiku. Also this other way works too outside of Dataiku:
import pkg_resources package = pkg_resources.get_distribution("dataiku-api-client") print(package.version)
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,161 Neuron
However it will be better if dataikuapi.__version__ is implemented so that the version can be checked inside DSS as DSS imports packages from the PATH so the other methods to check the version will not work.