dayhoff-tools 1.1.0__py3-none-any.whl → 1.1.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.
- dayhoff_tools/cli/utility_commands.py +26 -41
- {dayhoff_tools-1.1.0.dist-info → dayhoff_tools-1.1.1.dist-info}/METADATA +1 -1
- {dayhoff_tools-1.1.0.dist-info → dayhoff_tools-1.1.1.dist-info}/RECORD +5 -5
- {dayhoff_tools-1.1.0.dist-info → dayhoff_tools-1.1.1.dist-info}/WHEEL +0 -0
- {dayhoff_tools-1.1.0.dist-info → dayhoff_tools-1.1.1.dist-info}/entry_points.txt +0 -0
@@ -421,28 +421,21 @@ def install_dependencies(
|
|
421
421
|
|
422
422
|
|
423
423
|
def update_dependencies(
|
424
|
-
update_dayhoff: bool = typer.Option(
|
425
|
-
False,
|
426
|
-
"--dayhoff",
|
427
|
-
"-d",
|
428
|
-
help="Update only the dayhoff-tools package to latest, update pyproject.toml, and sync.",
|
429
|
-
),
|
430
424
|
update_all: bool = typer.Option(
|
431
425
|
False,
|
432
426
|
"--all",
|
433
427
|
"-a",
|
434
|
-
help="Update all dependencies
|
428
|
+
help="Update all dependencies instead of just dayhoff-tools.",
|
435
429
|
),
|
436
430
|
):
|
437
431
|
"""Update dependencies to newer versions.
|
438
432
|
|
439
|
-
|
433
|
+
Default Action (no flags): Updates only 'dayhoff-tools' package to latest,
|
434
|
+
updates pyproject.toml, and syncs.
|
440
435
|
|
441
|
-
|
436
|
+
Flags:
|
442
437
|
--all/-a: Updates all dependencies to latest compatible versions (`uv lock --upgrade`)
|
443
|
-
and syncs the environment.
|
444
|
-
--dayhoff/-d: Updates only 'dayhoff-tools' to latest, updates its constraint
|
445
|
-
in pyproject.toml, and syncs the environment.
|
438
|
+
and syncs the environment. Overrides the default.
|
446
439
|
"""
|
447
440
|
# ANSI color codes
|
448
441
|
BLUE = "\033[94m"
|
@@ -451,28 +444,24 @@ def update_dependencies(
|
|
451
444
|
lock_file_path = Path("uv.lock")
|
452
445
|
pyproject_path = Path("pyproject.toml")
|
453
446
|
|
454
|
-
#
|
455
|
-
if not update_dayhoff and not update_all:
|
456
|
-
print(
|
457
|
-
"Error: Must specify either --dayhoff (-d) or --all (-a) to update dependencies."
|
458
|
-
)
|
459
|
-
raise typer.Exit(code=1)
|
460
|
-
if update_dayhoff and update_all:
|
461
|
-
print("Error: Cannot specify both --dayhoff (-d) and --all (-a).")
|
462
|
-
raise typer.Exit(code=1)
|
463
|
-
|
464
|
-
# Determine lock command based on flags
|
447
|
+
# Determine action based on flags
|
465
448
|
lock_cmd = ["uv", "lock"]
|
466
449
|
action_description = ""
|
450
|
+
run_pyproject_update = False
|
467
451
|
|
468
|
-
if
|
469
|
-
lock_cmd.extend(["--upgrade-package", "dayhoff-tools"])
|
470
|
-
action_description = "Updating dayhoff-tools lock and pyproject.toml..."
|
471
|
-
elif update_all:
|
452
|
+
if update_all:
|
472
453
|
lock_cmd.append("--upgrade")
|
473
454
|
action_description = (
|
474
455
|
"Updating lock file for all dependencies to latest versions..."
|
475
456
|
)
|
457
|
+
else: # Default behavior: update dayhoff-tools
|
458
|
+
lock_cmd.extend(["--upgrade-package", "dayhoff-tools"])
|
459
|
+
action_description = (
|
460
|
+
"Updating dayhoff-tools lock and pyproject.toml (default behavior)..."
|
461
|
+
)
|
462
|
+
run_pyproject_update = (
|
463
|
+
True # Only update pyproject if we are doing the dayhoff update
|
464
|
+
)
|
476
465
|
|
477
466
|
try:
|
478
467
|
# Step 1: Run the update lock command
|
@@ -480,13 +469,12 @@ def update_dependencies(
|
|
480
469
|
print(f"Running command: {BLUE}{' '.join(lock_cmd)}{RESET}")
|
481
470
|
subprocess.run(lock_cmd, check=True, capture_output=True)
|
482
471
|
|
483
|
-
# Step 2:
|
484
|
-
if
|
472
|
+
# Step 2: Update pyproject.toml only if doing the dayhoff update (default)
|
473
|
+
if run_pyproject_update:
|
485
474
|
print(f"Reading {lock_file_path} to find new dayhoff-tools version...")
|
486
475
|
if not lock_file_path.exists():
|
487
476
|
print(f"Error: {lock_file_path} not found after lock command.")
|
488
|
-
return
|
489
|
-
|
477
|
+
return
|
490
478
|
locked_version = None
|
491
479
|
try:
|
492
480
|
lock_data = toml.load(lock_file_path)
|
@@ -496,20 +484,18 @@ def update_dependencies(
|
|
496
484
|
break
|
497
485
|
except toml.TomlDecodeError as e:
|
498
486
|
print(f"Error parsing {lock_file_path}: {e}")
|
499
|
-
return
|
487
|
+
return
|
500
488
|
except Exception as e:
|
501
489
|
print(f"Error reading lock file: {e}")
|
502
|
-
return
|
490
|
+
return
|
503
491
|
|
504
492
|
if not locked_version:
|
505
493
|
print(
|
506
494
|
f"Error: Could not find dayhoff-tools version in {lock_file_path}."
|
507
495
|
)
|
508
|
-
return
|
496
|
+
return
|
509
497
|
|
510
498
|
print(f"Found dayhoff-tools version {locked_version} in lock file.")
|
511
|
-
|
512
|
-
# Update pyproject.toml constraint
|
513
499
|
print(f"Updating {pyproject_path} version constraint...")
|
514
500
|
try:
|
515
501
|
content = pyproject_path.read_text()
|
@@ -523,7 +509,6 @@ def update_dependencies(
|
|
523
509
|
new_content, num_replacements = pattern.subn(
|
524
510
|
replacement_string, content
|
525
511
|
)
|
526
|
-
|
527
512
|
if num_replacements > 0:
|
528
513
|
pyproject_path.write_text(new_content)
|
529
514
|
print(
|
@@ -535,7 +520,7 @@ def update_dependencies(
|
|
535
520
|
)
|
536
521
|
except FileNotFoundError:
|
537
522
|
print(f"Error: {pyproject_path} not found.")
|
538
|
-
return
|
523
|
+
return
|
539
524
|
except Exception as e:
|
540
525
|
print(f"Error updating {pyproject_path}: {e}")
|
541
526
|
print("Proceeding with sync despite pyproject.toml update error.")
|
@@ -548,12 +533,12 @@ def update_dependencies(
|
|
548
533
|
subprocess.run(sync_cmd, check=True)
|
549
534
|
|
550
535
|
# Final status message
|
551
|
-
if
|
536
|
+
if update_all:
|
537
|
+
print("All dependencies updated and environment synced successfully.")
|
538
|
+
else: # Default case (dayhoff update)
|
552
539
|
print(
|
553
540
|
"dayhoff-tools updated, pyproject.toml modified, and environment synced successfully."
|
554
541
|
)
|
555
|
-
elif update_all:
|
556
|
-
print("All dependencies updated and environment synced successfully.")
|
557
542
|
|
558
543
|
except subprocess.CalledProcessError as e:
|
559
544
|
stderr_output = e.stderr.decode() if e.stderr else "No stderr output."
|
@@ -5,7 +5,7 @@ dayhoff_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
5
5
|
dayhoff_tools/cli/cloud_commands.py,sha256=KiYEuD3nSg8QPWBYfrhdze2La_CJe4iqK-8uOAHyS8U,35827
|
6
6
|
dayhoff_tools/cli/main.py,sha256=O-kPX0Di3_W0yBd-jSzQrOKm4K3deV_-jQhOom6Ir5g,3875
|
7
7
|
dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
|
8
|
-
dayhoff_tools/cli/utility_commands.py,sha256=
|
8
|
+
dayhoff_tools/cli/utility_commands.py,sha256=KgF_shWIfzZyKVl9VKqhVm5WJwp0YCvYFadnN3fLZeU,21211
|
9
9
|
dayhoff_tools/deployment/base.py,sha256=u-AjbtHnFLoLt33dhYXHIpV-6jcieMEHHGBGN_U9Hm0,15626
|
10
10
|
dayhoff_tools/deployment/deploy_aws.py,sha256=O0gQxHioSU_sNU8T8MD4wSOPvWc--V8eRRZzlRu035I,16446
|
11
11
|
dayhoff_tools/deployment/deploy_gcp.py,sha256=DxBM4sUzwPK9RWLP9bSfr38n1HHl-TVrp4TsbdN8pUA,5795
|
@@ -25,7 +25,7 @@ dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
|
|
25
25
|
dayhoff_tools/structure.py,sha256=ufN3gAodQxhnt7psK1VTQeu9rKERmo_PhoxIbB4QKMw,27660
|
26
26
|
dayhoff_tools/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJqE4,16456
|
27
27
|
dayhoff_tools/warehouse.py,sha256=TqV8nex1AluNaL4JuXH5zuu9P7qmE89lSo6f_oViy6U,14965
|
28
|
-
dayhoff_tools-1.1.
|
29
|
-
dayhoff_tools-1.1.
|
30
|
-
dayhoff_tools-1.1.
|
31
|
-
dayhoff_tools-1.1.
|
28
|
+
dayhoff_tools-1.1.1.dist-info/METADATA,sha256=UQv5qilixD2tR0TaF5UHN22BZKPqg7L2bd9my01EyqM,2213
|
29
|
+
dayhoff_tools-1.1.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
30
|
+
dayhoff_tools-1.1.1.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
|
31
|
+
dayhoff_tools-1.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|