dayhoff-tools 1.7.5__tar.gz → 1.8.0__tar.gz
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-1.7.5 → dayhoff_tools-1.8.0}/PKG-INFO +1 -1
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/cli/main.py +5 -2
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/cli/utility_commands.py +77 -59
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/warehouse.py +3 -1
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/pyproject.toml +1 -1
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/README.md +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/cli/engine_commands.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.7.5 → dayhoff_tools-1.8.0}/dayhoff_tools/sqlite.py +0 -0
@@ -22,6 +22,7 @@ from dayhoff_tools.warehouse import (
|
|
22
22
|
import_from_warehouse_typer,
|
23
23
|
)
|
24
24
|
|
25
|
+
|
25
26
|
def _get_dht_version() -> str:
|
26
27
|
try:
|
27
28
|
return version("dayhoff-tools")
|
@@ -35,7 +36,9 @@ def _get_dht_version() -> str:
|
|
35
36
|
return "unknown"
|
36
37
|
|
37
38
|
|
38
|
-
app = typer.Typer(
|
39
|
+
app = typer.Typer(
|
40
|
+
help=f"Dayhoff Tools (dh) v{_get_dht_version()}\n\nUse 'dh --version' to print version and exit."
|
41
|
+
)
|
39
42
|
|
40
43
|
# Utility commands
|
41
44
|
app.command("clean")(delete_local_branch)
|
@@ -73,7 +76,7 @@ def _version_option(
|
|
73
76
|
"-v",
|
74
77
|
help="Print version and exit.",
|
75
78
|
is_eager=True,
|
76
|
-
)
|
79
|
+
),
|
77
80
|
):
|
78
81
|
"""Global options for the dh CLI (e.g., version)."""
|
79
82
|
if version_flag:
|
@@ -9,7 +9,6 @@ from pathlib import Path
|
|
9
9
|
|
10
10
|
import toml
|
11
11
|
import typer
|
12
|
-
import yaml
|
13
12
|
|
14
13
|
# Import cloud helper lazily inside functions to avoid heavy deps at module load
|
15
14
|
|
@@ -370,11 +369,15 @@ def install_dependencies(
|
|
370
369
|
print("Ensuring lock file matches pyproject.mac.toml (Mac devcon)…")
|
371
370
|
lock_cmd = ["uv", "lock"]
|
372
371
|
print(f"Running command: {BLUE}{' '.join(lock_cmd)}{RESET}")
|
373
|
-
subprocess.run(
|
372
|
+
subprocess.run(
|
373
|
+
lock_cmd, check=True, capture_output=True, cwd=str(mac_uv_dir)
|
374
|
+
)
|
374
375
|
|
375
376
|
# Sync into the active environment
|
376
377
|
if install_project:
|
377
|
-
print(
|
378
|
+
print(
|
379
|
+
"Syncing dependencies into ACTIVE env and installing project [full]…"
|
380
|
+
)
|
378
381
|
sync_cmd = ["uv", "sync", "--all-groups", "--active"]
|
379
382
|
print(f"Running command: {BLUE}{' '.join(sync_cmd)}{RESET}")
|
380
383
|
subprocess.run(sync_cmd, check=True, cwd=str(mac_uv_dir))
|
@@ -385,7 +388,13 @@ def install_dependencies(
|
|
385
388
|
print("Project installed with 'full' extras successfully.")
|
386
389
|
else:
|
387
390
|
print("Syncing dependencies into ACTIVE env (project not installed)…")
|
388
|
-
sync_cmd = [
|
391
|
+
sync_cmd = [
|
392
|
+
"uv",
|
393
|
+
"sync",
|
394
|
+
"--all-groups",
|
395
|
+
"--no-install-project",
|
396
|
+
"--active",
|
397
|
+
]
|
389
398
|
print(f"Running command: {BLUE}{' '.join(sync_cmd)}{RESET}")
|
390
399
|
subprocess.run(sync_cmd, check=True, cwd=str(mac_uv_dir))
|
391
400
|
print("Dependencies synced successfully (project not installed).")
|
@@ -403,7 +412,13 @@ def install_dependencies(
|
|
403
412
|
subprocess.run(sync_cmd, check=True)
|
404
413
|
else:
|
405
414
|
print("Syncing dependencies into ACTIVE env (project not installed)…")
|
406
|
-
sync_cmd = [
|
415
|
+
sync_cmd = [
|
416
|
+
"uv",
|
417
|
+
"sync",
|
418
|
+
"--all-groups",
|
419
|
+
"--no-install-project",
|
420
|
+
"--active",
|
421
|
+
]
|
407
422
|
print(f"Running command: {BLUE}{' '.join(sync_cmd)}{RESET}")
|
408
423
|
subprocess.run(sync_cmd, check=True)
|
409
424
|
print("Dependencies synced successfully (project not installed).")
|
@@ -436,16 +451,16 @@ def update_dependencies(
|
|
436
451
|
"""Update dependencies to newer versions (Mac-aware, active venv friendly).
|
437
452
|
|
438
453
|
- Default Action (no flags): Updates only 'dayhoff-tools' package to latest,
|
439
|
-
updates
|
454
|
+
updates ALL manifest files with the version constraint, and syncs.
|
440
455
|
- Flags:
|
441
456
|
--all/-a: Updates all dependencies (uv lock --upgrade) and syncs.
|
442
457
|
|
443
|
-
|
444
|
-
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
458
|
+
Cross-platform behavior:
|
459
|
+
- Always updates BOTH `pyproject.toml` and `pyproject.mac.toml` (if they exist)
|
460
|
+
to ensure version consistency across AWS and Mac platforms.
|
461
|
+
- On Mac: If STUDIO_PLATFORM=mac and `pyproject.mac.toml` exists, operates in
|
462
|
+
`.mac_uv_project/` and copies `pyproject.mac.toml` to `.mac_uv_project/pyproject.toml`.
|
463
|
+
- Always uses `--active` for sync to target the active venv.
|
449
464
|
"""
|
450
465
|
# ANSI color codes
|
451
466
|
BLUE = "\033[94m"
|
@@ -491,7 +506,7 @@ def update_dependencies(
|
|
491
506
|
print(f"Running command: {BLUE}{' '.join(lock_cmd)}{RESET}")
|
492
507
|
subprocess.run(lock_cmd, check=True, capture_output=True, cwd=uv_cwd)
|
493
508
|
|
494
|
-
# Step 2: Update
|
509
|
+
# Step 2: Update both manifest files if doing the dayhoff update (default)
|
495
510
|
if run_pyproject_update:
|
496
511
|
print(f"Reading {lock_file_path} to find new dayhoff-tools version...")
|
497
512
|
if not lock_file_path.exists():
|
@@ -518,59 +533,62 @@ def update_dependencies(
|
|
518
533
|
return
|
519
534
|
|
520
535
|
print(f"Found dayhoff-tools version {locked_version} in lock file.")
|
521
|
-
print(f"Updating {manifest_path_for_constraint} version constraint...")
|
522
|
-
try:
|
523
|
-
content = manifest_path_for_constraint.read_text()
|
524
536
|
|
525
|
-
|
526
|
-
|
537
|
+
# Update both manifest files to ensure consistency across platforms
|
538
|
+
manifest_files_to_update = []
|
539
|
+
if pyproject_path.exists():
|
540
|
+
manifest_files_to_update.append(pyproject_path)
|
541
|
+
if mac_manifest.exists():
|
542
|
+
manifest_files_to_update.append(mac_manifest)
|
527
543
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
re.MULTILINE,
|
532
|
-
)
|
544
|
+
if not manifest_files_to_update:
|
545
|
+
print("Warning: No manifest files found to update.")
|
546
|
+
return
|
533
547
|
|
534
|
-
|
548
|
+
package_name = "dayhoff-tools"
|
549
|
+
package_name_esc = re.escape(package_name)
|
535
550
|
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
f"{prefix}{package_name}{extras}{new_constraint_text}{suffix}"
|
542
|
-
)
|
551
|
+
# Regex to match the dependency line, with optional extras and version spec
|
552
|
+
pattern = re.compile(
|
553
|
+
rf"^(\s*['\"]){package_name_esc}(\[[^]]+\])?(?:[><=~^][^'\"]*)?(['\"].*)$",
|
554
|
+
re.MULTILINE,
|
555
|
+
)
|
543
556
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
557
|
+
new_constraint_text = f">={locked_version}"
|
558
|
+
|
559
|
+
def _repl(match: re.Match):
|
560
|
+
prefix = match.group(1)
|
561
|
+
extras = match.group(2) or ""
|
562
|
+
suffix = match.group(3)
|
563
|
+
return f"{prefix}{package_name}{extras}{new_constraint_text}{suffix}"
|
564
|
+
|
565
|
+
# Update all manifest files
|
566
|
+
updated_files = []
|
567
|
+
for manifest_file in manifest_files_to_update:
|
568
|
+
try:
|
569
|
+
print(f"Updating {manifest_file} version constraint...")
|
570
|
+
content = manifest_file.read_text()
|
571
|
+
new_content, num_replacements = pattern.subn(_repl, content)
|
572
|
+
if num_replacements > 0:
|
573
|
+
manifest_file.write_text(new_content)
|
574
|
+
print(
|
575
|
+
f"Updated dayhoff-tools constraint in {manifest_file} to '{new_constraint_text}'"
|
576
|
+
)
|
577
|
+
updated_files.append(str(manifest_file))
|
564
578
|
else:
|
565
579
|
print(
|
566
|
-
f"Warning: Could not find dayhoff-tools dependency line in {
|
580
|
+
f"Warning: Could not find dayhoff-tools dependency line in {manifest_file}"
|
567
581
|
)
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
582
|
+
except FileNotFoundError:
|
583
|
+
print(f"Warning: {manifest_file} not found.")
|
584
|
+
except Exception as e:
|
585
|
+
print(f"Error updating {manifest_file}: {e}")
|
586
|
+
|
587
|
+
if not updated_files:
|
588
|
+
print(
|
589
|
+
"Warning: No manifest files were successfully updated with dayhoff-tools constraint."
|
590
|
+
)
|
591
|
+
print("Proceeding with sync despite manifest update failures.")
|
574
592
|
|
575
593
|
# Step 3: Sync environment
|
576
594
|
print("Syncing environment with updated lock file...")
|
@@ -584,7 +602,7 @@ def update_dependencies(
|
|
584
602
|
print("All dependencies updated and environment synced successfully.")
|
585
603
|
else: # Default case (dayhoff update)
|
586
604
|
print(
|
587
|
-
"dayhoff-tools updated,
|
605
|
+
"dayhoff-tools updated, manifest files modified, and environment synced successfully."
|
588
606
|
)
|
589
607
|
|
590
608
|
except subprocess.CalledProcessError as e:
|
@@ -19,7 +19,9 @@ def _find_project_root() -> Path | None:
|
|
19
19
|
"""
|
20
20
|
current_dir = Path.cwd().resolve()
|
21
21
|
while current_dir != current_dir.parent:
|
22
|
-
if (current_dir / ".git").is_dir() or (
|
22
|
+
if (current_dir / ".git").is_dir() or (
|
23
|
+
current_dir / "pyproject.toml"
|
24
|
+
).is_file():
|
23
25
|
return current_dir
|
24
26
|
current_dir = current_dir.parent
|
25
27
|
# Check the final directory in the hierarchy (e.g., '/')
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "dayhoff-tools"
|
8
|
-
version = "1.
|
8
|
+
version = "1.8.0"
|
9
9
|
description = "Common tools for all the repos at Dayhoff Labs"
|
10
10
|
authors = [
|
11
11
|
{name = "Daniel Martin-Alarcon", email = "dma@dayhofflabs.com"}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|