From c940b2ee0cbcc3ec2b3cafa9e4aa06a710358519 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Fri, 7 Oct 2022 09:15:20 +0100 Subject: [PATCH] Fix Gitlab support for bin/run_example_ci_config.py --- bin/run_example_ci_configs.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py index 90fdd3cb..fa7b1694 100755 --- a/bin/run_example_ci_configs.py +++ b/bin/run_example_ci_configs.py @@ -64,7 +64,7 @@ services = [ CIService( name="gitlab", dst_config_path=".gitlab-ci.yml", - badge_md="[![Gitlab](https://gitlab.com/pypa/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/pypa/cibuildwheel/-/commits/{branch})", + badge_md="[![Gitlab](https://gitlab.com/joerick/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/joerick/cibuildwheel/-/commits/{branch})", ), CIService( name="cirrus-ci", @@ -75,14 +75,13 @@ services = [ def ci_service_for_config_file(config_file): - service_name = Path(config_file).name.rsplit("-", 1)[0] + filename = Path(config_file).name - for service in services: - if service.name == service_name: - return service - - msg = f"unknown ci service for config file {config_file}" - raise ValueError(msg) + try: + return next(s for s in services if filename.startswith(s.name)) + except StopIteration: + msg = f"unknown ci service for config file {config_file}" + raise ValueError(msg) from None @click.command()