Repository: SeldonIO/MLServer

Issue:
mlserver --version fails (0.5.0)
```
mlserver --version
Traceback (most recent call last):
  File "/home/clive/anaconda3/envs/mlserver/bin/mlserver", line 8, in <module>
    sys.exit(main())
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/mlserver/cli/main.py", line 45, in main
    root()
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 781, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 700, in make_context
    self.parse_args(ctx, args)
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 1212, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 1048, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 1630, in handle_parse_result
    value = invoke_param_callback(self.callback, ctx, self, value)
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/core.py", line 123, in invoke_param_callback
    return callback(ctx, param, value)
  File "/home/clive/anaconda3/envs/mlserver/lib/python3.8/site-packages/click/decorators.py", line 295, in callback
    raise RuntimeError("Could not determine version")
RuntimeError: Could not determine version
(mlserver) /home/clive $ pip freeze | grep mlserver
mlserver==0.5.0
```


Discussion:
Are you using Python <3.8?  Looks like [`click` docs](https://click.palletsprojects.com/en/8.0.x/api/?highlight=version_option#click.version_option) require either Python 3.8+ or installation or `importlib_metadata`

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -34,15 +34,16 @@ def _load_description() -> str:
     description="ML server",
     packages=find_packages(exclude=["tests", "tests.*"]),
     install_requires=[
-        "grpcio",
-        "protobuf",
+        "click",
         # We pin version of fastapi
         # check https://github.com/SeldonIO/MLServer/issues/340
         "fastapi==0.68.2",
-        "uvicorn",
-        "click",
+        "grpcio",
+        "importlib-metadata;python_version<'3.8'",
         "numpy",
         "pandas",
+        "protobuf",
+        "uvicorn",
     ],
     extras_require={"all": ["orjson"]},
     entry_points={"console_scripts": ["mlserver=mlserver.cli:main"]},


Test patch:
diff --git a/tests/cli/test_version.py b/tests/cli/test_version.py
new file mode 100644
--- /dev/null
+++ b/tests/cli/test_version.py
@@ -0,0 +1,12 @@
+from click.testing import CliRunner
+
+from mlserver.cli.main import root
+
+
+def test_version_does_not_error():
+    runner = CliRunner()
+
+    result = runner.invoke(root, ["--version"])
+
+    assert result.exit_code == 0
+    assert result.exception is None