mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Changes: 1. Always explicit `.absolute()`: `Path(__file__)` -> `Path(__file__).absolute()` 2. Replace `path.resolve()` with `path.absolute()` if the code is resolving the PyTorch repo root directory. Pull Request resolved: https://github.com/pytorch/pytorch/pull/129409 Approved by: https://github.com/albanD
16 lines
432 B
Python
16 lines
432 B
Python
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
|
|
REPO_ROOT = Path(__file__).absolute().parents[3]
|
|
|
|
|
|
def gen_ci_artifact(included: list[Any], excluded: list[Any]) -> None:
|
|
file_name = f"td_exclusions-{os.urandom(10).hex()}.json"
|
|
with open(REPO_ROOT / "test" / "test-reports" / file_name, "w") as f:
|
|
json.dump({"included": included, "excluded": excluded}, f)
|