together 1.3.2__py3-none-any.whl → 1.3.3__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.
together/cli/api/utils.py CHANGED
@@ -1,23 +1,30 @@
1
1
  from __future__ import annotations
2
2
 
3
- import click
4
-
3
+ from gettext import gettext as _
5
4
  from typing import Literal
6
5
 
6
+ import click
7
+
7
8
 
8
9
  class AutoIntParamType(click.ParamType):
9
- name = "integer"
10
+ name = "integer_or_max"
11
+ _number_class = int
10
12
 
11
13
  def convert(
12
14
  self, value: str, param: click.Parameter | None, ctx: click.Context | None
13
15
  ) -> int | Literal["max"] | None:
14
- if isinstance(value, int):
15
- return value
16
-
17
16
  if value == "max":
18
17
  return "max"
19
-
20
- self.fail("Invalid integer value: {value}")
18
+ try:
19
+ return int(value)
20
+ except ValueError:
21
+ self.fail(
22
+ _("{value!r} is not a valid {number_type}.").format(
23
+ value=value, number_type=self.name
24
+ ),
25
+ param,
26
+ ctx,
27
+ )
21
28
 
22
29
 
23
30
  INT_WITH_MAX = AutoIntParamType()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: together
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Python client for Together's Cloud Platform!
5
5
  Home-page: https://github.com/togethercomputer/together-python
6
6
  License: Apache-2.0
@@ -9,7 +9,7 @@ together/cli/api/files.py,sha256=QLYEXRkY8J2Gg1SbTCtzGfoTMvosoeACNK83L_oLubs,339
9
9
  together/cli/api/finetune.py,sha256=rF3PP-BwvrVPPubNn5j-_EToss7sC5pj0-DjsJ7hYxc,12026
10
10
  together/cli/api/images.py,sha256=GADSeaNUHUVMtWovmccGuKc28IJ9E_v4vAEwYHJhu5o,2645
11
11
  together/cli/api/models.py,sha256=xWEzu8ZpxM_Pz9KEjRPRVuv_v22RayYZ4QcgiezT5tE,1126
12
- together/cli/api/utils.py,sha256=2sRYtPEnlFkdW21AjbUKnx0kqnXMxMUCHK5V36OaXBg,482
12
+ together/cli/api/utils.py,sha256=nWvaCplARQa5e4lrisI8-mwY6031UMaO3wcpVxpUM9I,726
13
13
  together/cli/cli.py,sha256=RC0tgapkSOFjsRPg8p-8dx9D2LDzm8YmVCHUjk_aVyQ,1977
14
14
  together/client.py,sha256=mOlIFjjE9eSTb0o_weaKJwm8qvWNKHDiMmp8kQ7y68I,4946
15
15
  together/constants.py,sha256=6DAvMTrGYI73gUFRbfBdLfDxksucpKjKsiH07PGtSSM,906
@@ -52,8 +52,8 @@ together/utils/api_helpers.py,sha256=RSF7SRhbjHzroMOSWAXscflByM1r1ta_1SpxkAT22iE
52
52
  together/utils/files.py,sha256=gMLthqfP5hKxVAerHMdy7gLXzdfY6lyOXdpW24Y4X3I,7165
53
53
  together/utils/tools.py,sha256=3-lXWP3cBCzOVSZg9tr5zOT1jaVeKAKVWxO2fcXZTh8,1788
54
54
  together/version.py,sha256=p03ivHyE0SyWU4jAnRTBi_sOwywVWoZPU4g2gzRgG-Y,126
55
- together-1.3.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
- together-1.3.2.dist-info/METADATA,sha256=hXQAkHMvxQ4-ftEmIC65_20scBFKjmM9GJDP6mNvIAQ,11829
57
- together-1.3.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
58
- together-1.3.2.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
59
- together-1.3.2.dist-info/RECORD,,
55
+ together-1.3.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
+ together-1.3.3.dist-info/METADATA,sha256=Cz9xAfH5jrXLw1RxPE25ZFzloe72UGfza2o1ltF_nm8,11829
57
+ together-1.3.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
58
+ together-1.3.3.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
59
+ together-1.3.3.dist-info/RECORD,,