dayhoff-tools 1.7.2__py3-none-any.whl → 1.7.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.
dayhoff_tools/cli/main.py CHANGED
@@ -64,8 +64,9 @@ app.add_typer(engine_app, name="engine", help="Manage compute engines for develo
64
64
  app.add_typer(studio_app, name="studio", help="Manage persistent development studios.")
65
65
 
66
66
 
67
- @app.callback()
67
+ @app.callback(invoke_without_command=True)
68
68
  def _version_option(
69
+ ctx: typer.Context,
69
70
  version_flag: bool = typer.Option(
70
71
  False,
71
72
  "--version",
@@ -78,6 +79,10 @@ def _version_option(
78
79
  if version_flag:
79
80
  typer.echo(_get_dht_version())
80
81
  raise typer.Exit()
82
+ # If no subcommand provided, show help instead of 'Missing command'
83
+ if ctx.invoked_subcommand is None:
84
+ typer.echo(ctx.get_help())
85
+ raise typer.Exit()
81
86
 
82
87
 
83
88
  @app.command("wheel")
@@ -112,6 +112,7 @@ def build_and_upload_wheel(bump_part: str = "patch"):
112
112
  print("Using UV_PUBLISH_TOKEN for authentication.")
113
113
 
114
114
  pyproject_path = "pyproject.toml"
115
+ mac_manifest_path = "pyproject.mac.toml"
115
116
  current_version = None # Initialize in case the first try block fails
116
117
 
117
118
  try:
@@ -173,6 +174,25 @@ def build_and_upload_wheel(bump_part: str = "patch"):
173
174
  with open(pyproject_path, "w") as f:
174
175
  f.write(new_content)
175
176
  print(f"Updated {pyproject_path} with version {new_version}")
177
+
178
+ # Mirror version in pyproject.mac.toml if present (best-effort)
179
+ mac_updated = False
180
+ try:
181
+ mac_path = Path(mac_manifest_path)
182
+ if mac_path.exists():
183
+ mac_content = mac_path.read_text()
184
+ mac_pattern = re.compile(
185
+ f'^version\s*=\s*"{re.escape(current_version)}"', re.MULTILINE
186
+ )
187
+ mac_new_content, mac_replacements = mac_pattern.subn(
188
+ f'version = "{new_version}"', mac_content
189
+ )
190
+ if mac_replacements > 0:
191
+ mac_path.write_text(mac_new_content)
192
+ mac_updated = True
193
+ print(f"Updated {mac_manifest_path} with version {new_version}")
194
+ except Exception as e:
195
+ print(f"Warning: Could not update {mac_manifest_path}: {e}")
176
196
  # --- End Version Bumping Logic ---
177
197
 
178
198
  # Build wheel and sdist
@@ -191,6 +211,27 @@ def build_and_upload_wheel(bump_part: str = "patch"):
191
211
 
192
212
  print(f"Successfully built and uploaded version {new_version} to PyPI")
193
213
 
214
+ # Re-install DHT in current venv when building from DHT itself
215
+ try:
216
+ proj_name = None
217
+ try:
218
+ proj_toml = toml.load(pyproject_path)
219
+ proj_name = (
220
+ proj_toml.get("project", {}).get("name")
221
+ if isinstance(proj_toml, dict)
222
+ else None
223
+ )
224
+ except Exception:
225
+ pass
226
+ if proj_name == "dayhoff-tools":
227
+ print("Re-installing dayhoff-tools into the active environment…")
228
+ reinstall_cmd = ["uv", "pip", "install", "-e", "."]
229
+ print(f"Running command: {BLUE}{' '.join(reinstall_cmd)}{RESET}")
230
+ subprocess.run(reinstall_cmd, check=True)
231
+ print("dayhoff-tools reinstalled in the current environment.")
232
+ except subprocess.CalledProcessError as e:
233
+ print(f"Warning: Failed to reinstall dayhoff-tools locally: {e}")
234
+
194
235
  except FileNotFoundError:
195
236
  print(f"Error: {pyproject_path} not found.")
196
237
  # No version change happened, so no rollback needed
@@ -219,6 +260,24 @@ def build_and_upload_wheel(bump_part: str = "patch"):
219
260
  print(
220
261
  f"Warning: Could not find version {new_version} to revert in {pyproject_path}."
221
262
  )
263
+
264
+ # Also revert mac manifest if we updated it
265
+ try:
266
+ mac_path = Path(mac_manifest_path)
267
+ if mac_path.exists():
268
+ mac_content_revert = mac_path.read_text()
269
+ mac_reverted, mac_num = pattern_revert.subn(
270
+ f'version = "{current_version}"', mac_content_revert
271
+ )
272
+ if mac_num > 0:
273
+ mac_path.write_text(mac_reverted)
274
+ print(
275
+ f"Successfully reverted version in {mac_manifest_path}."
276
+ )
277
+ except Exception as e2:
278
+ print(
279
+ f"Warning: Failed to revert version change in {mac_manifest_path}: {e2}"
280
+ )
222
281
  except Exception as revert_e:
223
282
  print(
224
283
  f"Warning: Failed to revert version change in {pyproject_path}: {revert_e}"
@@ -248,6 +307,23 @@ def build_and_upload_wheel(bump_part: str = "patch"):
248
307
  print(
249
308
  f"Warning: Could not find version {new_version} to revert in {pyproject_path}."
250
309
  )
310
+ # Also revert mac manifest if necessary
311
+ try:
312
+ mac_path = Path(mac_manifest_path)
313
+ if mac_path.exists():
314
+ mac_content_revert = mac_path.read_text()
315
+ mac_reverted, mac_num = pattern_revert.subn(
316
+ f'version = "{current_version}"', mac_content_revert
317
+ )
318
+ if mac_num > 0:
319
+ mac_path.write_text(mac_reverted)
320
+ print(
321
+ f"Successfully reverted version in {mac_manifest_path}."
322
+ )
323
+ except Exception as e2:
324
+ print(
325
+ f"Warning: Failed to revert version change in {mac_manifest_path}: {e2}"
326
+ )
251
327
  except Exception as revert_e:
252
328
  print(
253
329
  f"Warning: Failed to revert version change in {pyproject_path}: {revert_e}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.7.2
3
+ Version: 1.7.3
4
4
  Summary: Common tools for all the repos at Dayhoff Labs
5
5
  Author: Daniel Martin-Alarcon
6
6
  Author-email: dma@dayhofflabs.com
@@ -4,9 +4,9 @@ dayhoff_tools/chemistry/utils.py,sha256=jt-7JgF-GeeVC421acX-bobKbLU_X94KNOW24p_P
4
4
  dayhoff_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  dayhoff_tools/cli/cloud_commands.py,sha256=33qcWLmq-FwEXMdL3F0OHm-5Stlh2r65CldyEZgQ1no,40904
6
6
  dayhoff_tools/cli/engine_commands.py,sha256=_NQI9x4VKtAC9vTDdA4NGrILf2kb005t3Kw0aZ5oroE,96485
7
- dayhoff_tools/cli/main.py,sha256=vmT2P7-CkW3nY0yvfk1Q5F6DCg-Q5T-THJ9GBCwNn7k,5701
7
+ dayhoff_tools/cli/main.py,sha256=LLMybU9KbtV_F4rwvoYAQZKTTF1nswlSZIfDMKdkh00,5925
8
8
  dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
9
- dayhoff_tools/cli/utility_commands.py,sha256=igPl3s9lsxhLV1Ul0TmPrsH060Bqv7bQffsO300u1IU,22257
9
+ dayhoff_tools/cli/utility_commands.py,sha256=1GeflsuINXvTS1Ib7_UqGLHSixqn0tQXYx-NEarwveo,25859
10
10
  dayhoff_tools/deployment/base.py,sha256=mYp560l6hSDFtyY2H42VoM8k9VUzfwuiyh9Knqpgc28,17441
11
11
  dayhoff_tools/deployment/deploy_aws.py,sha256=GvZpE2YIFA5Dl9rkAljFjtUypmPDNbWgw8NicHYTP24,18265
12
12
  dayhoff_tools/deployment/deploy_gcp.py,sha256=xgaOVsUDmP6wSEMYNkm1yRNcVskfdz80qJtCulkBIAM,8860
@@ -27,7 +27,7 @@ dayhoff_tools/intake/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJq
27
27
  dayhoff_tools/logs.py,sha256=DKdeP0k0kliRcilwvX0mUB2eipO5BdWUeHwh-VnsICs,838
28
28
  dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
29
29
  dayhoff_tools/warehouse.py,sha256=heaYc64qplgN3_1WVPFmqj53goStioWwY5NqlWc4c0s,24453
30
- dayhoff_tools-1.7.2.dist-info/METADATA,sha256=1KogZl3g9T9txdfivL4fwXNE5TOtpmAAUv4VwImxBpo,2914
31
- dayhoff_tools-1.7.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- dayhoff_tools-1.7.2.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
- dayhoff_tools-1.7.2.dist-info/RECORD,,
30
+ dayhoff_tools-1.7.3.dist-info/METADATA,sha256=WAnl4yvnUfIK6m7enSKQ154Pcy0IplNFNrXnVhsmy1c,2914
31
+ dayhoff_tools-1.7.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ dayhoff_tools-1.7.3.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
+ dayhoff_tools-1.7.3.dist-info/RECORD,,