Skip to content

Commit

Permalink
Merge pull request #534 from Erotemic/fix-ci-benchmark
Browse files Browse the repository at this point in the history
Benchmark CI fixes
  • Loading branch information
hugovk committed Apr 27, 2022
2 parents a900e46 + 4e527b8 commit ebdb150
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/benchmark.yml
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/benchmark.yml"
- "tests/benchmark.py"

jobs:
build:
Expand Down
11 changes: 6 additions & 5 deletions tests/benchmark.py
Expand Up @@ -447,30 +447,31 @@ def main():
"--disable",
nargs="+",
choices=known_libraries,
help=("Remove specified libraries from the benchmarks"),
help="Remove specified libraries from the benchmarks",
default=[],
)

parser.add_argument(
"--factor",
type=float,
default=1.0,
help=("Specify as a fraction speed up benchmarks for development / testing"),
help="Specify as a fraction speed up benchmarks for development / testing",
)

args = parser.parse_args()

disabled_libraires = set(args.disable)
disabled_libraries = set(args.disable)
enabled_libraries = {}
for libname in known_libraries:
if libname not in disabled_libraires:
if libname not in disabled_libraries:
try:
module = importlib.import_module(libname)
except ImportError:
raise ImportError(f"{libname} is not available")
else:
enabled_libraries[libname] = module

# Ensure the modules are avilable in a the global scope
# Ensure the modules are available in the global scope
for libname, module in enabled_libraries.items():
print(f"Enabled {libname} benchmarks")
globals()[libname] = module
Expand Down

0 comments on commit ebdb150

Please sign in to comment.