dayhoff-tools 1.2.2__py3-none-any.whl → 1.2.3__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 +94 -13
- dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.2.2.dist-info → dayhoff_tools-1.2.3.dist-info}/METADATA +1 -1
- {dayhoff_tools-1.2.2.dist-info → dayhoff_tools-1.2.3.dist-info}/RECORD +5 -5
- {dayhoff_tools-1.2.2.dist-info → dayhoff_tools-1.2.3.dist-info}/WHEEL +0 -0
- {dayhoff_tools-1.2.2.dist-info → dayhoff_tools-1.2.3.dist-info}/entry_points.txt +0 -0
@@ -126,12 +126,32 @@ def import_from_warehouse_typer() -> None:
|
|
126
126
|
import questionary
|
127
127
|
from dayhoff_tools.warehouse import import_from_warehouse
|
128
128
|
|
129
|
-
#
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
129
|
+
# Check if we're in Lightning Studio
|
130
|
+
if _is_lightning_studio():
|
131
|
+
# Lightning Studio behavior
|
132
|
+
_check_dvc_initialized()
|
133
|
+
_configure_studio_cache()
|
134
|
+
|
135
|
+
# Ensure we're running from repo root using REPO_ROOT env var
|
136
|
+
repo_root = os.environ.get("REPO_ROOT")
|
137
|
+
if not repo_root:
|
138
|
+
raise Exception(
|
139
|
+
"REPO_ROOT environment variable not set. Make sure you're in a repo with an active UV virtual environment."
|
140
|
+
)
|
141
|
+
|
142
|
+
current_dir = os.getcwd()
|
143
|
+
if current_dir != repo_root:
|
144
|
+
raise Exception(
|
145
|
+
f"This command must be run from the repo root. "
|
146
|
+
f"Current directory: {current_dir}, Expected: {repo_root}"
|
147
|
+
)
|
148
|
+
else:
|
149
|
+
# Original devcontainer behavior - ensure execution from root
|
150
|
+
cwd = Path(os.getcwd())
|
151
|
+
if cwd.parent.name != "workspaces" or str(cwd.parent.parent) != cwd.root:
|
152
|
+
raise Exception(
|
153
|
+
f"This command must be executed from the repo's root directory (/workspaces/reponame). Current directory: {cwd}"
|
154
|
+
)
|
135
155
|
|
136
156
|
# Use questionary for prompts instead of typer
|
137
157
|
warehouse_path = questionary.text("Warehouse path:").ask()
|
@@ -172,12 +192,32 @@ def add_to_warehouse_typer() -> None:
|
|
172
192
|
import questionary
|
173
193
|
from dayhoff_tools.warehouse import add_to_warehouse
|
174
194
|
|
175
|
-
#
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
195
|
+
# Check if we're in Lightning Studio
|
196
|
+
if _is_lightning_studio():
|
197
|
+
# Lightning Studio behavior
|
198
|
+
_check_dvc_initialized()
|
199
|
+
_configure_studio_cache()
|
200
|
+
|
201
|
+
# Ensure we're running from repo root using REPO_ROOT env var
|
202
|
+
repo_root = os.environ.get("REPO_ROOT")
|
203
|
+
if not repo_root:
|
204
|
+
raise Exception(
|
205
|
+
"REPO_ROOT environment variable not set. Make sure you're in a repo with an active UV virtual environment."
|
206
|
+
)
|
207
|
+
|
208
|
+
current_dir = os.getcwd()
|
209
|
+
if current_dir != repo_root:
|
210
|
+
raise Exception(
|
211
|
+
f"This command must be run from the repo root. "
|
212
|
+
f"Current directory: {current_dir}, Expected: {repo_root}"
|
213
|
+
)
|
214
|
+
else:
|
215
|
+
# Original devcontainer behavior - ensure execution from root
|
216
|
+
cwd = Path(os.getcwd())
|
217
|
+
if cwd.parent.name != "workspaces" or str(cwd.parent.parent) != cwd.root:
|
218
|
+
raise Exception(
|
219
|
+
f"This command must be executed from the repo's root directory (/workspaces/reponame). Current directory: {cwd}"
|
220
|
+
)
|
181
221
|
|
182
222
|
# Prompt for the data file path
|
183
223
|
warehouse_path = questionary.text("Data file to be registered:").ask()
|
@@ -647,5 +687,46 @@ def update_dependencies(
|
|
647
687
|
|
648
688
|
|
649
689
|
# ----------------------
|
650
|
-
#
|
690
|
+
# Lightning Studio Commands
|
651
691
|
# ----------------------
|
692
|
+
|
693
|
+
|
694
|
+
def _is_lightning_studio() -> bool:
|
695
|
+
"""Check if we're running in Lightning Studio environment."""
|
696
|
+
return os.path.exists("/teamspace/studios/this_studio")
|
697
|
+
|
698
|
+
|
699
|
+
def _check_dvc_initialized() -> None:
|
700
|
+
"""Check if DVC is initialized in the current directory."""
|
701
|
+
if not os.path.exists(".dvc"):
|
702
|
+
raise Exception(
|
703
|
+
"DVC is not initialized in this repository. Run 'dvc init' first."
|
704
|
+
)
|
705
|
+
|
706
|
+
|
707
|
+
def _configure_studio_cache() -> None:
|
708
|
+
"""Configure DVC to use studio-level cache if not already configured."""
|
709
|
+
studio_cache_dir = "/teamspace/studios/this_studio/.dvc_cache"
|
710
|
+
|
711
|
+
# Create cache directory if it doesn't exist
|
712
|
+
os.makedirs(studio_cache_dir, exist_ok=True)
|
713
|
+
|
714
|
+
# Check current cache configuration
|
715
|
+
try:
|
716
|
+
result = subprocess.run(
|
717
|
+
["dvc", "cache", "dir"], capture_output=True, text=True, check=True
|
718
|
+
)
|
719
|
+
current_cache = result.stdout.strip()
|
720
|
+
|
721
|
+
if current_cache != studio_cache_dir:
|
722
|
+
print(
|
723
|
+
f"Configuring DVC cache to use studio-level directory: {studio_cache_dir}"
|
724
|
+
)
|
725
|
+
# Use --local flag to save in .dvc/config.local (git-ignored)
|
726
|
+
subprocess.run(
|
727
|
+
["dvc", "cache", "dir", studio_cache_dir, "--local"], check=True
|
728
|
+
)
|
729
|
+
print("✅ DVC cache configured for Lightning Studio (in .dvc/config.local)")
|
730
|
+
except subprocess.CalledProcessError:
|
731
|
+
# If cache dir command fails, try to set it anyway
|
732
|
+
subprocess.run(["dvc", "cache", "dir", studio_cache_dir, "--local"], check=True)
|
File without changes
|
@@ -5,7 +5,7 @@ dayhoff_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
5
5
|
dayhoff_tools/cli/cloud_commands.py,sha256=33qcWLmq-FwEXMdL3F0OHm-5Stlh2r65CldyEZgQ1no,40904
|
6
6
|
dayhoff_tools/cli/main.py,sha256=47EGb28ALaYFc7oAUGlY1D66AIDmc4RZiXxN-gPVrpQ,4519
|
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=qs8vH9TBFHsOPC3X8cU3qZigM3dDn-2Ytq4o_F2WubU,27874
|
9
9
|
dayhoff_tools/deployment/base.py,sha256=mYp560l6hSDFtyY2H42VoM8k9VUzfwuiyh9Knqpgc28,17441
|
10
10
|
dayhoff_tools/deployment/deploy_aws.py,sha256=GvZpE2YIFA5Dl9rkAljFjtUypmPDNbWgw8NicHYTP24,18265
|
11
11
|
dayhoff_tools/deployment/deploy_gcp.py,sha256=xgaOVsUDmP6wSEMYNkm1yRNcVskfdz80qJtCulkBIAM,8860
|
@@ -26,7 +26,7 @@ dayhoff_tools/intake/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJq
|
|
26
26
|
dayhoff_tools/logs.py,sha256=DKdeP0k0kliRcilwvX0mUB2eipO5BdWUeHwh-VnsICs,838
|
27
27
|
dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
|
28
28
|
dayhoff_tools/warehouse.py,sha256=TqV8nex1AluNaL4JuXH5zuu9P7qmE89lSo6f_oViy6U,14965
|
29
|
-
dayhoff_tools-1.2.
|
30
|
-
dayhoff_tools-1.2.
|
31
|
-
dayhoff_tools-1.2.
|
32
|
-
dayhoff_tools-1.2.
|
29
|
+
dayhoff_tools-1.2.3.dist-info/METADATA,sha256=xJbC0wrh9ZuguuDzKouBca3FwaPKFrfjA54n4LAFSiw,2842
|
30
|
+
dayhoff_tools-1.2.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
31
|
+
dayhoff_tools-1.2.3.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
|
32
|
+
dayhoff_tools-1.2.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|