Encode the gz file as a flat artifact-filename stem. With ``repo_root`` set, returns the repo-relative path with ``/`` replaced by ``__`` and ``.gz`` stripped — so same-basename pages from different paths can't collide. Without it, falls back to the bare basename.
(self, gz_path: str)
| 530 | ] |
| 531 | |
| 532 | def _artifact_stem(self, gz_path: str) -> str: |
| 533 | """Encode the gz file as a flat artifact-filename stem. |
| 534 | |
| 535 | With ``repo_root`` set, returns the repo-relative path with ``/`` |
| 536 | replaced by ``__`` and ``.gz`` stripped — so same-basename pages |
| 537 | from different paths can't collide. Without it, falls back to the |
| 538 | bare basename. |
| 539 | """ |
| 540 | if self._repo_root: |
| 541 | try: |
| 542 | rel = os.path.relpath(gz_path, self._repo_root) |
| 543 | except ValueError: |
| 544 | rel = os.path.basename(gz_path) |
| 545 | if rel.endswith(".gz"): |
| 546 | rel = rel[:-3] |
| 547 | return rel.replace(os.sep, "__") |
| 548 | return os.path.splitext(os.path.splitext(os.path.basename(gz_path))[0])[0] |
| 549 | |
| 550 | def _artifact_path(self, kind: str, stem: str, suffix: str) -> str: |
| 551 | """Return ``<run_dir>/<kind>/<stem><suffix>``, creating the subdir.""" |
no outgoing calls
no test coverage detected