request-vm-on-golem 0.1.29__py3-none-any.whl → 0.1.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: request-vm-on-golem
3
- Version: 0.1.29
3
+ Version: 0.1.30
4
4
  Summary: VM on Golem Requestor CLI - Create and manage virtual machines on the Golem Network
5
5
  Keywords: golem,vm,cloud,decentralized,cli
6
6
  Author: Phillip Jensen
@@ -1,7 +1,7 @@
1
1
  requestor/__init__.py,sha256=OqSUAh1uZBMx7GW0MoSMg967PVdmT8XdPJx3QYjwkak,116
2
2
  requestor/api/main.py,sha256=7utCzFNbh5Ol-vsBWeSwT4lXeHD7zdA-GFZuS3rHMWc,2180
3
3
  requestor/cli/__init__.py,sha256=e3E4oEGxmGj-STPtFkQwg_qIWhR0JAiAQdw3G1hXciU,37
4
- requestor/cli/commands.py,sha256=ce8D-ROv6qb7BiVbPz7rO2xv5aHRhv8rtp2d9bLIBwE,23488
4
+ requestor/cli/commands.py,sha256=Ydq2xaM0RkDPiJmMQlV3PbwUCP7D1o-MeeSBkRoTf3U,24071
5
5
  requestor/config.py,sha256=l0nN3kqaUWPyPxlgth_dmU1icZRXxlAOBSFT9O7slk0,3575
6
6
  requestor/db/__init__.py,sha256=Gm5DfWls6uvCZZ3HGGnyRHswbUQdeA5OGN8yPwH0hc8,88
7
7
  requestor/db/sqlite.py,sha256=l5pWbx2qlHuar1N_a0B9tVnmumLJY1w5rp3yZ7jmsC0,4146
@@ -18,7 +18,7 @@ requestor/ssh/__init__.py,sha256=hNgSqJ5s1_AwwxVRyFjUqh_LTBpI4Hmzq0F-f_wXN9g,119
18
18
  requestor/ssh/manager.py,sha256=XhZjz7_BRPnmpu-zxqnGHLCq0b2JZ8Xr8zc1OlMNDkc,9355
19
19
  requestor/utils/logging.py,sha256=oFNpO8pJboYM8Wp7g3HOU4HFyBTKypVdY15lUiz1a4I,3721
20
20
  requestor/utils/spinner.py,sha256=PUHJdTD9jpUHur__01_qxXy87WFfNmjQbD_sLG-KlGo,2459
21
- request_vm_on_golem-0.1.29.dist-info/METADATA,sha256=2At64TwfcSjrEpIkGkzn7v-zRncUHlwPZAtr2P1o3aY,9128
22
- request_vm_on_golem-0.1.29.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
23
- request_vm_on_golem-0.1.29.dist-info/entry_points.txt,sha256=Z-skRNpJ8aZcIl_En9mEm1ygkp9FKy0bzQoL3zO52-0,44
24
- request_vm_on_golem-0.1.29.dist-info/RECORD,,
21
+ request_vm_on_golem-0.1.30.dist-info/METADATA,sha256=X4t-nXSxJ0OweAUVBfeZm-TDY4Hyzg3W4fvgKgRadCQ,9128
22
+ request_vm_on_golem-0.1.30.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
23
+ request_vm_on_golem-0.1.30.dist-info/entry_points.txt,sha256=Z-skRNpJ8aZcIl_En9mEm1ygkp9FKy0bzQoL3zO52-0,44
24
+ request_vm_on_golem-0.1.30.dist-info/RECORD,,
requestor/cli/commands.py CHANGED
@@ -7,6 +7,11 @@ import subprocess
7
7
  import aiohttp
8
8
  from tabulate import tabulate
9
9
  import uvicorn
10
+ try:
11
+ from importlib import metadata
12
+ except ImportError:
13
+ # Python < 3.8
14
+ import importlib_metadata as metadata
10
15
 
11
16
  from ..config import config
12
17
  from ..provider.client import ProviderClient
@@ -34,7 +39,20 @@ def async_command(f):
34
39
  return lambda *args, **kwargs: asyncio.run(wrapper(*args, **kwargs))
35
40
 
36
41
 
42
+ def print_version(ctx, param, value):
43
+ if not value or ctx.resilient_parsing:
44
+ return
45
+ try:
46
+ version = metadata.version('request-vm-on-golem')
47
+ except metadata.PackageNotFoundError:
48
+ version = 'unknown'
49
+ click.echo(f'Requestor VM on Golem CLI version {version}')
50
+ ctx.exit()
51
+
52
+
37
53
  @click.group()
54
+ @click.option('--version', is_flag=True, callback=print_version,
55
+ expose_value=False, is_eager=True, help="Show the version and exit.")
38
56
  def cli():
39
57
  """VM on Golem management CLI"""
40
58
  pass