mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE][Easy][2/19] enforce style for empty lines in import segments in .ci/
and .github/
(#129753)
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501. Most changes are auto-generated by linter. You can review these PRs via: ```bash git diff --ignore-all-space --ignore-blank-lines HEAD~1 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/129753 Approved by: https://github.com/malfet ghstack dependencies: #129752
This commit is contained in:
committed by
PyTorch MergeBot
parent
096dc444ce
commit
747b38c131
@ -6,6 +6,7 @@ from cryptography.hazmat.primitives import hashes, serialization
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||
from cryptography.x509.oid import NameOID
|
||||
|
||||
|
||||
temp_dir = mkdtemp()
|
||||
print(temp_dir)
|
||||
|
||||
|
@ -3,6 +3,7 @@ import json
|
||||
import math
|
||||
import sys
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"--test-name", dest="test_name", action="store", required=True, help="test name"
|
||||
|
@ -3,6 +3,7 @@ import sys
|
||||
|
||||
import numpy
|
||||
|
||||
|
||||
sample_data_list = sys.argv[1:]
|
||||
sample_data_list = [float(v.strip()) for v in sample_data_list]
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
data_file_path = sys.argv[1]
|
||||
commit_hash = sys.argv[2]
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import sys
|
||||
|
||||
|
||||
log_file_path = sys.argv[1]
|
||||
|
||||
with open(log_file_path) as f:
|
||||
|
@ -4,6 +4,7 @@ import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
COMMON_TESTS = [
|
||||
(
|
||||
"Checking that torch is available",
|
||||
|
2
.github/scripts/build_triton_wheel.py
vendored
2
.github/scripts/build_triton_wheel.py
vendored
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
@ -7,6 +8,7 @@ from subprocess import check_call
|
||||
from tempfile import TemporaryDirectory
|
||||
from typing import Optional
|
||||
|
||||
|
||||
SCRIPT_DIR = Path(__file__).parent
|
||||
REPO_DIR = SCRIPT_DIR.parent.parent
|
||||
|
||||
|
1
.github/scripts/check_labels.py
vendored
1
.github/scripts/check_labels.py
vendored
@ -5,7 +5,6 @@ import sys
|
||||
from typing import Any
|
||||
|
||||
from github_utils import gh_delete_comment, gh_post_pr_comment
|
||||
|
||||
from gitutils import get_git_remote_name, get_git_repo_dir, GitRepo
|
||||
from label_utils import has_required_labels, is_label_err_comment, LABEL_ERR_MSG
|
||||
from trymerge import GitHubPR
|
||||
|
2
.github/scripts/cherry_pick.py
vendored
2
.github/scripts/cherry_pick.py
vendored
@ -4,11 +4,9 @@ import json
|
||||
import os
|
||||
import re
|
||||
from typing import Any, cast, Dict, List, Optional
|
||||
|
||||
from urllib.error import HTTPError
|
||||
|
||||
from github_utils import gh_fetch_url, gh_post_pr_comment, gh_query_issues_by_labels
|
||||
|
||||
from gitutils import get_git_remote_name, get_git_repo_dir, GitRepo
|
||||
from trymerge import get_pr_commit_sha, GitHubPR
|
||||
|
||||
|
@ -10,6 +10,7 @@ import requests
|
||||
import rockset # type: ignore[import]
|
||||
from gitutils import retries_decorator
|
||||
|
||||
|
||||
LOGS_QUERY = """
|
||||
with
|
||||
shas as (
|
||||
|
2
.github/scripts/collect_ciflow_labels.py
vendored
2
.github/scripts/collect_ciflow_labels.py
vendored
@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, cast, Dict, List, Set
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
GITHUB_DIR = Path(__file__).parent.parent
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple, Optional
|
||||
|
1
.github/scripts/delete_old_branches.py
vendored
1
.github/scripts/delete_old_branches.py
vendored
@ -9,6 +9,7 @@ from typing import Any, Callable, Dict, List, Set
|
||||
from github_utils import gh_fetch_json_dict, gh_graphql
|
||||
from gitutils import GitRepo
|
||||
|
||||
|
||||
SEC_IN_DAY = 24 * 60 * 60
|
||||
CLOSED_PR_RETENTION = 30 * SEC_IN_DAY
|
||||
NO_PR_RETENTION = 1.5 * 365 * SEC_IN_DAY
|
||||
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
1
.github/scripts/export_pytorch_labels.py
vendored
1
.github/scripts/export_pytorch_labels.py
vendored
@ -14,7 +14,6 @@ import json
|
||||
from typing import Any
|
||||
|
||||
import boto3 # type: ignore[import]
|
||||
|
||||
from label_utils import gh_get_labels
|
||||
|
||||
|
||||
|
1
.github/scripts/filter_test_configs.py
vendored
1
.github/scripts/filter_test_configs.py
vendored
@ -15,6 +15,7 @@ from urllib.request import Request, urlopen
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
REENABLE_TEST_REGEX = "(?i)(Close(d|s)?|Resolve(d|s)?|Fix(ed|es)?) (#|https://github.com/pytorch/pytorch/issues/)([0-9]+)"
|
||||
|
||||
PREFIX = "test-config/"
|
||||
|
@ -14,6 +14,7 @@ architectures:
|
||||
import os
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
|
||||
CUDA_ARCHES = ["11.8", "12.1", "12.4"]
|
||||
|
||||
|
||||
|
2
.github/scripts/generate_ci_workflows.py
vendored
2
.github/scripts/generate_ci_workflows.py
vendored
@ -8,9 +8,9 @@ from typing import Dict, Iterable, List, Literal, Set
|
||||
from typing_extensions import TypedDict # Python 3.11+
|
||||
|
||||
import generate_binary_build_matrix # type: ignore[import]
|
||||
|
||||
import jinja2
|
||||
|
||||
|
||||
Arch = Literal["windows", "linux", "macos"]
|
||||
|
||||
GITHUB_DIR = Path(__file__).resolve().parent.parent
|
||||
|
@ -16,6 +16,7 @@ from typing import Dict, List
|
||||
|
||||
import generate_binary_build_matrix
|
||||
|
||||
|
||||
DOCKER_IMAGE_TYPES = ["runtime", "devel"]
|
||||
|
||||
|
||||
|
2
.github/scripts/generate_pytorch_version.py
vendored
2
.github/scripts/generate_pytorch_version.py
vendored
@ -4,11 +4,11 @@ import argparse
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from datetime import datetime
|
||||
from distutils.util import strtobool
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
LEADING_V_PATTERN = re.compile("^v")
|
||||
TRAILING_RC_PATTERN = re.compile("-rc[0-9]*$")
|
||||
LEGACY_BASE_VERSION_SUFFIX_PATTERN = re.compile("a0$")
|
||||
|
1
.github/scripts/get_workflow_job_id.py
vendored
1
.github/scripts/get_workflow_job_id.py
vendored
@ -11,7 +11,6 @@ import sys
|
||||
import time
|
||||
import urllib
|
||||
import urllib.parse
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
|
1
.github/scripts/github_utils.py
vendored
1
.github/scripts/github_utils.py
vendored
@ -3,7 +3,6 @@
|
||||
import json
|
||||
import os
|
||||
import warnings
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Union
|
||||
from urllib.error import HTTPError
|
||||
|
1
.github/scripts/gitutils.py
vendored
1
.github/scripts/gitutils.py
vendored
@ -19,6 +19,7 @@ from typing import (
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
RE_GITHUB_URL_MATCH = re.compile("^https://.*@?github.com/(.+)/(.+)$")
|
||||
|
2
.github/scripts/label_utils.py
vendored
2
.github/scripts/label_utils.py
vendored
@ -1,12 +1,12 @@
|
||||
"""GitHub Label Utilities."""
|
||||
|
||||
import json
|
||||
|
||||
from functools import lru_cache
|
||||
from typing import Any, List, Tuple, TYPE_CHECKING, Union
|
||||
|
||||
from github_utils import gh_fetch_url_and_headers, GitHubComment
|
||||
|
||||
|
||||
# TODO: this is a temp workaround to avoid circular dependencies,
|
||||
# and should be removed once GitHubPR is refactored out of trymerge script.
|
||||
if TYPE_CHECKING:
|
||||
|
1
.github/scripts/pytest_cache.py
vendored
1
.github/scripts/pytest_cache.py
vendored
@ -9,6 +9,7 @@ from pytest_caching_utils import (
|
||||
upload_pytest_cache,
|
||||
)
|
||||
|
||||
|
||||
TEMP_DIR = "./tmp" # a backup location in case one isn't provided
|
||||
|
||||
|
||||
|
1
.github/scripts/pytest_caching_utils.py
vendored
1
.github/scripts/pytest_caching_utils.py
vendored
@ -14,6 +14,7 @@ from file_io_utils import (
|
||||
zip_folder,
|
||||
)
|
||||
|
||||
|
||||
PYTEST_CACHE_KEY_PREFIX = "pytest_cache"
|
||||
PYTEST_CACHE_DIR_NAME = ".pytest_cache"
|
||||
BUCKET = "gha-artifacts"
|
||||
|
3
.github/scripts/test_trymerge.py
vendored
3
.github/scripts/test_trymerge.py
vendored
@ -17,9 +17,7 @@ from unittest import main, mock, skip, TestCase
|
||||
from urllib.error import HTTPError
|
||||
|
||||
from github_utils import gh_graphql
|
||||
|
||||
from gitutils import get_git_remote_name, get_git_repo_dir, GitRepo
|
||||
|
||||
from trymerge import (
|
||||
categorize_checks,
|
||||
DRCI_CHECKRUN_NAME,
|
||||
@ -39,6 +37,7 @@ from trymerge import (
|
||||
validate_revert,
|
||||
)
|
||||
|
||||
|
||||
if "GIT_REMOTE_URL" not in os.environ:
|
||||
os.environ["GIT_REMOTE_URL"] = "https://github.com/pytorch/pytorch"
|
||||
|
||||
|
2
.github/scripts/trymerge.py
vendored
2
.github/scripts/trymerge.py
vendored
@ -45,7 +45,6 @@ from github_utils import (
|
||||
gh_update_pr_state,
|
||||
GitHubComment,
|
||||
)
|
||||
|
||||
from gitutils import (
|
||||
are_ghstack_branches_in_sync,
|
||||
get_git_remote_name,
|
||||
@ -62,6 +61,7 @@ from label_utils import (
|
||||
)
|
||||
from trymerge_explainer import get_revert_message, TryMergeExplainer
|
||||
|
||||
|
||||
# labels
|
||||
MERGE_IN_PROGRESS_LABEL = "merging"
|
||||
MERGE_COMPLETE_LABEL = "merged"
|
||||
|
1
.github/scripts/tryrebase.py
vendored
1
.github/scripts/tryrebase.py
vendored
@ -11,6 +11,7 @@ from github_utils import gh_post_pr_comment as gh_post_comment
|
||||
from gitutils import get_git_remote_name, get_git_repo_dir, GitRepo
|
||||
from trymerge import GitHubPR
|
||||
|
||||
|
||||
SAME_SHA_ERROR = (
|
||||
"\n```\nAborting rebase because rebasing the branch resulted in the same sha as the target branch.\n"
|
||||
+ "This usually happens because the PR has already been merged. Please rebase locally and push.\n```"
|
||||
|
@ -30,9 +30,7 @@ ISORT_WHITELIST = re.compile(
|
||||
[
|
||||
# **
|
||||
# .ci/**
|
||||
".ci/**",
|
||||
# .github/**
|
||||
".github/**",
|
||||
# benchmarks/**
|
||||
"benchmarks/**",
|
||||
# functorch/**
|
||||
|
Reference in New Issue
Block a user