[pytorch][require export] Create smartplatform configuration for trymerge (#75542)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75542

Reviewed By: malfet

Differential Revision: D35513051

fbshipit-source-id: adf59359fcf2410fa8a61746533c896ec22d5ed3
(cherry picked from commit ab65394c6f88f17bdc317dbcfb931cc16e527eef)
This commit is contained in:
Jon Janzen
2022-04-11 09:04:46 -07:00
committed by PyTorch MergeBot
parent 8a053e387e
commit 6cdc6dd8e5

View File

@ -1,10 +1,11 @@
#!/usr/bin/env python3
import os
import re
import tempfile
from collections import defaultdict
from datetime import datetime
from typing import cast, Any, Dict, Iterator, List, Optional, Tuple, Union
import os
import re
RE_GITHUB_URL_MATCH = re.compile("^https://.*@?github.com/(.+)/(.+)$")
@ -260,6 +261,12 @@ class GitRepo:
self._run_git("commit", "--amend", "-m", msg)
def clone_repo(username: str, password: str, org: str, project: str) -> GitRepo:
path = tempfile.mkdtemp()
_check_output(['git', 'clone', f'https://{username}:{password}@github.com/{org}/{project}', path]).strip()
return GitRepo(path=path)
class PeekableIterator(Iterator[str]):
def __init__(self, val: str) -> None:
self._val = val