study-docker-repro-longevity/workflow/utils.smk

16 lines
585 B
Plaintext
Raw Normal View History

import csv
import os
def get_blacklisted_paths(blacklist_csv_path):
blacklisted = set()
with open(blacklist_csv_path, "r") as csv_file:
spamreader = csv.reader(csv_file, delimiter=",")
for row in spamreader:
blacklisted.add(row[0])
return blacklisted
def get_artifacts_to_build(artifacts_folder, blacklist_csv_path):
blacklisted = get_blacklisted_paths(blacklist_csv_path)
2024-07-11 15:17:16 +02:00
all_artifacts = set([a.split(".")[0] for a in os.listdir(artifacts_folder) if not os.path.isdir(os.path.join(artifacts_folder, a))])
return list(all_artifacts.difference(blacklisted))