dayhoff-tools 1.11.2__tar.gz → 1.11.4__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.4}/PKG-INFO +1 -1
  2. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/utility_commands.py +160 -119
  3. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/pyproject.toml +14 -8
  4. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/README.md +0 -0
  5. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/__init__.py +0 -0
  6. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/chemistry/standardizer.py +0 -0
  7. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/chemistry/utils.py +0 -0
  8. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/__init__.py +0 -0
  9. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/cloud_commands.py +0 -0
  10. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/__init__.py +0 -0
  11. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/engine_core.py +0 -0
  12. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/engine_lifecycle.py +0 -0
  13. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/engine_maintenance.py +0 -0
  14. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/engine_management.py +0 -0
  15. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/shared.py +0 -0
  16. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/engine/studio_commands.py +0 -0
  17. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/main.py +0 -0
  18. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/cli/swarm_commands.py +0 -0
  19. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/base.py +0 -0
  20. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/deploy_aws.py +0 -0
  21. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
  22. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/deploy_utils.py +0 -0
  23. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/job_runner.py +0 -0
  24. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/processors.py +0 -0
  25. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/deployment/swarm.py +0 -0
  26. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/embedders.py +0 -0
  27. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/fasta.py +0 -0
  28. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/file_ops.py +0 -0
  29. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/h5.py +0 -0
  30. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/intake/gcp.py +0 -0
  31. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/intake/gtdb.py +0 -0
  32. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/intake/kegg.py +0 -0
  33. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/intake/mmseqs.py +0 -0
  34. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/intake/structure.py +0 -0
  35. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/intake/uniprot.py +0 -0
  36. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/logs.py +0 -0
  37. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/dayhoff_tools/sqlite.py +0 -0
  38. {dayhoff_tools-1.11.2 → dayhoff_tools-1.11.4}/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.4
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
@@ -219,6 +219,7 @@ def build_and_upload_wheel(bump_part: str = "patch"):
219
219
  # Build wheel and sdist
220
220
  # UV expects pyproject.toml, so temporarily copy the platform manifest
221
221
  backup_created = False
222
+ temp_pyproject_created = False
222
223
  if pyproject_path != "pyproject.toml":
223
224
  if Path("pyproject.toml").exists():
224
225
  Path("pyproject.toml").rename("pyproject.toml.build.bak")
@@ -226,48 +227,53 @@ def build_and_upload_wheel(bump_part: str = "patch"):
226
227
  Path(pyproject_path).read_text()
227
228
  with open("pyproject.toml", "w") as f:
228
229
  f.write(Path(pyproject_path).read_text())
230
+ temp_pyproject_created = True
229
231
 
230
- build_cmd = ["uv", "build"]
231
- # Print command in blue
232
- print(f"Running command: {BLUE}{' '.join(build_cmd)}{RESET}")
233
- subprocess.run(build_cmd, check=True)
234
-
235
- # Restore original state
236
- if pyproject_path != "pyproject.toml":
237
- Path("pyproject.toml").unlink()
238
- if backup_created:
239
- Path("pyproject.toml.build.bak").rename("pyproject.toml")
240
-
241
- # Upload using uv publish with explicit arguments
242
- # Print masked command in blue
243
- print(f"Running command: {BLUE}{' '.join(publish_cmd_safe_print)}{RESET}")
244
- subprocess.run(
245
- publish_cmd, # Use the actual command with token
246
- check=True,
247
- )
232
+ try:
233
+ build_cmd = ["uv", "build"]
234
+ # Print command in blue
235
+ print(f"Running command: {BLUE}{' '.join(build_cmd)}{RESET}")
236
+ subprocess.run(build_cmd, check=True)
237
+
238
+ # Upload using uv publish with explicit arguments
239
+ # Print masked command in blue
240
+ print(f"Running command: {BLUE}{' '.join(publish_cmd_safe_print)}{RESET}")
241
+ subprocess.run(
242
+ publish_cmd, # Use the actual command with token
243
+ check=True,
244
+ )
248
245
 
249
- print(f"Successfully built and uploaded version {new_version} to PyPI")
246
+ print(f"Successfully built and uploaded version {new_version} to PyPI")
250
247
 
251
- # Re-install DHT in current venv when building from DHT itself
252
- try:
253
- proj_name = None
248
+ # Re-install DHT in current venv when building from DHT itself
249
+ # (Keep temp pyproject.toml until after this step)
254
250
  try:
255
- proj_toml = toml.load(pyproject_path)
256
- proj_name = (
257
- proj_toml.get("project", {}).get("name")
258
- if isinstance(proj_toml, dict)
259
- else None
260
- )
261
- except Exception:
262
- pass
263
- if proj_name == "dayhoff-tools":
264
- print("Re-installing dayhoff-tools into the active environment…")
265
- reinstall_cmd = ["uv", "pip", "install", "-e", ".[full]"]
266
- print(f"Running command: {BLUE}{' '.join(reinstall_cmd)}{RESET}")
267
- subprocess.run(reinstall_cmd, check=True)
268
- print("dayhoff-tools reinstalled in the current environment.")
269
- except subprocess.CalledProcessError as e:
270
- print(f"Warning: Failed to reinstall dayhoff-tools locally: {e}")
251
+ proj_name = None
252
+ try:
253
+ proj_toml = toml.load(pyproject_path)
254
+ proj_name = (
255
+ proj_toml.get("project", {}).get("name")
256
+ if isinstance(proj_toml, dict)
257
+ else None
258
+ )
259
+ except Exception:
260
+ pass
261
+ if proj_name == "dayhoff-tools":
262
+ print("Re-installing dayhoff-tools into the active environment…")
263
+ reinstall_cmd = ["uv", "pip", "install", "-e", ".[full]"]
264
+ print(f"Running command: {BLUE}{' '.join(reinstall_cmd)}{RESET}")
265
+ subprocess.run(reinstall_cmd, check=True)
266
+ print("dayhoff-tools reinstalled in the current environment.")
267
+ except subprocess.CalledProcessError as e:
268
+ print(f"Warning: Failed to reinstall dayhoff-tools locally: {e}")
269
+
270
+ finally:
271
+ # Restore original state (always clean up, even if errors occurred)
272
+ if temp_pyproject_created:
273
+ if Path("pyproject.toml").exists():
274
+ Path("pyproject.toml").unlink()
275
+ if backup_created and Path("pyproject.toml.build.bak").exists():
276
+ Path("pyproject.toml.build.bak").rename("pyproject.toml")
271
277
 
272
278
  except FileNotFoundError:
273
279
  print(f"Error: {pyproject_path} not found.")
@@ -423,58 +429,79 @@ def sync_with_toml(
423
429
  with open("pyproject.workstation.toml", "r") as f:
424
430
  content = f.read()
425
431
 
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)
432
+ # Extract dependencies list using line-by-line parsing to handle [] in package names
433
+ lines = content.split("\n")
434
+ in_deps = False
435
+ deps_lines = []
450
436
 
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)
437
+ for line in lines:
438
+ if re.match(r"\s*dependencies\s*=\s*\[", line):
439
+ in_deps = True
440
+ continue
441
+ if in_deps:
442
+ if re.match(r"^\s*\]\s*$", line):
443
+ break
444
+ deps_lines.append(line)
445
+
446
+ deps = []
447
+ for line in deps_lines:
448
+ line = line.strip()
449
+ if line.startswith('"') or line.startswith("'"):
450
+ dep = re.sub(r'["\']', "", line)
451
+ dep = re.sub(r",?\s*#.*$", "", dep)
452
+ dep = dep.strip().rstrip(",")
453
+ if dep:
454
+ deps.append(dep)
455
+
456
+ if deps:
457
+ pip_cmd = (
458
+ [sys.executable, "-m", "pip", "install"]
459
+ + deps
460
+ + ["-c", "constraints.txt"]
461
+ )
462
+ print(
463
+ f"Running command: {BLUE}{' '.join(pip_cmd[:5])} ... -c constraints.txt{RESET}"
464
+ )
465
+ subprocess.run(pip_cmd, check=True)
466
+
467
+ # Install dev dependencies using line-by-line parsing
468
+ in_dev_groups = False
469
+ in_dev_list = False
470
+ dev_lines = []
471
+
472
+ for line in lines:
473
+ if re.match(r"\s*\[dependency-groups\]", line):
474
+ in_dev_groups = True
475
+ continue
476
+ if in_dev_groups and re.match(r"\s*dev\s*=\s*\[", line):
477
+ in_dev_list = True
478
+ continue
479
+ if in_dev_list:
480
+ if re.match(r"^\s*\]\s*$", line):
481
+ break
482
+ dev_lines.append(line)
483
+
484
+ dev_deps = []
485
+ for line in dev_lines:
486
+ line = line.strip()
487
+ if line.startswith('"') or line.startswith("'"):
488
+ dep = re.sub(r'["\']', "", line)
489
+ dep = re.sub(r",?\s*#.*$", "", dep)
490
+ dep = dep.strip().rstrip(",")
491
+ if dep:
492
+ dev_deps.append(dep)
493
+
494
+ if dev_deps:
495
+ print("Installing dev dependencies...")
496
+ pip_cmd = (
497
+ [sys.executable, "-m", "pip", "install"]
498
+ + dev_deps
499
+ + ["-c", "constraints.txt"]
500
+ )
501
+ print(
502
+ f"Running command: {BLUE}{' '.join(pip_cmd[:5])} ... -c constraints.txt{RESET}"
503
+ )
504
+ subprocess.run(pip_cmd, check=True)
478
505
 
479
506
  # Install project if requested
480
507
  if install_project:
@@ -728,48 +755,62 @@ def add_dependency(
728
755
 
729
756
  if dev:
730
757
  # 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:
758
+ # Use line-by-line parsing to handle [] in dependency names like dayhoff-tools[full]
759
+ lines = content.split("\n")
760
+ in_dev_groups = False
761
+ in_dev_list = False
762
+ dev_start_idx = None
763
+ dev_end_idx = None
764
+
765
+ for idx, line in enumerate(lines):
766
+ if re.match(r"\s*\[dependency-groups\]", line):
767
+ in_dev_groups = True
768
+ continue
769
+ if in_dev_groups and re.match(r"\s*dev\s*=\s*\[", line):
770
+ in_dev_list = True
771
+ dev_start_idx = idx
772
+ continue
773
+ if in_dev_list and re.match(r"^\s*\]\s*$", line):
774
+ dev_end_idx = idx
775
+ break
776
+
777
+ if dev_start_idx is None or dev_end_idx is None:
738
778
  print(
739
779
  f"Warning: Could not find [dependency-groups] dev section in {manifest_file}"
740
780
  )
741
781
  continue
742
782
 
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
- )
783
+ # Insert new dependency before the closing ]
784
+ new_dep = f' "{package}",'
785
+ lines.insert(dev_end_idx, new_dep)
786
+ new_content = "\n".join(lines)
753
787
  else:
754
788
  # Add to [project] dependencies section
755
- deps_match = re.search(
756
- r"(dependencies\s*=\s*\[)(.*?)(\])", content, re.DOTALL
757
- )
758
- if not deps_match:
789
+ # Use line-by-line parsing to handle [] in dependency names like dayhoff-tools[full]
790
+ lines = content.split("\n")
791
+ in_deps = False
792
+ deps_start_idx = None
793
+ deps_end_idx = None
794
+
795
+ for idx, line in enumerate(lines):
796
+ if re.match(r"\s*dependencies\s*=\s*\[", line):
797
+ in_deps = True
798
+ deps_start_idx = idx
799
+ continue
800
+ if in_deps and re.match(r"^\s*\]\s*$", line):
801
+ deps_end_idx = idx
802
+ break
803
+
804
+ if deps_start_idx is None or deps_end_idx is None:
759
805
  print(
760
806
  f"Warning: Could not find dependencies section in {manifest_file}"
761
807
  )
762
808
  continue
763
809
 
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
- )
810
+ # Insert new dependency before the closing ]
811
+ new_dep = f' "{package}",'
812
+ lines.insert(deps_end_idx, new_dep)
813
+ new_content = "\n".join(lines)
773
814
 
774
815
  manifest_file.write_text(new_content)
775
816
  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.4"
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