Skip to content

Commit d09e06a

Browse files
committed
Fix packaging scripts
1 parent 4154090 commit d09e06a

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

meta.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ documentation = "https://docs.singlestore.com"
1010

1111
[samples]
1212
display = [
13-
"Getting Started with Notebooks",
14-
"Notebook Basics",
15-
"Image Matching with SQL",
16-
"Movie Recommendation",
17-
"Semantic Search with OpenAI QA",
18-
"Semantic Search with OpenAI Embedding Creation",
19-
"Atlas & Kai for Mongo Side-by-Side",
13+
"getting-started-with-notebooks",
14+
"notebook-basics",
15+
"image-matching-with-sql",
16+
"movie-recommendation",
17+
"semantic-search-with-openai-qa",
18+
"semantic-search-with-openai-embedding-creation",
19+
"atlas-and-kai-for-mongo",
2020
]
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[meta]
2+
title="Semantic Search with OpenAI Embedding Creation"
23
description=""
3-
tags=[]
4+
tags=["openai"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[meta]
22
title="Semantic Search with OpenAI QA"
33
description=""
4-
tags=[]
4+
tags=["openai"]

resources/package-samples.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,41 @@
3535
meta = tomllib.load(f)
3636
files = []
3737
for i, name in enumerate(meta['samples']['display']):
38+
39+
# Verify the notebook file exists
3840
path = os.path.join(
3941
args.notebooks_directory,
40-
name, name + '.ipynb',
42+
name, 'notebook.ipynb',
4143
)
4244
if not os.path.isfile(path):
4345
print(
44-
f'error: `.ipynb` file does not exist at {path}',
46+
f'error: notebook file does not exist at {path}',
4547
file=sys.stderr,
4648
)
4749
sys.exit(1)
48-
files.append((path, f'{i + 1:02} - {os.path.basename(path)}.json'))
50+
51+
# Verify the metadata file exists
52+
meta_path = os.path.join(
53+
args.notebooks_directory,
54+
name, 'meta.toml',
55+
)
56+
if not os.path.isfile(meta_path):
57+
print(
58+
f'error: metadata file does not exist at {meta_path}',
59+
file=sys.stderr,
60+
)
61+
sys.exit(1)
62+
63+
with open(meta_path, 'rb') as meta_toml:
64+
nb_meta = tomllib.load(meta_toml)
65+
66+
try:
67+
files.append(
68+
(path, f'{i + 1:02} - {nb_meta["meta"]["title"]}.json'),
69+
)
70+
except Exception:
71+
print(path, ' =>\n ', nb_meta)
72+
raise
4973

5074
with ZipFile(args.outfile, 'w') as out:
5175
for path, name in files:

0 commit comments

Comments
 (0)