Bug 1790816 - Reformat tools/ with isort. r=linter-reviewers,perftest-reviewers,sparky,sylvestre DONTBUILD

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162660
This commit is contained in:
Marco Castelluccio 2022-11-24 10:58:05 +00:00
Родитель 426e194439
Коммит de29bc2f0e
92 изменённых файлов: 194 добавлений и 270 удалений

Просмотреть файл

@ -43,12 +43,11 @@ import subprocess
import sys
import time
from six import StringIO
from mach.decorators import CommandArgument, Command
from mozbuild.base import MachCommandBase, BinaryNotFoundException
from mozbuild.util import mkdir
import mozpack.path as mozpath
from mach.decorators import Command, CommandArgument
from mozbuild.base import BinaryNotFoundException, MachCommandBase
from mozbuild.util import mkdir
from six import StringIO
AUTOMATION = "MOZ_AUTOMATION" in os.environ
BROWSERTIME_ROOT = os.path.dirname(__file__)
@ -83,9 +82,10 @@ def silence():
def node_path(command_context):
from mozbuild.nodeutil import find_node_executable
from distutils.version import StrictVersion
import platform
from distutils.version import StrictVersion
from mozbuild.nodeutil import find_node_executable
state_dir = command_context._mach_context.state_dir
cache_path = os.path.join(state_dir, "browsertime", "node-16")

Просмотреть файл

@ -4,20 +4,18 @@
from __future__ import absolute_import, print_function, unicode_literals
from appdirs import user_config_dir
from hglib.error import CommandError
from mach.decorators import (
CommandArgument,
Command,
)
from mach.base import FailedCommandError
from mozrelease.scriptworker_canary import get_secret
from pathlib import Path
from redo import retry
import argparse
import logging
import os
import tempfile
from pathlib import Path
from appdirs import user_config_dir
from hglib.error import CommandError
from mach.base import FailedCommandError
from mach.decorators import Command, CommandArgument
from mozrelease.scriptworker_canary import get_secret
from redo import retry
@Command(

Просмотреть файл

@ -28,13 +28,13 @@ import concurrent.futures
import logging
import os
import re
import requests
import shutil
import subprocess
import tempfile
import urlparse
from PackageSymbolDumper import process_packages, find_packages
import requests
import urlparse
from PackageSymbolDumper import find_packages, process_packages
OSX_RE = re.compile(r"10\.[0-9]+\.[0-9]+")

Просмотреть файл

@ -20,10 +20,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from __future__ import print_function, absolute_import
from __future__ import absolute_import, print_function
import os
import sys
from reposadolib import reposadocommon
reposadocommon.get_main_dir = lambda: "/usr/local/bin/"

Просмотреть файл

@ -2,18 +2,18 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import print_function, absolute_import
from __future__ import absolute_import, print_function
import argparse
import concurrent.futures
import datetime
import os
import requests
import subprocess
import sys
import urllib
import zipfile
import requests
if sys.platform == "darwin":
SYSTEM_DIRS = [

Просмотреть файл

@ -20,10 +20,10 @@ import csv
import json
import logging
import os
import requests
import sys
import urlparse
import requests
import urlparse
log = logging.getLogger()

Просмотреть файл

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, absolute_import
from __future__ import absolute_import, print_function
import json
import logging
@ -12,10 +12,7 @@ import re
import subprocess
import sys
from mach.decorators import (
Command,
CommandArgument,
)
from mach.decorators import Command, CommandArgument
def path_sep_to_native(path_str):

Просмотреть файл

@ -6,6 +6,7 @@
Add more features!
"""
from __future__ import absolute_import
import argparse
import sys

Просмотреть файл

@ -16,12 +16,13 @@ tools if you need. They will be located in `$MOZ_FETCHES_DIR` and follow the
same directory structure than the source tree.
"""
from __future__ import absolute_import
from distutils.spawn import find_executable
import os
import os.path
import subprocess
import shlex
import subprocess
import sys
from distutils.spawn import find_executable
def run_jsshell(command, label=None):

Просмотреть файл

@ -1,12 +1,11 @@
from subprocess import check_call
import os
import os.path
import sys
from subprocess import check_call
from moztest.selftest import fixtures
import mozunit
import pytest
from moztest.selftest import fixtures
MOZ_AUTOMATION = bool(os.getenv("MOZ_AUTOMATION", "0") == "1")

Просмотреть файл

@ -2,10 +2,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
import pytest
from contextlib import contextmanager
import pytest
import smoke
JS = os.path.join(os.path.dirname(__file__), "js.py")

Просмотреть файл

@ -9,8 +9,8 @@ import re
import subprocess
import sys
import pygit2
import hglib
import pygit2
DEBUG = False

Просмотреть файл

@ -54,9 +54,9 @@
from __future__ import absolute_import, print_function
import sys
import subprocess
import os.path
import subprocess
import sys
if len(sys.argv) < 5:
sys.stderr.write("Expected arguments: <jprof> <split-file> <program> <jprof-log>\n")

Просмотреть файл

@ -4,20 +4,19 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import glob
import itertools
import json
import glob
import os
import re
import six
import subprocess
import sys
import xml.etree.ElementTree as ET
from mozpack.files import FileFinder
import mozpack.path as mozpath
import six
from mozlint import result
from mozpack.files import FileFinder
# The Gradle target invocations are serialized with a simple locking file scheme. It's fine for
# them to take a while, since the first will compile all the Java, etc, and then perform

Просмотреть файл

@ -3,8 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import signal
import re
import signal
import sys
import xml.etree.ElementTree as ET

Просмотреть файл

@ -6,15 +6,14 @@ import json
import os
import re
import signal
import six
from packaging.version import Version
import six
from mozboot.util import get_tools_dir
from mozfile import which
from mozlint import result
from mozlint.pathutils import get_ancestors_by_name
from mozprocess import ProcessHandler
from packaging.version import Version
CLIPPY_WRONG_VERSION = """
Clippy is not installed or an older version was detected. Please make sure

Просмотреть файл

@ -14,9 +14,7 @@ import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "eslint"))
from eslint import setup_helper
from mozbuild.nodeutil import find_node_executable
from mozlint import result
ESLINT_ERROR_MESSAGE = """

Просмотреть файл

@ -10,17 +10,16 @@ import platform
import re
import subprocess
import sys
from packaging.version import Version
from filecmp import dircmp
from mozbuild.nodeutil import (
NODE_MIN_VERSION,
NPM_MIN_VERSION,
find_node_executable,
find_npm_executable,
NPM_MIN_VERSION,
NODE_MIN_VERSION,
)
from mozfile.mozfile import remove as mozfileremove
from packaging.version import Version
NODE_MACHING_VERSION_NOT_FOUND_MESSAGE = """
Could not find Node.js executable later than %s.

Просмотреть файл

@ -2,14 +2,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import bisect
import re
from html.parser import HTMLParser
import mozpack.path as mozpath
import yaml
from fluent.syntax import parse, visitor
from mozlint import result
from mozlint.pathutils import expand_exclusions
import mozpack.path as mozpath
import re
import yaml
from html.parser import HTMLParser
class TextElementHTMLParser(HTMLParser):

Просмотреть файл

@ -7,11 +7,12 @@ from __future__ import absolute_import, print_function
import os
import signal
import six
import subprocess
import sys
from distutils.spawn import find_executable
import six
here = os.path.dirname(os.path.realpath(__file__))
topsrcdir = os.path.join(here, os.pardir, os.pardir)

Просмотреть файл

@ -5,8 +5,8 @@
import os
import subprocess
from subprocess import check_output, CalledProcessError
import sys
from subprocess import CalledProcessError, check_output
here = os.path.dirname(os.path.realpath(__file__))
topsrcdir = os.path.join(here, os.pardir, os.pardir)
@ -21,7 +21,7 @@ EXTRA_PATHS = (
)
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
from mozversioncontrol import get_repository_object, InvalidRepoPath
from mozversioncontrol import InvalidRepoPath, get_repository_object
def run_clang_format(hooktype, changedFiles):

Просмотреть файл

@ -5,8 +5,8 @@
import os
import subprocess
from subprocess import check_output, CalledProcessError
import sys
from subprocess import CalledProcessError, check_output
here = os.path.dirname(os.path.realpath(__file__))
topsrcdir = os.path.join(here, os.pardir, os.pardir)
@ -20,7 +20,7 @@ EXTRA_PATHS = (
)
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
from mozversioncontrol import get_repository_object, InvalidRepoPath
from mozversioncontrol import InvalidRepoPath, get_repository_object
def run_js_format(hooktype, changedFiles):

Просмотреть файл

@ -4,9 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, division
from __future__ import absolute_import, division, print_function
import re
import sys
import yaml
from mozlint import result
from mozlint.pathutils import expand_exclusions

Просмотреть файл

@ -6,17 +6,9 @@ import argparse
import copy
import os
from mozbuild.base import (
BuildEnvironmentNotFoundException,
MachCommandConditions as conditions,
)
from mach.decorators import (
CommandArgument,
Command,
)
from mach.decorators import Command, CommandArgument
from mozbuild.base import BuildEnvironmentNotFoundException
from mozbuild.base import MachCommandConditions as conditions
here = os.path.abspath(os.path.dirname(__file__))
EXCLUSION_FILES = [

Просмотреть файл

@ -8,12 +8,12 @@ import os
import pathlib
import re
from gecko_taskgraph.util.attributes import match_run_on_projects
from manifestparser import TestManifest
from mozperftest.script import ScriptInfo
from perfdocs.utils import read_yaml
from perfdocs.logger import PerfDocLogger
from perfdocs.doc_helpers import TableBuilder
from gecko_taskgraph.util.attributes import match_run_on_projects
from perfdocs.logger import PerfDocLogger
from perfdocs.utils import read_yaml
logger = PerfDocLogger()

Просмотреть файл

@ -6,15 +6,15 @@ from __future__ import absolute_import
import os
import pathlib
from perfdocs.logger import PerfDocLogger
from perfdocs.utils import read_yaml
from perfdocs.framework_gatherers import (
AwsyGatherer,
MozperftestGatherer,
RaptorGatherer,
StaticGatherer,
TalosGatherer,
AwsyGatherer,
)
from perfdocs.logger import PerfDocLogger
from perfdocs.utils import read_yaml
logger = PerfDocLogger()

Просмотреть файл

@ -9,7 +9,7 @@ import shutil
import tempfile
from perfdocs.logger import PerfDocLogger
from perfdocs.utils import are_dirs_equal, ON_TRY, read_file, read_yaml, save_file
from perfdocs.utils import ON_TRY, are_dirs_equal, read_file, read_yaml, save_file
logger = PerfDocLogger()

Просмотреть файл

@ -7,6 +7,7 @@ import difflib
import filecmp
import os
import pathlib
import yaml
from perfdocs.logger import PerfDocLogger

Просмотреть файл

@ -3,14 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import jsonschema
import os
import pathlib
import re
import jsonschema
from perfdocs.gatherer import Gatherer
from perfdocs.logger import PerfDocLogger
from perfdocs.utils import read_file, read_yaml
from perfdocs.gatherer import Gatherer
logger = PerfDocLogger()

Просмотреть файл

@ -11,10 +11,10 @@ import signal
import subprocess
import sys
import mozpack.path as mozpath
from mozfile import which
from mozlint import result
from mozlint.pathutils import expand_exclusions
import mozpack.path as mozpath
from mozprocess import ProcessHandler
here = os.path.abspath(os.path.dirname(__file__))

Просмотреть файл

@ -10,7 +10,6 @@ import sys
import mozfile
import mozpack.path as mozpath
from mozlint import result
from mozlint.pathutils import expand_exclusions
@ -127,8 +126,8 @@ def lint(paths, config, **lintargs):
def run(paths, config, **lintargs):
from flake8.main.application import Application
from flake8 import __version__ as flake8_version
from flake8.main.application import Application
log = lintargs["log"]
root = lintargs["root"]

Просмотреть файл

@ -2,19 +2,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import datetime, timedelta
import os
from datetime import datetime, timedelta
from mach import util as mach_util
from mozlint import result, pathutils
from mozpack import path as mozpath
import mozversioncontrol.repoupdate
from compare_locales import parser
from compare_locales.lint.linter import L10nLinter
from compare_locales.lint.util import l10n_base_reference_and_tests
from compare_locales import parser
from compare_locales.paths import TOMLParser, ProjectFiles
from compare_locales.paths import ProjectFiles, TOMLParser
from mach import util as mach_util
from mozlint import pathutils, result
from mozpack import path as mozpath
LOCALE = "gecko-strings"

Просмотреть файл

@ -4,15 +4,13 @@
import json
import os
import signal
import subprocess
import signal
from mozprocess import ProcessHandler
from mach.site import InstallPipRequirementsException
from mozlint import result
from mozlint.pathutils import expand_exclusions
from mach.site import InstallPipRequirementsException
from mozprocess import ProcessHandler
here = os.path.abspath(os.path.dirname(__file__))
PYLINT_REQUIREMENTS_PATH = os.path.join(here, "pylint_requirements.txt")

Просмотреть файл

@ -6,9 +6,9 @@ import os
import re
import subprocess
from mozfile import which
from mozlint import result
from mozlint.pathutils import expand_exclusions
from mozfile import which
# Error Levels
# (0, 'debug')

Просмотреть файл

@ -3,19 +3,18 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import signal
import six
import re
import signal
import subprocess
from collections import namedtuple
from packaging.version import Version
import six
from mozboot.util import get_tools_dir
from mozfile import which
from mozlint import result
from mozlint.pathutils import expand_exclusions
from mozprocess import ProcessHandler
from packaging.version import Version
RUSTFMT_NOT_FOUND = """
Could not find rustfmt! Install rustfmt and try again.

Просмотреть файл

@ -2,16 +2,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import json
import os
from json.decoder import JSONDecodeError
import mozpack.path as mozpath
from mozfile import which
from mozpack.files import FileFinder
from mozlint import result
from mozlint.util.implementation import LintProcess
from mozpack.files import FileFinder
SHELLCHECK_NOT_FOUND = """
Unable to locate shellcheck, please ensure it is installed and in

Просмотреть файл

@ -13,7 +13,6 @@ except ImportError:
JSONDecodeError = ValueError
from mozfile import which
from mozlint import result
from mozlint.util.implementation import LintProcess

Просмотреть файл

@ -6,15 +6,14 @@ import pathlib
import sys
from collections import defaultdict
import pytest
from mozbuild.base import MozbuildObject
from mozlint.pathutils import findobject
from mozlint.parser import Parser
from mozlint.pathutils import findobject
from mozlint.result import ResultSummary
from mozlog.structuredlog import StructuredLogger
from mozpack import path
import pytest
here = path.abspath(path.dirname(__file__))
build = MozbuildObject.from_environment(cwd=here, virtualenv_name="python-test")
@ -256,10 +255,10 @@ def structured_logger():
@pytest.fixture
def perfdocs_sample():
from test_perfdocs import (
SAMPLE_TEST,
SAMPLE_CONFIG,
DYNAMIC_SAMPLE_CONFIG,
SAMPLE_CONFIG,
SAMPLE_INI,
SAMPLE_TEST,
temp_dir,
temp_file,
)

Просмотреть файл

@ -1,5 +1,4 @@
import mozunit
from conftest import build
LINTER = "clang-format"

Просмотреть файл

@ -1,6 +1,7 @@
import mozunit
import os
import mozunit
LINTER = "clippy"

Просмотреть файл

@ -1,6 +1,5 @@
import mozunit
import pytest
from conftest import build
LINTER = "eslint"

Просмотреть файл

@ -1,8 +1,7 @@
from __future__ import absolute_import, print_function
import pytest
import mozunit
import pytest
LINTER = "file-perm"

Просмотреть файл

@ -2,7 +2,6 @@ from __future__ import absolute_import, print_function
import mozunit
LINTER = "file-whitespace"
fixed = 0

Просмотреть файл

@ -1,12 +1,12 @@
import contextlib
from unittest import mock
import os
import pathlib
import pytest
import shutil
import tempfile
from unittest import mock
import mozunit
import pytest
LINTER = "perfdocs"
@ -148,9 +148,9 @@ def setup_sample_logger(logger, structured_logger, top_dir):
PerfDocLogger.PATHS = ["perfdocs"]
PerfDocLogger.TOP_DIR = top_dir
import perfdocs.verifier as vf
import perfdocs.gatherer as gt
import perfdocs.generator as gn
import perfdocs.verifier as vf
gt.logger = logger
vf.logger = logger
@ -775,9 +775,9 @@ def test_perfdocs_framework_gatherers_urls(logger, structured_logger, perfdocs_s
setup_sample_logger(logger, structured_logger, top_dir)
from perfdocs.gatherer import frameworks
from perfdocs.verifier import Verifier
from perfdocs.generator import Generator
from perfdocs.utils import read_yaml
from perfdocs.verifier import Verifier
# This test is only for raptor
gatherer = frameworks["raptor"]

Просмотреть файл

@ -1,6 +1,6 @@
from unittest import mock
import os
import pathlib
from unittest import mock
import mozunit
@ -14,10 +14,10 @@ def setup_sample_logger(logger, structured_logger, top_dir):
PerfDocLogger.PATHS = ["perfdocs"]
PerfDocLogger.TOP_DIR = top_dir
import perfdocs.verifier as vf
import perfdocs.gatherer as gt
import perfdocs.generator as gn
import perfdocs.utils as utils
import perfdocs.verifier as vf
gt.logger = logger
vf.logger = logger

Просмотреть файл

@ -115,8 +115,7 @@ def test_table_builder_invalid_attributes(testdata):
def test_table_builder_mismatched_columns():
from perfdocs.doc_helpers import TableBuilder
from perfdocs.doc_helpers import MismatchedRowLengthsException
from perfdocs.doc_helpers import MismatchedRowLengthsException, TableBuilder
table_specifications = {
"title": "I've got a lovely bunch of coconuts",
@ -141,8 +140,7 @@ def test_table_builder_mismatched_columns():
def test_table_builder_add_row_too_long():
from perfdocs.doc_helpers import TableBuilder
from perfdocs.doc_helpers import MismatchedRowLengthsException
from perfdocs.doc_helpers import MismatchedRowLengthsException, TableBuilder
table = TableBuilder(
table_specifications["title"],

Просмотреть файл

@ -1,5 +1,5 @@
import pytest
import mozunit
import pytest
from mozfile import which
LINTER = "rst"

Просмотреть файл

@ -1,6 +1,5 @@
import mozunit
LINTER = "rustfmt"
fixed = 0

Просмотреть файл

@ -1,5 +1,5 @@
import pytest
import mozunit
import pytest
from mozfile import which
LINTER = "shellcheck"

Просмотреть файл

@ -2,7 +2,6 @@ from __future__ import absolute_import, print_function
import mozunit
LINTER = "trojan-source"

Просмотреть файл

@ -1,4 +1,5 @@
import os
import mozunit
LINTER = "updatebot"

Просмотреть файл

@ -2,9 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from mozbuild.vendor.moz_yaml import load_moz_yaml
from mozlint import result
from mozlint.pathutils import expand_exclusions
from mozbuild.vendor.moz_yaml import load_moz_yaml
class UpdatebotValidator:

Просмотреть файл

@ -8,9 +8,8 @@ import json
import os
import sys
from mozprocess import ProcessHandler
from mozlint import result
from mozprocess import ProcessHandler
results = []

Просмотреть файл

@ -2,8 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
import os
import re
import sys
from collections import defaultdict
@ -15,7 +15,6 @@ from mozlint import result
from mozlint.pathutils import get_ancestors_by_name
from mozlint.util.implementation import LintProcess
YAMLLINT_FORMAT_REGEX = re.compile("(.*):(.*):(.*): \[(error|warning)\] (.*) \((.*)\)$")
results = []

Просмотреть файл

@ -5,18 +5,13 @@
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import subprocess
from datetime import datetime, timedelta
import logging
from operator import itemgetter
import subprocess
import sys
from datetime import datetime, timedelta
from operator import itemgetter
from mach.decorators import (
CommandArgument,
Command,
SubCommand,
)
from mach.decorators import Command, CommandArgument, SubCommand
from mozbuild.base import MozbuildObject
@ -90,6 +85,7 @@ def busted_file(command_context, against):
component = "General"
else:
import inspect
import mozpack.path as mozpath
# Look up the file implementing that command, then cross-refernce

Просмотреть файл

@ -2,23 +2,22 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, unicode_literals, print_function
from __future__ import absolute_import, print_function, unicode_literals
import os
import tempfile
import yaml
from pathlib import PurePath
import frontmatter
import sphinx
import sphinx.ext.apidoc
import yaml
from mozbuild.base import MozbuildObject
from mozbuild.frontend.reader import BuildReader
from mozbuild.util import memoize
from mozpack.copier import FileCopier
from mozpack.files import FileFinder
from mozpack.manifests import InstallManifest
from pathlib import PurePath
import frontmatter
import sphinx
import sphinx.ext.apidoc
here = os.path.abspath(os.path.dirname(__file__))
build = MozbuildObject.from_environment(cwd=here)

Просмотреть файл

@ -2,19 +2,18 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, unicode_literals, print_function
from __future__ import absolute_import, print_function, unicode_literals
import concurrent.futures as futures
import io
import mimetypes
import os
import sys
import botocore
import boto3
import concurrent.futures as futures
import requests
from pprint import pprint
import boto3
import botocore
import requests
from mozbuild.util import memoize

Просмотреть файл

@ -2,14 +2,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, absolute_import
from __future__ import absolute_import, print_function
from distutils.version import StrictVersion
from mach.decorators import (
Command,
CommandArgument,
)
from mach.decorators import Command, CommandArgument
def is_osx_10_10_or_greater(cls):

Просмотреть файл

@ -8,12 +8,13 @@
# MozFormatCodeAddress().
from __future__ import absolute_import, print_function
from subprocess import Popen, PIPE
import atexit
import os
import platform
import re
import sys
from subprocess import PIPE, Popen
# Matches lines produced by MozFormatCodeAddress(), e.g.
# `#01: ???[tests/example +0x43a0]`.
@ -23,8 +24,8 @@ fix_stacks = None
def autobootstrap():
from mozbuild.configure import ConfigureSandbox
import buildconfig
from mozbuild.configure import ConfigureSandbox
sandbox = ConfigureSandbox(
{},

Просмотреть файл

@ -10,7 +10,6 @@ from argparse import ArgumentParser
from .task_config import all_task_configs
COMMON_ARGUMENT_GROUPS = {
"push": [
[

Просмотреть файл

@ -8,16 +8,11 @@ import importlib
import os
import sys
from mach.decorators import (
Command,
SettingsProvider,
SubCommand,
)
from mach.decorators import Command, SettingsProvider, SubCommand
from mach.util import get_state_dir
from mozbuild.base import BuildEnvironmentNotFoundException
from mozbuild.util import memoize
CONFIG_ENVIRONMENT_NOT_FOUND = """
No config environment detected. This means we are unable to properly
detect test files in the specified paths or tags. Please run:

Просмотреть файл

@ -11,12 +11,13 @@ import traceback
import six
from mach.util import get_state_dir
from mozbuild.base import MozbuildObject
from mozversioncontrol import get_repository_object, MissingVCSExtension
from mozversioncontrol import MissingVCSExtension, get_repository_object
from .util.estimates import duration_summary
from .util.manage_estimates import (
download_task_history_data,
make_trimmed_taskgraph_cache,
)
from .util.estimates import duration_summary
GIT_CINNABAR_NOT_FOUND = """
Could not detect `git-cinnabar`.

Просмотреть файл

@ -7,7 +7,7 @@ import json
import os
from ..cli import BaseTryParser
from ..push import push_to_try, history_path
from ..push import history_path, push_to_try
class AgainParser(BaseTryParser):

Просмотреть файл

@ -8,7 +8,6 @@ from taskgraph.util.python_path import find_object
from ..cli import BaseTryParser
from ..push import push_to_try
TRY_AUTO_PARAMETERS = {
"optimize_strategies": "gecko_taskgraph.optimize:tryselect.bugbug_reduced_manifests_config_selection_medium", # noqa
"optimize_target_tasks": True,

Просмотреть файл

@ -8,6 +8,7 @@ import os
import webbrowser
from threading import Timer
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
from tryselect.cli import BaseTryParser
from tryselect.push import (
check_working_directory,
@ -16,8 +17,6 @@ from tryselect.push import (
)
from tryselect.tasks import generate_tasks
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
here = os.path.abspath(os.path.dirname(__file__))

Просмотреть файл

@ -7,11 +7,7 @@ from __future__ import absolute_import, print_function
from abc import ABCMeta, abstractproperty
from collections import defaultdict
from flask import (
Flask,
render_template,
request,
)
from flask import Flask, render_template, request
SECTIONS = []
SUPPORTED_KINDS = set()

Просмотреть файл

@ -7,9 +7,9 @@ import os
from mozbuild.base import MozbuildObject
from mozversioncontrol import get_repository_object
from tryselect.cli import BaseTryParser
from .fuzzy import run as fuzzy_run
from .again import run as again_run
from .again import run as again_run
from .fuzzy import run as fuzzy_run
here = os.path.abspath(os.path.dirname(__file__))
build = MozbuildObject.from_environment(cwd=here)

Просмотреть файл

@ -4,17 +4,16 @@
import collections
import json
import datetime
import hashlib
import json
import os
import shutil
import six
import sqlite3
import subprocess
import requests
import datetime
import six
from mach.util import get_state_dir
from mozbuild.base import MozbuildObject
from mozpack.files import FileFinder
@ -22,8 +21,8 @@ from moztest.resolve import TestResolver
from mozversioncontrol import get_repository_object
from ..cli import BaseTryParser
from ..tasks import generate_tasks, filter_tasks_by_paths, resolve_tests_by_suite
from ..push import push_to_try, generate_try_task_config
from ..push import generate_try_task_config, push_to_try
from ..tasks import filter_tasks_by_paths, generate_tasks, resolve_tests_by_suite
here = os.path.abspath(os.path.dirname(__file__))
build = None

Просмотреть файл

@ -4,7 +4,7 @@
from ..cli import BaseTryParser
from ..push import push_to_try, generate_try_task_config
from ..push import generate_try_task_config, push_to_try
class EmptyParser(BaseTryParser):

Просмотреть файл

@ -6,17 +6,18 @@
import os
import sys
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
from mach.util import get_state_dir
from ..cli import BaseTryParser
from ..tasks import generate_tasks, filter_tasks_by_paths
from ..push import check_working_directory, push_to_try, generate_try_task_config
from ..push import check_working_directory, generate_try_task_config, push_to_try
from ..tasks import filter_tasks_by_paths, generate_tasks
from ..util.fzf import (
FZF_NOT_FOUND,
PREVIEW_SCRIPT,
format_header,
fzf_bootstrap,
FZF_NOT_FOUND,
fzf_shortcuts,
PREVIEW_SCRIPT,
run_fzf,
)
from ..util.manage_estimates import (
@ -24,8 +25,6 @@ from ..util.manage_estimates import (
make_trimmed_taskgraph_cache,
)
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
class FuzzyParser(BaseTryParser):
name = "fuzzy"

Просмотреть файл

@ -2,26 +2,24 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import itertools
import os
import re
import sys
from contextlib import redirect_stdout
from mozbuild.base import MozbuildObject
from mozversioncontrol import get_repository_object
from .compare import CompareParser
from ..push import push_to_try, generate_try_task_config
from ..push import generate_try_task_config, push_to_try
from ..util.fzf import (
FZF_NOT_FOUND,
build_base_cmd,
fzf_bootstrap,
FZF_NOT_FOUND,
setup_tasks_for_fzf,
run_fzf,
setup_tasks_for_fzf,
)
from .compare import CompareParser
here = os.path.abspath(os.path.dirname(__file__))
build = MozbuildObject.from_environment(cwd=here)

Просмотреть файл

@ -6,8 +6,8 @@
import os
import attr
from mozilla_version.gecko import FirefoxVersion
import yaml
from mozilla_version.gecko import FirefoxVersion
from ..cli import BaseTryParser
from ..push import push_to_try, vcs

Просмотреть файл

@ -6,11 +6,10 @@
import sys
import requests
from gecko_taskgraph.util.taskgraph import find_existing_tasks
from taskgraph.parameters import Parameters
from taskgraph.util.taskcluster import find_task_id, get_artifact, get_session
from gecko_taskgraph.util.taskgraph import find_existing_tasks
from ..cli import BaseTryParser
from ..push import push_to_try

Просмотреть файл

@ -10,14 +10,14 @@ They are added to 'try_task_config.json' and processed by the transforms.
import json
import os
import six
import subprocess
import sys
from abc import ABCMeta, abstractmethod, abstractproperty
from argparse import Action, SUPPRESS
from argparse import SUPPRESS, Action
from textwrap import dedent
import mozpack.path as mozpath
import six
from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
from .tasks import resolve_tests_by_suite

Просмотреть файл

@ -14,12 +14,11 @@ import taskgraph
from mach.util import get_state_dir
from mozbuild.base import MozbuildObject
from mozpack.files import FileFinder
from moztest.resolve import TestResolver, TestManifestLoader, get_suite_definition
from moztest.resolve import TestManifestLoader, TestResolver, get_suite_definition
from taskgraph.generator import TaskGraphGenerator
from taskgraph.parameters import ParameterMismatch, parameters_loader
from taskgraph.taskgraph import TaskGraph
here = os.path.abspath(os.path.dirname(__file__))
build = MozbuildObject.from_environment(cwd=here)

Просмотреть файл

@ -5,15 +5,14 @@
from __future__ import absolute_import, print_function, unicode_literals
import os
from unittest.mock import MagicMock
import pytest
import yaml
from unittest.mock import MagicMock
from moztest.resolve import TestResolver
from taskgraph.graph import Graph
from taskgraph.task import Task
from taskgraph.taskgraph import TaskGraph
from tryselect import push

Просмотреть файл

@ -8,9 +8,7 @@ import os
import mozunit
import pytest
from six.moves import reload_module as reload
from tryselect import push
from tryselect.selectors import again

Просмотреть файл

@ -6,7 +6,6 @@ from __future__ import absolute_import, print_function, unicode_literals
import mozunit
import pytest
from tryselect.selectors.auto import AutoParser

Просмотреть файл

@ -6,10 +6,8 @@ from __future__ import absolute_import, print_function, unicode_literals
import mozunit
import pytest
from tryselect.selectors.chooser.app import create_application
TASKS = [
{
"kind": "build",

Просмотреть файл

@ -10,7 +10,6 @@ import os
import mozunit
import pytest
from tryselect.tasks import build, resolve_tests_by_suite
MOZHARNESS_SCRIPTS = {

Просмотреть файл

@ -7,7 +7,6 @@ from unittest import mock
import mozunit
import pytest
import tryselect.selectors.perf as ps
TASKS = [

Просмотреть файл

@ -7,7 +7,6 @@ from __future__ import absolute_import, print_function, unicode_literals
import mozunit
import pytest
TASKS = [
{
"kind": "build",

Просмотреть файл

@ -5,15 +5,13 @@
from __future__ import absolute_import, print_function, unicode_literals
import inspect
import subprocess
from argparse import ArgumentParser
from textwrap import dedent
import mozunit
import pytest
import subprocess
from textwrap import dedent
from tryselect.task_config import all_task_configs, Pernosco
from tryselect.task_config import Pernosco, all_task_configs
# task configs have a list of tests of the form (input, expected)
TASK_CONFIG_TESTS = {

Просмотреть файл

@ -6,7 +6,6 @@ import os
import mozunit
import pytest
from tryselect.tasks import cache_key, filter_tasks_by_paths, resolve_tests_by_suite

Просмотреть файл

@ -3,8 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import json
import os
from datetime import datetime, timedelta
TASK_DURATION_CACHE = "task_duration_history.json"

Просмотреть файл

@ -5,29 +5,27 @@
import os
import platform
import subprocess
import shutil
import six
import subprocess
import sys
from distutils.spawn import find_executable
from packaging.version import Version
from mozbuild.base import MozbuildObject
from mach.util import get_state_dir
from mozterm import Terminal
import mozfile
import six
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
from mach.util import get_state_dir
from mozboot.util import http_download_and_save
from mozbuild.base import MozbuildObject
from mozterm import Terminal
from packaging.version import Version
from ..tasks import generate_tasks
from ..push import check_working_directory
from ..tasks import generate_tasks
from ..util.manage_estimates import (
download_task_history_data,
make_trimmed_taskgraph_cache,
)
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
terminal = Terminal()
here = os.path.abspath(os.path.dirname(__file__))

Просмотреть файл

@ -3,12 +3,12 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import requests
import json
import os
from datetime import datetime, timedelta
import six
import requests
import six
TASK_DURATION_URL = (
"https://storage.googleapis.com/mozilla-mach-data/task_duration_history.json"
@ -16,7 +16,7 @@ TASK_DURATION_URL = (
GRAPH_QUANTILES_URL = (
"https://storage.googleapis.com/mozilla-mach-data/machtry_quantiles.csv"
)
from .estimates import TASK_DURATION_CACHE, GRAPH_QUANTILE_CACHE, TASK_DURATION_TAG_FILE
from .estimates import GRAPH_QUANTILE_CACHE, TASK_DURATION_CACHE, TASK_DURATION_TAG_FILE
def check_downloaded_history(tag_file, duration_cache, quantile_cache):

Просмотреть файл

@ -6,10 +6,11 @@
from __future__ import absolute_import, print_function
import subprocess
import os
import time
import logging
import os
import subprocess
import time
import six
log = logging.getLogger(__name__)

Просмотреть файл

@ -12,7 +12,6 @@ import logging
import os
import sys
""" Define the transformations needed to make source + update == target
Required:

Просмотреть файл

@ -3,14 +3,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import aiohttp
import asyncio
import glob
import logging
import os
from os import path
import glob
import sys
import xml.etree.ElementTree as ET
from os import path
import aiohttp
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
log = logging.getLogger(__name__)

Просмотреть файл

@ -7,19 +7,18 @@ from __future__ import absolute_import, print_function
import logging
import os
from os import path
import sys
from os import path
from tempfile import mkstemp
sys.path.append(path.join(path.dirname(__file__), "../python"))
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
log = logging.getLogger(__name__)
from async_download import download_from_config
from mozrelease.update_verify import UpdateVerifyConfig
from util.commands import run_cmd
from async_download import download_from_config
UPDATE_VERIFY_COMMAND = ["bash", "verify.sh", "-c"]
UPDATE_VERIFY_DIR = path.join(path.dirname(__file__), "../release/updates")

Просмотреть файл

@ -4,21 +4,15 @@
from __future__ import absolute_import, unicode_literals
import json
import logging
import os
import re
import subprocess
import sys
import logging
from mach.decorators import (
CommandArgument,
Command,
)
import mozpack.path as mozpath
import json
from mach.decorators import Command, CommandArgument
GITHUB_ROOT = "https://github.com/"
PR_REPOSITORIES = {
@ -213,10 +207,7 @@ def _split_patches(patchfile, bug_number, pull_request, reviewer):
def _parse_patch(patch, bug_number, pull_request, reviewer):
import email
from email import (
header,
policy,
)
from email import header, policy
parse_policy = policy.compat32.clone(max_line_length=None)
parsed_mail = email.message_from_bytes(patch, policy=parse_policy)