Closed jgriesfeller closed 2 years ago
Should we add some additional info listing the installed pya
dependencies?
This is quite easy to implement with importlib.metadata.version
Here is an example, from one of my CLI apps
$ utils4cwf -V
utils4cwf (0.4.0)
dependencies (installed version)
data formats
netCDF4 (1.5.5.1), eccodes (1.3.3), cfgrib (0.9.9.1), pyarrow (6.0.0)
data manipulation
dask (2021.11.1), xarray (0.20.1), scipy (1.6.1), numpy (1.19.5)
remote execution
fabric (2.6.0), invoke (1.6.0), paramiko (2.8.0)
configuration
python-dotenv (0.19.2), toml (0.10.2)
command line
typer (0.4.0), click (8.0.3)
Sounds like a good idea What I was after can be achieved like this
>>> import pyaerocom
>>> from importlib.metadata import version
>>> version('pyaerocom')
'0.12.2.dev1'
This is so small that I can implement it right away in https://github.com/metno/pyaerocom/blob/main-dev/pyaerocom/scripts/cli.py
on the current version you can get __version__
as follows
>>> from pyaerocom import __version__
>>> print(__version__)
0.12.2.dev1
which I implemented using importlib.metadata.version
This is so small that I can implement it right away in https://github.com/metno/pyaerocom/blob/main-dev/pyaerocom/scripts/cli.py
Yes, you could just do that. However, I would take the opportunity to re-implement pyaerocom.scripts.cli
using typer.
Then just do it, I am too used to argparse.
addressed by #624
In the Unix world it's a good practice for every program to provide an easy way of determining it's version number. Usually that is done with a --version command line option.
The purpose for me is to determine easily on which version number I am.