fm-weck 1.5.0__py3-none-any.whl → 1.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fm_weck/__init__.py CHANGED
@@ -8,4 +8,4 @@
8
8
  from .config import Config # noqa: F401
9
9
  from .image_mgr import ImageMgr # noqa: F401
10
10
 
11
- __version__ = "1.5.0"
11
+ __version__ = "1.5.1"
fm_weck/cli.py CHANGED
@@ -419,8 +419,8 @@ def parse(raw_args: list[str]) -> Tuple[Callable[[], None], Namespace]:
419
419
  "TOOL",
420
420
  help="The tool for which to run the smoke test.",
421
421
  type=ToolQualifier,
422
- nargs=1,
423
- ).completer = ShellCompletion.versions_completer
422
+ ).completer = ShellCompletion.versions_completer # type: ignore[assignment]
423
+
424
424
  smoke_test.add_argument(
425
425
  "--gitlab-ci-mode",
426
426
  action="store_true",
@@ -428,6 +428,15 @@ def parse(raw_args: list[str]) -> Tuple[Callable[[], None], Namespace]:
428
428
  required=False,
429
429
  default=False,
430
430
  )
431
+ smoke_test.add_argument(
432
+ "--competition-year",
433
+ action="store",
434
+ type=int,
435
+ help="Automatically select the tool version used in the specified competition year (e.g., 2025). "
436
+ "Searches for SV-COMP or Test-Comp participation in that year.",
437
+ required=False,
438
+ default=None,
439
+ )
431
440
  smoke_test.set_defaults(main=main_smoke_test)
432
441
 
433
442
  with contextlib.suppress(ImportError):
@@ -483,6 +492,41 @@ def resolve_property_for_server(prop_name: str) -> Union[Path, str]:
483
492
  return prop_name
484
493
 
485
494
 
495
+ def get_version_for_competition_year(tool_path: Path, year: int) -> Optional[str]:
496
+ """
497
+ Find the tool version used in a competition for the given year.
498
+ Searches for SV-COMP or Test-Comp participation entries.
499
+
500
+ Args:
501
+ tool_path: Path to the tool's YAML file
502
+ year: Competition year (e.g., 2025)
503
+
504
+ Returns:
505
+ Version string if found, None otherwise
506
+ """
507
+ import yaml
508
+
509
+ if not tool_path.exists() or not tool_path.is_file():
510
+ return None
511
+
512
+ with tool_path.open("r") as f:
513
+ data = yaml.safe_load(f)
514
+
515
+ competition_participations = data.get("competition_participations", [])
516
+
517
+ # Search for competition entries matching the year
518
+ for participation in competition_participations:
519
+ competition = participation.get("competition", "")
520
+ # Match "SV-COMP 2025", "Test-Comp 2025", etc.
521
+ if f"{year}" in competition and ("SV-COMP" in competition or "Test-Comp" in competition):
522
+ version = participation.get("tool_version")
523
+ if version:
524
+ logger.info("Found version '%s' for %s in %s", version, tool_path.stem, competition)
525
+ return version
526
+
527
+ return None
528
+
529
+
486
530
  def set_log_options(loglevel: Optional[str], logfile: Optional[str], config: dict[str, Any]):
487
531
  level = "WARNING"
488
532
  level = loglevel.upper() if loglevel else config.get("logging", {}).get("level", level)
@@ -686,14 +730,32 @@ def main_smoke_test(args: argparse.Namespace):
686
730
  from .smoke_test_mode import run_smoke_test, run_smoke_test_gitlab_ci
687
731
 
688
732
  try:
689
- tool = resolve_tool(args.TOOL[0])
733
+ tool = resolve_tool(args.TOOL)
690
734
  except KeyError:
691
- logger.error("Unknown tool: %s", args.TOOL[0].tool)
735
+ logger.error("Unknown tool: %s", args.TOOL.tool)
692
736
  return 1
693
737
 
738
+ # Handle --competition-year flag
739
+ version = args.TOOL.version
740
+ if args.competition_year:
741
+ if version:
742
+ logger.warning(
743
+ "Both explicit version '%s' and --competition-year %d specified. "
744
+ "Using competition year to determine version.",
745
+ version,
746
+ args.competition_year,
747
+ )
748
+ competition_version = get_version_for_competition_year(tool, args.competition_year)
749
+ if competition_version:
750
+ logger.info("Using version '%s' for competition year %d", competition_version, args.competition_year)
751
+ version = competition_version
752
+ else:
753
+ logger.error("No competition participation found for year %d in tool %s", args.competition_year, tool.stem)
754
+ return 1
755
+
694
756
  fm_data, shelve_space = setup_fm_tool(
695
757
  fm_tool=tool,
696
- version=args.TOOL[0].version,
758
+ version=version,
697
759
  configuration=Config(),
698
760
  )
699
761
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fm-weck
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Author-email: Henrik Wachowitz <henrik.wachowitz@ifi.lmu.de>
5
5
  Maintainer-email: Henrik Wachowitz <henrik.wachowitz@ifi.lmu.de>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -1,8 +1,8 @@
1
- fm_weck/__init__.py,sha256=v0ltYQ0MeG-hs4LVU6TIPeboGSEmIMSDHqOGvQdQR_s,351
1
+ fm_weck/__init__.py,sha256=pcp30MR-tRkciy0U5U7dBSMuP9rJ3Vwv4O5spbrdbmA,351
2
2
  fm_weck/__main__.py,sha256=IfNDAqM6MK6P7KsQoW3wOHPOscB8evdVlS9C7R4wd_0,391
3
3
  fm_weck/cache_mgr.py,sha256=3-OQFmCeswazXmX08ND4oEHFOR07ZDCwWzjmFTDkOSE,1373
4
4
  fm_weck/capture.py,sha256=iogn3JvCZEjD0SQL8Xa3TzmZAWifd9ZIP81c3JIsdUQ,982
5
- fm_weck/cli.py,sha256=dPpJqyF0iXqZuRiPATypDbc6TyaUWzUFpb1qc2uo-mg,23657
5
+ fm_weck/cli.py,sha256=9Foecc_r5-sZIzBgo0d0kOmZhP0dMGfTwCRh6j0rLAE,25977
6
6
  fm_weck/config.py,sha256=8XXlHbb9cW1N1jatNFY5AnaRdxsSz-ohCrqq5t90RAc,8099
7
7
  fm_weck/engine.py,sha256=HfRj5Okewteco7A-CccCIbk2aEGDh4K896YyQo7h1gE,21733
8
8
  fm_weck/exceptions.py,sha256=AfqTt6gxZPUQ0rKqwgdGTyfIjWmU3xBFIJxQnMLbLGo,2465
@@ -165,7 +165,7 @@ fm_weck/resources/fm_tools/wit4java.yml,sha256=ylfze2XbV4zKkVUH57Veqn7G49gW0Byxd
165
165
  fm_weck/resources/fm_tools/witch.yml,sha256=wwe6lrI2sxGKVZbLeipa38rPhB2pcSUFi9uVngtXGUQ,1795
166
166
  fm_weck/resources/fm_tools/witnesslint.yml,sha256=EvMBcm5fx6lgSLRmHSKXSxXIJKZ-BrxLwTXI4GQ6FMs,6812
167
167
  fm_weck/resources/fm_tools/witnessmap.yml,sha256=FyZtEloxpWBBjLn9kyqoen2kPjOkH2r4fxAj5gfV8Bg,1692
168
- fm_weck-1.5.0.dist-info/METADATA,sha256=UqR47gDzSfO-MS7U0lEmpMoYJ5Xe6Vx_4cxMXg7qq-0,3339
169
- fm_weck-1.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
170
- fm_weck-1.5.0.dist-info/entry_points.txt,sha256=toWpKCSY1u593MPnI_xW5gnwlnkerP4AvmPQ1s2nPgY,50
171
- fm_weck-1.5.0.dist-info/RECORD,,
168
+ fm_weck-1.5.1.dist-info/METADATA,sha256=jYdZSrXwB_PzT8dVahhwa76YCuFXSPUe5MfB0bHrAYI,3339
169
+ fm_weck-1.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
170
+ fm_weck-1.5.1.dist-info/entry_points.txt,sha256=toWpKCSY1u593MPnI_xW5gnwlnkerP4AvmPQ1s2nPgY,50
171
+ fm_weck-1.5.1.dist-info/RECORD,,