bakefile 0.0.12__py3-none-any.whl → 0.0.13__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.
bake/ui/console.py CHANGED
@@ -4,6 +4,7 @@ from typing import Any
4
4
 
5
5
  from beautysh import BashFormatter
6
6
  from rich.console import Console
7
+ from rich.text import Text
7
8
 
8
9
  from bake.utils.settings import bake_settings
9
10
 
@@ -75,7 +76,9 @@ def echo(message: Any, **kwargs) -> None:
75
76
 
76
77
  def cmd(cmd_str: str, **kwargs) -> None:
77
78
  arrow = "❯" if _supports_unicode() else ">" # noqa: RUF001
78
- err.print(f"[{BOLD_GREEN}]{arrow}[/{BOLD_GREEN}] [default]{cmd_str}[/default]", **kwargs)
79
+ arrow_text = Text(arrow, style=BOLD_GREEN)
80
+ cmd_text = Text(f"{cmd_str}")
81
+ err.print(arrow_text, cmd_text, **kwargs)
79
82
 
80
83
 
81
84
  def script_block(title: str, script: str, **kwargs) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bakefile
3
- Version: 0.0.12
3
+ Version: 0.0.13
4
4
  Summary: Add your description here
5
5
  Author: Wisaroot Lertthaweedech
6
6
  Author-email: Wisaroot Lertthaweedech <l.wisaroot@gmail.com>
@@ -35,7 +35,7 @@ bake/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  bake/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  bake/samples/simple.py,sha256=hP2TW-D7BQBGJseqRPpilxkoQ8ScTuZZePICupyvFKA,155
37
37
  bake/ui/__init__.py,sha256=6OhZVKjfC9aumbhraxkGtx7KLpV1ouepeHRA2dUVoSo,209
38
- bake/ui/console.py,sha256=y5pZ5i_Iqh4bzaHGJQFDMnqRILsIClr8004EkLydLr4,3289
38
+ bake/ui/console.py,sha256=xy33rO2tLSkCFjyC_omClkbkXxwZmNL54wWzl7eXGlw,3349
39
39
  bake/ui/logger/__init__.py,sha256=bup2cssTHhergh47s6uYbGtY2dJNxlKKH6otBc4ECFM,728
40
40
  bake/ui/logger/capsys.py,sha256=KZL6k7Werp_8styfJKfIvQyv0-gJq54vY3hSJFIacEM,5267
41
41
  bake/ui/logger/setup.py,sha256=OrX9UiY0iBGfWWfhMJCdfqCRJsL5yC3rIdIEOn7rveo,1377
@@ -62,11 +62,11 @@ bakelib/refreshable_cache/cache.py,sha256=P8gX63FP1vgdwNOwKLf-U0ly1P1LvNsB7KqDS9
62
62
  bakelib/refreshable_cache/exceptions.py,sha256=d15dd0RbapXneWZpDwfvDt7k49cB6jZBMxULi5DLU9Q,97
63
63
  bakelib/space/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  bakelib/space/base.py,sha256=7vwVw19hkPimvamvTVySkc7Ndk8san3EF_5pg-8jf7w,6260
65
- bakelib/space/lib.py,sha256=MZnS_vP9zxalRE_eFb-fkW5NU5-6l8w8Rsz63PMCVS8,5617
65
+ bakelib/space/lib.py,sha256=2vjR5qLA-a6-WYUb_ii0oJdgB2fj3-kHtvmRB88203A,6007
66
66
  bakelib/space/python.py,sha256=LRe6sNDJ6_iNv3bt2rJqp-gLzNiv3MgoN5XRyiIdmcw,3284
67
- bakelib/space/python_lib.py,sha256=kkfdoMOWMX_qP3uGafQbLXy5NFbvv4ZKwmOXrgzH6Cs,2729
67
+ bakelib/space/python_lib.py,sha256=x-htl7p_O_sSGG9GyusrjmYtYraZUTfwRPhJaclbF6I,2820
68
68
  bakelib/space/utils.py,sha256=Mp82CgpNMeG76slXaDs9GXa1r_ugoiJICvpsOaH_2tg,3206
69
- bakefile-0.0.12.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
70
- bakefile-0.0.12.dist-info/entry_points.txt,sha256=Ecvvh7BYHCPJ0UdntrDc3Od6AZdRPXN5Z7o_7ok_0Qw,107
71
- bakefile-0.0.12.dist-info/METADATA,sha256=VNATRQERjXeXnSv2UPECGYx0Oo9NuRgRyhsNv2mTpwo,2464
72
- bakefile-0.0.12.dist-info/RECORD,,
69
+ bakefile-0.0.13.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
70
+ bakefile-0.0.13.dist-info/entry_points.txt,sha256=Ecvvh7BYHCPJ0UdntrDc3Od6AZdRPXN5Z7o_7ok_0Qw,107
71
+ bakefile-0.0.13.dist-info/METADATA,sha256=b2hySKTOpcJiGFCnx1JFS8N3yuCcpxt9WTVJbqRyJCk,2464
72
+ bakefile-0.0.13.dist-info/RECORD,,
bakelib/space/lib.py CHANGED
@@ -92,11 +92,15 @@ class BaseLibSpace(BaseSpace):
92
92
  def _version_schema(self) -> str | None:
93
93
  return None
94
94
 
95
+ @property
96
+ def _version_output_format(self) -> str | None:
97
+ return None
98
+
95
99
  def _is_auth_failure(self, result: subprocess.CompletedProcess[str]) -> bool:
96
100
  return result.returncode != 0
97
101
 
98
102
  def _determine_version(self, ctx: Context, version: str | None) -> str:
99
- return version if version else self.zerv_versioning(ctx, schema=self._version_schema)
103
+ return version if version else self.zerv_versioning(ctx)
100
104
 
101
105
  @command(help="Build and publish the package")
102
106
  def publish(
@@ -150,9 +154,16 @@ class BaseLibSpace(BaseSpace):
150
154
  "set the BAKE_PUBLISH_TOKEN environment variable"
151
155
  )
152
156
 
153
- def zerv_versioning(self, ctx: Context, *, schema: str | None = None) -> str:
154
- schema_flag = f"--schema {schema}" if schema else ""
155
- result = ctx.run(f"zerv flow {schema_flag}", dry_run=False)
157
+ def zerv_versioning(
158
+ self, ctx: Context, *, schema: str | None = None, output_format: str | None = None
159
+ ) -> str:
160
+ schema = schema if schema is not None else self._version_schema
161
+ output_format = output_format if output_format is not None else self._version_output_format
162
+
163
+ schema_flag = f" --schema {schema}" if schema else ""
164
+ output_format_flag = f" --output-format {output_format}" if output_format else ""
165
+
166
+ result = ctx.run(f"zerv flow{schema_flag}{output_format_flag}", dry_run=False)
156
167
  return strip_ansi(result.stdout.strip())
157
168
 
158
169
  def _get_tools(self) -> dict[str, ToolInfo]:
@@ -18,6 +18,10 @@ class PythonLibSpace(PythonSpace, BaseLibSpace):
18
18
  def _version_schema(self) -> str | None:
19
19
  return "standard-base-prerelease-post-dev"
20
20
 
21
+ @property
22
+ def _version_output_format(self) -> str | None:
23
+ return "pep440"
24
+
21
25
  def _registry_to_index(self, registry: str) -> PublishIndex:
22
26
  valid_indices = get_args(PublishIndex)
23
27
  if registry not in valid_indices: