Skip to content
Snippets Groups Projects
Commit 617cfa82 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

auto-case: better build and cache `list_mercurial_hashes` output

parent 3efd226a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
from pathlib import Path
import functools
import itertools
import os
import random
......@@ -72,6 +73,7 @@
return variants
@functools.lru_cache(maxsize=100)
def list_mercurial_hashes(base_dir, interval="all()"):
"""return a list of possible mercurial hashes"""
repo_dir = mercurial_repository_path(base_dir)
......@@ -86,7 +88,7 @@
interval,
]
p = subprocess.run(cmd, stdout=subprocess.PIPE, encoding="utf8")
return p.stdout.splitlines()
return set(p.stdout.splitlines())
def list_data_envs(base_dir):
......@@ -188,7 +190,7 @@
mercurial_intervals = PY_VERSION_COMPATIBILITY.get(python_version, "all()")
hashes = list_mercurial_hashes(base_dir, mercurial_intervals)
hashes = list(list_mercurial_hashes(base_dir, mercurial_intervals))
datas = list_data_envs(base_dir)
datas = [(data_env_lib.get_data_env(data_dir / d), d) for d in datas]
benchmarks = list_benchmarks(base_dir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment