dayhoff-tools 1.11.2__tar.gz → 1.11.3__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.
Files changed (38) hide show
  1. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/PKG-INFO +1 -1
  2. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/utility_commands.py +116 -81
  3. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/pyproject.toml +14 -8
  4. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/README.md +0 -0
  5. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/__init__.py +0 -0
  6. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/chemistry/standardizer.py +0 -0
  7. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/chemistry/utils.py +0 -0
  8. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/__init__.py +0 -0
  9. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/cloud_commands.py +0 -0
  10. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/__init__.py +0 -0
  11. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/engine_core.py +0 -0
  12. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/engine_lifecycle.py +0 -0
  13. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/engine_maintenance.py +0 -0
  14. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/engine_management.py +0 -0
  15. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/shared.py +0 -0
  16. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/engine/studio_commands.py +0 -0
  17. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/main.py +0 -0
  18. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/cli/swarm_commands.py +0 -0
  19. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/base.py +0 -0
  20. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/deploy_aws.py +0 -0
  21. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
  22. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/deploy_utils.py +0 -0
  23. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/job_runner.py +0 -0
  24. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/processors.py +0 -0
  25. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/deployment/swarm.py +0 -0
  26. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/embedders.py +0 -0
  27. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/fasta.py +0 -0
  28. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/file_ops.py +0 -0
  29. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/h5.py +0 -0
  30. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/intake/gcp.py +0 -0
  31. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/intake/gtdb.py +0 -0
  32. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/intake/kegg.py +0 -0
  33. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/intake/mmseqs.py +0 -0
  34. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/intake/structure.py +0 -0
  35. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/intake/uniprot.py +0 -0
  36. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/logs.py +0 -0
  37. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/sqlite.py +0 -0
  38. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.3}/dayhoff_tools/warehouse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dayhoff-tools
3
- Version: 1.11.2
3
+ Version: 1.11.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
@@ -423,58 +423,79 @@ def sync_with_toml(
423
423
  with open("pyproject.workstation.toml", "r") as f:
424
424
  content = f.read()
425
425
 
426
- # Extract dependencies list
427
- deps_match = re.search(r"dependencies\s*=\s*\[(.*?)\]", content, re.DOTALL)
428
- if deps_match:
429
- deps_text = deps_match.group(1)
430
- deps = []
431
- for line in deps_text.split("\n"):
432
- line = line.strip()
433
- if line.startswith('"') or line.startswith("'"):
434
- dep = re.sub(r'["\']', "", line)
435
- dep = re.sub(r",?\s*#.*$", "", dep)
436
- dep = dep.strip().rstrip(",")
437
- if dep:
438
- deps.append(dep)
439
-
440
- if deps:
441
- pip_cmd = (
442
- [sys.executable, "-m", "pip", "install"]
443
- + deps
444
- + ["-c", "constraints.txt"]
445
- )
446
- print(
447
- f"Running command: {BLUE}{' '.join(pip_cmd[:5])} ... -c constraints.txt{RESET}"
448
- )
449
- subprocess.run(pip_cmd, check=True)
426
+ # Extract dependencies list using line-by-line parsing to handle [] in package names
427
+ lines = content.split("\n")
428
+ in_deps = False
429
+ deps_lines = []
430
+
431
+ for line in lines:
432
+ if re.match(r"\s*dependencies\s*=\s*\[", line):
433
+ in_deps = True
434
+ continue
435
+ if in_deps:
436
+ if re.match(r"^\s*\]\s*$", line):
437
+ break
438
+ deps_lines.append(line)
439
+
440
+ deps = []
441
+ for line in deps_lines:
442
+ line = line.strip()
443
+ if line.startswith('"') or line.startswith("'"):
444
+ dep = re.sub(r'["\']', "", line)
445
+ dep = re.sub(r",?\s*#.*$", "", dep)
446
+ dep = dep.strip().rstrip(",")
447
+ if dep:
448
+ deps.append(dep)
449
+
450
+ if deps:
451
+ pip_cmd = (
452
+ [sys.executable, "-m", "pip", "install"]
453
+ + deps
454
+ + ["-c", "constraints.txt"]
455
+ )
456
+ print(
457
+ f"Running command: {BLUE}{' '.join(pip_cmd[:5])} ... -c constraints.txt{RESET}"
458
+ )
459
+ subprocess.run(pip_cmd, check=True)
450
460
 
451
- # Install dev dependencies
452
- dev_match = re.search(
453
- r"\[dependency-groups\]\s*dev\s*=\s*\[(.*?)\]", content, re.DOTALL
454
- )
455
- if dev_match:
456
- dev_text = dev_match.group(1)
457
- dev_deps = []
458
- for line in dev_text.split("\n"):
459
- line = line.strip()
460
- if line.startswith('"') or line.startswith("'"):
461
- dep = re.sub(r'["\']', "", line)
462
- dep = re.sub(r",?\s*#.*$", "", dep)
463
- dep = dep.strip().rstrip(",")
464
- if dep:
465
- dev_deps.append(dep)
466
-
467
- if dev_deps:
468
- print("Installing dev dependencies...")
469
- pip_cmd = (
470
- [sys.executable, "-m", "pip", "install"]
471
- + dev_deps
472
- + ["-c", "constraints.txt"]
473
- )
474
- print(
475
- f"Running command: {BLUE}{' '.join(pip_cmd[:5])} ... -c constraints.txt{RESET}"
476
- )
477
- subprocess.run(pip_cmd, check=True)
461
+ # Install dev dependencies using line-by-line parsing
462
+ in_dev_groups = False
463
+ in_dev_list = False
464
+ dev_lines = []
465
+
466
+ for line in lines:
467
+ if re.match(r"\s*\[dependency-groups\]", line):
468
+ in_dev_groups = True
469
+ continue
470
+ if in_dev_groups and re.match(r"\s*dev\s*=\s*\[", line):
471
+ in_dev_list = True
472
+ continue
473
+ if in_dev_list:
474
+ if re.match(r"^\s*\]\s*$", line):
475
+ break
476
+ dev_lines.append(line)
477
+
478
+ dev_deps = []
479
+ for line in dev_lines:
480
+ line = line.strip()
481
+ if line.startswith('"') or line.startswith("'"):
482
+ dep = re.sub(r'["\']', "", line)
483
+ dep = re.sub(r",?\s*#.*$", "", dep)
484
+ dep = dep.strip().rstrip(",")
485
+ if dep:
486
+ dev_deps.append(dep)
487
+
488
+ if dev_deps:
489
+ print("Installing dev dependencies...")
490
+ pip_cmd = (
491
+ [sys.executable, "-m", "pip", "install"]
492
+ + dev_deps
493
+ + ["-c", "constraints.txt"]
494
+ )
495
+ print(
496
+ f"Running command: {BLUE}{' '.join(pip_cmd[:5])} ... -c constraints.txt{RESET}"
497
+ )
498
+ subprocess.run(pip_cmd, check=True)
478
499
 
479
500
  # Install project if requested
480
501
  if install_project:
@@ -728,48 +749,62 @@ def add_dependency(
728
749
 
729
750
  if dev:
730
751
  # Add to [dependency-groups] dev section
731
- # Find the dev = [ ... ] block
732
- dev_match = re.search(
733
- r"(\[dependency-groups\]\s*dev\s*=\s*\[)(.*?)(\])",
734
- content,
735
- re.DOTALL,
736
- )
737
- if not dev_match:
752
+ # Use line-by-line parsing to handle [] in dependency names like dayhoff-tools[full]
753
+ lines = content.split("\n")
754
+ in_dev_groups = False
755
+ in_dev_list = False
756
+ dev_start_idx = None
757
+ dev_end_idx = None
758
+
759
+ for idx, line in enumerate(lines):
760
+ if re.match(r"\s*\[dependency-groups\]", line):
761
+ in_dev_groups = True
762
+ continue
763
+ if in_dev_groups and re.match(r"\s*dev\s*=\s*\[", line):
764
+ in_dev_list = True
765
+ dev_start_idx = idx
766
+ continue
767
+ if in_dev_list and re.match(r"^\s*\]\s*$", line):
768
+ dev_end_idx = idx
769
+ break
770
+
771
+ if dev_start_idx is None or dev_end_idx is None:
738
772
  print(
739
773
  f"Warning: Could not find [dependency-groups] dev section in {manifest_file}"
740
774
  )
741
775
  continue
742
776
 
743
- # Insert new dependency at the end of the list
744
- before = dev_match.group(1)
745
- deps_block = dev_match.group(2)
746
- after = dev_match.group(3)
747
-
748
- # Add with proper indentation
749
- new_dep = f' "{package}",\n'
750
- new_content = content.replace(
751
- dev_match.group(0), f"{before}{deps_block}{new_dep}{after}"
752
- )
777
+ # Insert new dependency before the closing ]
778
+ new_dep = f' "{package}",'
779
+ lines.insert(dev_end_idx, new_dep)
780
+ new_content = "\n".join(lines)
753
781
  else:
754
782
  # Add to [project] dependencies section
755
- deps_match = re.search(
756
- r"(dependencies\s*=\s*\[)(.*?)(\])", content, re.DOTALL
757
- )
758
- if not deps_match:
783
+ # Use line-by-line parsing to handle [] in dependency names like dayhoff-tools[full]
784
+ lines = content.split("\n")
785
+ in_deps = False
786
+ deps_start_idx = None
787
+ deps_end_idx = None
788
+
789
+ for idx, line in enumerate(lines):
790
+ if re.match(r"\s*dependencies\s*=\s*\[", line):
791
+ in_deps = True
792
+ deps_start_idx = idx
793
+ continue
794
+ if in_deps and re.match(r"^\s*\]\s*$", line):
795
+ deps_end_idx = idx
796
+ break
797
+
798
+ if deps_start_idx is None or deps_end_idx is None:
759
799
  print(
760
800
  f"Warning: Could not find dependencies section in {manifest_file}"
761
801
  )
762
802
  continue
763
803
 
764
- before = deps_match.group(1)
765
- deps_block = deps_match.group(2)
766
- after = deps_match.group(3)
767
-
768
- # Add with proper indentation
769
- new_dep = f' "{package}",\n'
770
- new_content = content.replace(
771
- deps_match.group(0), f"{before}{deps_block}{new_dep}{after}"
772
- )
804
+ # Insert new dependency before the closing ]
805
+ new_dep = f' "{package}",'
806
+ lines.insert(deps_end_idx, new_dep)
807
+ new_content = "\n".join(lines)
773
808
 
774
809
  manifest_file.write_text(new_content)
775
810
  print(f"✅ Added '{package}' to {manifest_file}")
@@ -1,5 +1,3 @@
1
- # This Mac-specific pyproject uses CPU-friendly pins and removes CUDA index mapping.
2
-
3
1
  # This block is needed because we package DHT for PyPi.
4
2
  [build-system]
5
3
  requires = ["poetry-core>=2.0"]
@@ -7,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
7
5
 
8
6
  [project]
9
7
  name = "dayhoff-tools"
10
- version = "1.11.2"
8
+ version = "1.11.3"
11
9
  description = "Common tools for all the repos at Dayhoff Labs"
12
10
  authors = [
13
11
  {name = "Daniel Martin-Alarcon", email = "dma@dayhofflabs.com"}
@@ -51,9 +49,17 @@ embedders = [
51
49
  "transformers>=4.36.2",
52
50
  ]
53
51
 
54
- # Use CPU variants for dev dependencies on Mac
55
- [tool.uv]
56
- dev-dependencies = [
52
+ [[tool.uv.index]]
53
+ name = "torch-cuda"
54
+ url = "https://download.pytorch.org/whl/cu121"
55
+ explicit = true
56
+
57
+ [tool.uv.sources]
58
+ torch = { index = "torch-cuda" }
59
+ torchvision = { index = "torch-cuda" }
60
+
61
+ [dependency-groups]
62
+ dev = [
57
63
  "black>=25.1.0,<26",
58
64
  "boto3>=1.36.8",
59
65
  "colorlog>=6.8.2,<7",
@@ -73,8 +79,8 @@ dev-dependencies = [
73
79
  "pytest>=8.0.2,<9",
74
80
  "pytest-cov>=4.1.0,<5",
75
81
  "pytest-mock>=3.12.0,<4",
76
- "torch==2.4.*",
77
- "torchvision==0.19.*",
82
+ "torch==2.4.0+cu121",
83
+ "torchvision==0.19.0+cu121",
78
84
  ]
79
85
 
80
86
  [project.scripts]
File without changes