twc-cli 2.9.0__py3-none-any.whl → 2.9.1__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.

Potentially problematic release.


This version of twc-cli might be problematic. Click here for more details.

CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  В этом файле описаны все значимые изменения в Timeweb Cloud CLI. В выпусках мы придерживается правил [семантического версионирования](https://semver.org/lang/ru/).
4
4
 
5
+ # Версия 2.9.1 (2025.03.07)
6
+
7
+ ## Исправлено
8
+
9
+ - Исправлена ошибка в реализации опции `--gpu` в `twc server create`.
10
+
5
11
  # Версия 2.9.0 (2025.03.06)
6
12
 
7
13
  ## Добавлено
twc/__version__.py CHANGED
@@ -12,5 +12,5 @@
12
12
  import sys
13
13
 
14
14
 
15
- __version__ = "2.9.0"
15
+ __version__ = "2.9.1"
16
16
  __pyversion__ = sys.version.replace("\n", "")
twc/api/types.py CHANGED
@@ -124,6 +124,7 @@ class ServerConfiguration(TypedDict):
124
124
  disk: int
125
125
  cpu: int
126
126
  ram: int
127
+ gpu: int
127
128
 
128
129
 
129
130
  class ServerOSType(str, Enum):
twc/commands/server.py CHANGED
@@ -508,7 +508,7 @@ def server_create(
508
508
  None,
509
509
  help="Cloud Server configuration preset ID. "
510
510
  "NOTE: This argument is mutually exclusive with arguments: "
511
- "['--cpu', '--ram', '--disk', '--gpus'].",
511
+ "['--cpu', '--ram', '--disk', '--gpu'].",
512
512
  ),
513
513
  configurator_id: int = typer.Option(
514
514
  None, help="ID of configuration constraints set."
@@ -518,7 +518,7 @@ def server_create(
518
518
  "--type",
519
519
  help="Cloud Server type. "
520
520
  "Servers with GPU always is 'premium'. "
521
- "This option will be ignored if '--gpus' or '--preset-id' is set.",
521
+ "This option will be ignored if '--gpu' or '--preset-id' is set.",
522
522
  ),
523
523
  cpu: int = typer.Option(None, help="Number of vCPUs."),
524
524
  ram: str = typer.Option(
@@ -527,7 +527,8 @@ def server_create(
527
527
  disk: str = typer.Option(
528
528
  None, metavar="SIZE", help="System disk size, e.g. 10240M, 10G."
529
529
  ),
530
- gpus: Optional[int] = typer.Option(
530
+ gpus: Optional[int] = typer.Option(None, min=0, max=4, hidden=True),
531
+ gpu: Optional[int] = typer.Option(
531
532
  None,
532
533
  min=0,
533
534
  max=4,
@@ -618,6 +619,8 @@ def server_create(
618
619
 
619
620
  instance_kind = instance_kind.value
620
621
  if gpus:
622
+ gpu = gpus
623
+ if gpu:
621
624
  instance_kind = "gpu"
622
625
 
623
626
  # Check availability zone
@@ -658,10 +661,10 @@ def server_create(
658
661
  payload["network"]["floating_ip"] = "create_ip"
659
662
 
660
663
  # Set server configuration parameters
661
- if preset_id and (cpu or ram or disk or gpus):
664
+ if preset_id and (cpu or ram or disk or gpu):
662
665
  raise UsageError(
663
666
  "'--preset-id' is mutually exclusive with: "
664
- + "['--cpu', '--ram', '--disk', '--gpus']."
667
+ + "['--cpu', '--ram', '--disk', '--gpu']."
665
668
  )
666
669
  if not preset_id and not (cpu or ram or disk):
667
670
  raise UsageError(
@@ -684,8 +687,8 @@ def server_create(
684
687
  "ram": validate_ram(requirements, size_to_mb(ram)),
685
688
  "disk": validate_disk(requirements, size_to_mb(disk)),
686
689
  }
687
- if gpus:
688
- payload["configuration"]["gpus"] = gpus
690
+ if gpu:
691
+ payload["configuration"]["gpu"] = gpu
689
692
  if bandwidth:
690
693
  payload["bandwidth"] = validate_bandwidth(requirements, bandwidth)
691
694
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: twc-cli
3
- Version: 2.9.0
3
+ Version: 2.9.1
4
4
  Summary: Timeweb Cloud Command Line Interface.
5
5
  Home-page: https://github.com/timeweb-cloud/twc
6
6
  License: MIT
@@ -1,13 +1,13 @@
1
- CHANGELOG.md,sha256=21X0xzAaI_iHbjPxLPuWpMoghzW3LmGchhXRTjB_eIU,27056
1
+ CHANGELOG.md,sha256=bNHVOSTbaShheTcY3nR3mF6h4-rIRMLYFG7cf4mE8dE,27220
2
2
  COPYING,sha256=fpJLxZS_kHr_659xkpmqEtqHeZp6lQR9CmKCwnYbsmE,1089
3
3
  twc/__init__.py,sha256=NwPAMNw3NuHdWGQvWS9_lromVF6VM194oVOipojfJns,113
4
4
  twc/__main__.py,sha256=ADHceaQUzgLmvhYHvb5O8urdJWj5IcEHLpTQkSExiD8,2468
5
- twc/__version__.py,sha256=DbYVn6TuN9FcaK_hzU8lsJQfEXuMuhVIoohBrsqV2Eo,442
5
+ twc/__version__.py,sha256=LA3Qa1Id0E6VF_GJX3GIwgV7Jrh2YzyspaQDWUoXEGM,442
6
6
  twc/api/__init__.py,sha256=SXew0Fe51M7nRBNQaaLRH4NjnRHkQUn7J26OCkQsftA,128
7
7
  twc/api/base.py,sha256=QRefnIgmlbz8n37GLBKeAK1AtzkcNo1IFjZgHDDECJ4,7912
8
8
  twc/api/client.py,sha256=NFS8Jz64b-FHGy2QNwtzxyHGK7tanTquhTSJ6IcH3jg,59447
9
9
  twc/api/exceptions.py,sha256=UzK3pKRffcXlhnkPy6MDjP_DygVoV17DuZ_mdNbOzts,2369
10
- twc/api/types.py,sha256=HCxdTi-o8nVq4ShPthd2fUvlYufEoXafx_6qrNHFH04,5406
10
+ twc/api/types.py,sha256=SJCKJsjdk9dFLgABO2c83oIw6ht-ARwPKmHKVZrbiN8,5419
11
11
  twc/apiwrap.py,sha256=hKrg_o6rLfY32SEnWMc1BSXHnSAh7TGar1JQ90YnG5M,2970
12
12
  twc/commands/__init__.py,sha256=a-6fHQQwOj--Z7uBZGZL3z1rvJiOGUMQMRET1UknIYo,430
13
13
  twc/commands/account.py,sha256=6q9ri02oFbUUZuqNVXO-uHOX45B4ELJlPjyfVaEL5Qw,5960
@@ -21,7 +21,7 @@ twc/commands/floating_ip.py,sha256=G9nD5BbHCZcuytbzeneDJWQDhd8c8WRtq9pAfwI9m7E,8
21
21
  twc/commands/image.py,sha256=OviQwegXK55H3TBlroCASVcgj2QUVCTo0ZhF5ug9eT8,8165
22
22
  twc/commands/kubernetes.py,sha256=-Cgas1vFVMcrWGinjstuUz3sqX0ZNXv_4mwPwuwKeLE,20870
23
23
  twc/commands/project.py,sha256=xnL3kLIumKzrI9EZ6r6m-PGOl3mZ9IhLQua7WZ3Rghg,10499
24
- twc/commands/server.py,sha256=bPeSht7VqCZUeHfUUhDa-Si2um2nPR4riUnBwGUR0u4,71886
24
+ twc/commands/server.py,sha256=1Shwy-rTHeingiEl2EErkXIpm5TDWyBYO3fJl794Jos,71982
25
25
  twc/commands/ssh_key.py,sha256=NHgTPhAQpDzt-iPHHVo4XqUJvujNqf019N6N9qYZ9Us,7941
26
26
  twc/commands/storage.py,sha256=Pztk5iUBp9RtkdOwsfHaZFCnD8GuH6zOPtluawkRmiI,19404
27
27
  twc/commands/vpc.py,sha256=SAht6UD17mU0d_AZY6W34VEYs7CqUsS2iDakPFxAFQU,8876
@@ -29,8 +29,8 @@ twc/fmt.py,sha256=nbuYZ8nVabYDwCmZqnL3-c6Tmri4B-R_sTCkG6sdfeI,7171
29
29
  twc/typerx.py,sha256=AZ6BgTQvlrZYfKVYd9YqRNQnAR2XuyqImz4rf6di6f4,6737
30
30
  twc/utils.py,sha256=uWizyUC4dHLwtk50q4Sub3zOvnVESfHKBbXYwk5t71w,651
31
31
  twc/vars.py,sha256=fva3O2leMGtExb1aWiAk6sOV0O8et9_kEyRpYYIZ7CM,543
32
- twc_cli-2.9.0.dist-info/COPYING,sha256=fpJLxZS_kHr_659xkpmqEtqHeZp6lQR9CmKCwnYbsmE,1089
33
- twc_cli-2.9.0.dist-info/METADATA,sha256=jcSe64PkZXrOOqCrDrqyi2yrrqlZbmX5opo5hW0oHl0,2652
34
- twc_cli-2.9.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
35
- twc_cli-2.9.0.dist-info/entry_points.txt,sha256=tmTaVRhm8BkNrXC_9XJMum7O9wFVOvkXcBetxmahWvE,40
36
- twc_cli-2.9.0.dist-info/RECORD,,
32
+ twc_cli-2.9.1.dist-info/COPYING,sha256=fpJLxZS_kHr_659xkpmqEtqHeZp6lQR9CmKCwnYbsmE,1089
33
+ twc_cli-2.9.1.dist-info/METADATA,sha256=TIBw2Q5afvk-ZMkmfD1BYaErlpPorV1oXgmFwJ-AWCU,2652
34
+ twc_cli-2.9.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
35
+ twc_cli-2.9.1.dist-info/entry_points.txt,sha256=tmTaVRhm8BkNrXC_9XJMum7O9wFVOvkXcBetxmahWvE,40
36
+ twc_cli-2.9.1.dist-info/RECORD,,