dayhoff-tools 1.5.5__tar.gz → 1.5.7__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.

Potentially problematic release.


This version of dayhoff-tools might be problematic. Click here for more details.

Files changed (32) hide show
  1. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/PKG-INFO +1 -1
  2. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/cli/engine_commands.py +2 -2
  3. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/warehouse.py +49 -12
  4. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/pyproject.toml +1 -1
  5. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/README.md +0 -0
  6. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/__init__.py +0 -0
  7. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/chemistry/standardizer.py +0 -0
  8. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/chemistry/utils.py +0 -0
  9. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/cli/__init__.py +0 -0
  10. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/cli/cloud_commands.py +0 -0
  11. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/cli/main.py +0 -0
  12. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/cli/swarm_commands.py +0 -0
  13. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/cli/utility_commands.py +0 -0
  14. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/base.py +0 -0
  15. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/deploy_aws.py +0 -0
  16. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
  17. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/deploy_utils.py +0 -0
  18. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/job_runner.py +0 -0
  19. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/processors.py +0 -0
  20. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/deployment/swarm.py +0 -0
  21. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/embedders.py +0 -0
  22. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/fasta.py +0 -0
  23. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/file_ops.py +0 -0
  24. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/h5.py +0 -0
  25. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/intake/gcp.py +0 -0
  26. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/intake/gtdb.py +0 -0
  27. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/intake/kegg.py +0 -0
  28. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/intake/mmseqs.py +0 -0
  29. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/intake/structure.py +0 -0
  30. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/intake/uniprot.py +0 -0
  31. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/logs.py +0 -0
  32. {dayhoff_tools-1.5.5 → dayhoff_tools-1.5.7}/dayhoff_tools/sqlite.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.5.5
3
+ Version: 1.5.7
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
@@ -415,7 +415,7 @@ def update_ssh_config_entry(engine_name: str, instance_id: str, ssh_user: str, i
415
415
  Host {engine_name} {SSH_MANAGED_COMMENT}
416
416
  HostName {instance_id}
417
417
  User {ssh_user}
418
- ProxyCommand sh -c \"AWS_SSM_IDLE_TIMEOUT={idle_timeout} aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p,idleTimeout={idle_timeout}'\"\n"""
418
+ ProxyCommand sh -c \"AWS_SSM_IDLE_TIMEOUT={idle_timeout} aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'\"\n"""
419
419
 
420
420
  # Check if entry already exists
421
421
  host_line = f"Host {engine_name} {SSH_MANAGED_COMMENT}"
@@ -1029,7 +1029,7 @@ def config_ssh(
1029
1029
  f"Host {engine['name']} {SSH_MANAGED_COMMENT}",
1030
1030
  f" HostName {engine['instance_id']}",
1031
1031
  f" User {ssh_user}",
1032
- f" ProxyCommand sh -c \"AWS_SSM_IDLE_TIMEOUT=600 aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p,idleTimeout=600'\"",
1032
+ f" ProxyCommand sh -c \"AWS_SSM_IDLE_TIMEOUT=600 aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'\"",
1033
1033
  ]
1034
1034
  )
1035
1035
 
@@ -9,6 +9,25 @@ from zoneinfo import ZoneInfo
9
9
  # Import cloud helper lazily inside functions to avoid heavy deps at module load
10
10
 
11
11
 
12
+ def _find_project_root() -> Path | None:
13
+ """
14
+ Find the project root by searching upwards from the current directory for
15
+ a `.git` directory or a `pyproject.toml` file.
16
+
17
+ Returns:
18
+ The path to the project root, or None if not found.
19
+ """
20
+ current_dir = Path.cwd().resolve()
21
+ while current_dir != current_dir.parent:
22
+ if (current_dir / ".git").is_dir() or (current_dir / "pyproject.toml").is_file():
23
+ return current_dir
24
+ current_dir = current_dir.parent
25
+ # Check the final directory in the hierarchy (e.g., '/')
26
+ if (current_dir / ".git").is_dir() or (current_dir / "pyproject.toml").is_file():
27
+ return current_dir
28
+ return None
29
+
30
+
12
31
  def _warn_if_gcp_default_sa(force_prompt: bool = False) -> None:
13
32
  """Warn the user when the active gcloud principal is the default VM service
14
33
  account. See detailed docstring later in file (duplicate for early
@@ -528,11 +547,17 @@ def import_from_warehouse_typer() -> None:
528
547
  import questionary
529
548
 
530
549
  # Ensure execution from root directory
531
- cwd = Path(os.getcwd())
532
- if cwd.parent.name != "workspaces" or str(cwd.parent.parent) != cwd.root:
533
- raise Exception(
534
- f"This command must be executed from the repo's root directory (/workspaces/reponame). Current directory: {cwd}"
550
+ project_root = _find_project_root()
551
+ cwd = Path.cwd()
552
+ if not project_root or project_root != cwd:
553
+ error_msg = (
554
+ "This command must be run from the project's root directory, which is"
555
+ " expected to contain a `.git` folder or a `pyproject.toml` file.\n"
556
+ f"Current directory: {cwd}"
535
557
  )
558
+ if project_root:
559
+ error_msg += f"\nDetected project root: {project_root}"
560
+ raise Exception(error_msg)
536
561
 
537
562
  # Use questionary for prompts instead of typer
538
563
  warehouse_path = questionary.text("Warehouse path:").ask()
@@ -574,11 +599,17 @@ def get_from_warehouse_typer() -> None:
574
599
  import questionary
575
600
 
576
601
  # Ensure execution from root directory
577
- cwd = Path(os.getcwd())
578
- if cwd.parent.name != "workspaces" or str(cwd.parent.parent) != cwd.root:
579
- raise Exception(
580
- f"This command must be executed from the repo's root directory (/workspaces/reponame). Current directory: {cwd}"
602
+ project_root = _find_project_root()
603
+ cwd = Path.cwd()
604
+ if not project_root or project_root != cwd:
605
+ error_msg = (
606
+ "This command must be run from the project's root directory, which is"
607
+ " expected to contain a `.git` folder or a `pyproject.toml` file.\n"
608
+ f"Current directory: {cwd}"
581
609
  )
610
+ if project_root:
611
+ error_msg += f"\nDetected project root: {project_root}"
612
+ raise Exception(error_msg)
582
613
 
583
614
  # Use questionary for prompts instead of typer
584
615
  warehouse_path = questionary.text("Warehouse path:").ask()
@@ -619,11 +650,17 @@ def add_to_warehouse_typer() -> None:
619
650
  import questionary
620
651
 
621
652
  # Ensure execution from root directory
622
- cwd = Path(os.getcwd())
623
- if cwd.parent.name != "workspaces" or str(cwd.parent.parent) != cwd.root:
624
- raise Exception(
625
- f"This command must be executed from the repo's root directory (/workspaces/reponame). Current directory: {cwd}"
653
+ project_root = _find_project_root()
654
+ cwd = Path.cwd()
655
+ if not project_root or project_root != cwd:
656
+ error_msg = (
657
+ "This command must be run from the project's root directory, which is"
658
+ " expected to contain a `.git` folder or a `pyproject.toml` file.\n"
659
+ f"Current directory: {cwd}"
626
660
  )
661
+ if project_root:
662
+ error_msg += f"\nDetected project root: {project_root}"
663
+ raise Exception(error_msg)
627
664
 
628
665
  # Prompt for the data file path
629
666
  warehouse_path = questionary.text("Data file to be registered:").ask()
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
5
 
6
6
  [project]
7
7
  name = "dayhoff-tools"
8
- version = "1.5.5"
8
+ version = "1.5.7"
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