Skip to content

Commit 24efb7f

Browse files
committed
Harmonise the cache directory
1 parent cd7cdf8 commit 24efb7f

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
cp templates/index.html site_files
4141
4242
- name: Build the Kafka site
43-
run: python ipper/main.py kafka output standalone dev/kip_mentions.csv site_files/kafka.html
43+
run: python ipper/main.py kafka output standalone cache/mailbox_files/kip_mentions.csv site_files/kafka.html
4444

4545
- name: Build the Flink site
4646
run: python ipper/main.py flink output cache/flip_wiki_cache.json site_files/flink.html site_files/flips

ipper/kafka/mailing_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"from",
3131
"vote",
3232
]
33-
CACHE_DIR = "cache"
33+
CACHE_DIR = "kafka_processed_mailbox_cache"
3434
CACHE_SUFFIX = ".cache.csv"
3535

3636

ipper/kafka/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,10 @@ def run_init_cmd(args: Namespace) -> None:
261261
setup_wiki_download(args)
262262
print("Downloading Developer Mailing List Archives")
263263
args.mailing_list = "dev"
264+
args.output_dir = "cache/mailbox_files"
264265
setup_mail_download(args)
265266
args.overwrite_cache = True
266-
args.directory = "dev"
267+
args.directory = "cache/mailbox_files"
267268
process_mail_archives(args)
268269

269270

@@ -280,11 +281,11 @@ def run_update_cmd(args: Namespace) -> None:
280281
args.mailing_list = "dev"
281282
updated_files: List[Path] = setup_mail_download(args)
282283
# Reprocess just the newly downloaded mail file
283-
cache_dir: Path = Path("dev").joinpath(CACHE_DIR)
284+
cache_dir: Path = Path("cache").joinpath(CACHE_DIR)
284285
process_mbox_files(updated_files, cache_dir, overwrite_cache=True)
285286
# Overwrite the kip mentions cache by process all the old mbox cache files
286287
# and the newly overwritten one(s)
287-
args.directory = "dev"
288+
args.directory = "cache"
288289
args.overwrite_cache = False
289290
process_mail_archives(args)
290291

ipper/kafka/wiki.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def get_kip_information(
151151
chunk: int = 100,
152152
update: bool = False,
153153
overwrite_cache: bool = False,
154-
cache_filepath: str = "kip_wiki_cache.json",
154+
cache_filepath: str = "cache/kip_wiki_cache.json",
155155
timeout: int = 30,
156156
) -> dict[int, dict[str, Union[int, str]]]:
157157
"""Gets the details of all child pages of the KIP main page that relate
@@ -170,6 +170,7 @@ def get_kip_information(
170170
if not update:
171171
return output
172172
else:
173+
cache_file_path.parent.mkdir(parents=True, exist_ok=True)
173174
output = {}
174175

175176
if cache_file_path.exists() and update:

ipper/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setup_top_level_parser() -> ArgumentParser:
1313
description="Ipper - The Improvement Proposal Enrichment program",
1414
)
1515
top_level_parser.set_defaults(func=lambda _: print(top_level_parser.format_help()))
16-
16+
1717
top_level_subparsers = top_level_parser.add_subparsers()
1818

1919
setup_kafka_parser(top_level_subparsers)

0 commit comments

Comments
 (0)