Skip to content

Commit 96604aa

Browse files
Merge pull request #27 from TemoaProject/develop
2 parents 0a0b6a7 + 09c00f2 commit 96604aa

3 files changed

Lines changed: 7 additions & 36 deletions

File tree

.github/scripts/publish_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def handle_publications(manifest_data: List[Dict[str, Any]]) -> bool:
159159
dataset["history"][i] = entry
160160
finalize_manifest(
161161
manifest_data,
162-
f"ci: Publish {dataset['fileName']} v{entry['version']}",
162+
f"ci: Publish {dataset['fileName']} {entry['version']}",
163163
)
164164
return True # Process only one publication per run
165165

src/datamanager/__main__.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from rich.console import Console
1111
from rich.table import Table
1212

13-
from typing import Callable, Optional, cast, Any
13+
from typing import Callable, Optional, Any
1414

1515
from datamanager.config import settings
1616
from datamanager import core, manifest
@@ -27,35 +27,6 @@
2727
)
2828

2929

30-
# Git helpers
31-
def _stage_all() -> None:
32-
"""Stage every working-tree change."""
33-
subprocess.run(["git", "add", "-A"], check=True)
34-
35-
36-
def _build_detached_commit(message: str) -> str:
37-
"""
38-
Create a commit object from the **current index** without
39-
moving HEAD. Returns the full commit SHA.
40-
"""
41-
tree = subprocess.check_output(["git", "write-tree"], text=True).strip()
42-
parent = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip()
43-
sha = subprocess.check_output(
44-
["git", "commit-tree", tree, "-p", parent, "-m", message],
45-
text=True,
46-
).strip()
47-
return sha
48-
49-
50-
# Prompt helpers
51-
def _ask_text(ctx: typer.Context, prompt: str, default: str) -> str:
52-
if ctx.obj.get("no_prompt"): # ← global flag
53-
console.print(f"[cyan]--yes[/] given – using default message: '{default}'")
54-
return default
55-
result: Optional[str] = questionary.text(prompt, default=default).ask()
56-
return cast(str, result)
57-
58-
5930
def _ask_confirm(ctx: typer.Context, prompt: str, default: bool = False) -> bool:
6031
if ctx.obj.get("no_prompt"):
6132
return True
@@ -321,7 +292,7 @@ def _run_prepare_logic(ctx: typer.Context, name: str, file: Path) -> None:
321292
manifest.add_history_entry(name, new_entry)
322293

323294
else:
324-
# --- This is for CREATE
295+
# --- This is for CREATE ---
325296
new_dataset_obj = {
326297
"fileName": name,
327298
"latestVersion": "v1",

src/datamanager/manifest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def add_history_entry(name: str, new_entry: dict[str, Any]) -> None:
9595
Adds a new version entry to the beginning of a dataset's history.
9696
9797
This function is used to add the temporary placeholder before the final
98-
commit hash is known.
98+
commit hash is known. It only works for existing datasets. For creating
99+
new datasets, use add_new_dataset() instead.
99100
100101
Args:
101102
name: The 'fileName' of the dataset to update.
@@ -111,9 +112,8 @@ def add_history_entry(name: str, new_entry: dict[str, Any]) -> None:
111112
break
112113

113114
if not dataset_found:
114-
# This would be for creating a brand new dataset entry
115-
# For now, we assume we only update existing ones.
116-
# A 'datamanager create' command could use this logic.
115+
# We only update existing datasets. For creating new datasets,
116+
# use add_new_dataset() instead.
117117
console.print(f"Dataset '{name}' not found. Cannot add history.")
118118
return
119119

0 commit comments

Comments
 (0)