Bug 1790816 - Reformat build/ with isort. r=linter-reviewers,ahal DONTBUILD

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162668
This commit is contained in:
Marco Castelluccio
2022-11-24 17:23:47 +00:00
parent 73f9495286
commit c71d4c70bc
23 changed files with 63 additions and 67 deletions

View File

@@ -3,12 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function from __future__ import print_function
import os
import subprocess
import buildconfig import buildconfig
import mozpack.path as mozpath import mozpack.path as mozpath
import os
import six
import subprocess
import pytoml import pytoml
import six
# Try to read the package name or otherwise assume same name as the crate path. # Try to read the package name or otherwise assume same name as the crate path.

View File

@@ -6,21 +6,20 @@
# Only necessary for flake8 to be happy... # Only necessary for flake8 to be happy...
from __future__ import print_function from __future__ import print_function
import os
import os.path
import shutil
import subprocess
import platform
import json
import argparse import argparse
import errno
import fnmatch import fnmatch
import glob import glob
import errno import json
import os
import os.path
import platform
import re import re
import shutil
import subprocess
import sys import sys
import tarfile import tarfile
from contextlib import contextmanager from contextlib import contextmanager
from shutil import which from shutil import which
import zstandard import zstandard

View File

@@ -3,8 +3,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys import sys
from mozbuild.base import MozbuildObject
from mozbuild.backend.configenvironment import PartialConfigEnvironment from mozbuild.backend.configenvironment import PartialConfigEnvironment
from mozbuild.base import MozbuildObject
config = MozbuildObject.from_environment() config = MozbuildObject.from_environment()
partial_config = PartialConfigEnvironment(config.topobjdir) partial_config = PartialConfigEnvironment(config.topobjdir)

View File

@@ -27,7 +27,6 @@
import os import os
import sys import sys
SANITIZERS = { SANITIZERS = {
"asan": "address", "asan": "address",
"hwasan": "hwaddress", "hwasan": "hwaddress",

View File

@@ -5,10 +5,10 @@
from __future__ import with_statement from __future__ import with_statement
from optparse import OptionParser
import hashlib import hashlib
import logging import logging
import os import os
from optparse import OptionParser
logger = logging.getLogger("checksums.py") logger = logging.getLogger("checksums.py")

View File

@@ -4,7 +4,6 @@
import json import json
import os import os
import posixpath import posixpath
from os import PathLike from os import PathLike
# `typing.Literal` not available until Python 3.8; # `typing.Literal` not available until Python 3.8;

View File

@@ -3,10 +3,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import glob
import shutil
import errno import errno
import glob
import os
import shutil
import ThirdPartyPaths import ThirdPartyPaths
import ThreadAllows import ThreadAllows

View File

@@ -7,9 +7,9 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import difflib
import logging import logging
import os import os
import difflib
import unittest import unittest
import buildconfig import buildconfig

View File

@@ -5,6 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys import sys
from mozbuild.preprocessor import Preprocessor from mozbuild.preprocessor import Preprocessor

View File

@@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json import json
from argparse import ArgumentParser from argparse import ArgumentParser
ALL_HARNESSES = [ ALL_HARNESSES = [

View File

@@ -20,10 +20,8 @@ if sys.version_info[0] < 3:
else: else:
from importlib.abc import MetaPathFinder from importlib.abc import MetaPathFinder
from types import ModuleType from types import ModuleType
STATE_DIR_FIRST_RUN = """ STATE_DIR_FIRST_RUN = """
Mach and the build system store shared state in a common directory Mach and the build system store shared state in a common directory
on the filesystem. The following directory will be created: on the filesystem. The following directory will be created:
@@ -145,7 +143,7 @@ def initialize(topsrcdir):
) )
] ]
from mach.util import setenv, get_state_dir from mach.util import get_state_dir, setenv
state_dir = _create_state_dir() state_dir = _create_state_dir()
@@ -157,7 +155,6 @@ def initialize(topsrcdir):
import mach.base import mach.base
import mach.main import mach.main
from mach.main import MachCommandReference from mach.main import MachCommandReference
# Centralized registry of available mach commands # Centralized registry of available mach commands

View File

@@ -2,12 +2,13 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import buildconfig import os
import shutil import shutil
import subprocess import subprocess
import os
import sys import sys
import buildconfig
def relativize(path, base=None): def relativize(path, base=None):
# For absolute path in Unix builds, we need relative paths because # For absolute path in Unix builds, we need relative paths because

View File

@@ -7,18 +7,18 @@
# certificates used for SSL testing in Mochitest. The already generated # certificates used for SSL testing in Mochitest. The already generated
# certs are located at $topsrcdir/build/pgo/certs/ . # certs are located at $topsrcdir/build/pgo/certs/ .
import mozinfo
import os import os
import random import random
import re import re
import shutil import shutil
import subprocess import subprocess
import sys import sys
from distutils.spawn import find_executable
from mozbuild.base import MozbuildObject, BinaryNotFoundException import mozinfo
from mozbuild.base import BinaryNotFoundException, MozbuildObject
from mozfile import NamedTemporaryFile, TemporaryDirectory from mozfile import NamedTemporaryFile, TemporaryDirectory
from mozprofile.permissions import ServerLocations from mozprofile.permissions import ServerLocations
from distutils.spawn import find_executable
dbFiles = [ dbFiles = [
re.compile("^cert[0-9]+\.db$"), re.compile("^cert[0-9]+\.db$"),

View File

@@ -4,19 +4,19 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import glob
import json import json
import os import os
import sys
import glob
import subprocess import subprocess
import sys
import mozcrash import mozcrash
from mozbuild.base import MozbuildObject, BinaryNotFoundException from mozbuild.base import BinaryNotFoundException, MozbuildObject
from mozfile import TemporaryDirectory from mozfile import TemporaryDirectory
from mozhttpd import MozHttpd from mozhttpd import MozHttpd
from mozprofile import FirefoxProfile, Preferences from mozprofile import FirefoxProfile, Preferences
from mozprofile.permissions import ServerLocations from mozprofile.permissions import ServerLocations
from mozrunner import FirefoxRunner, CLI from mozrunner import CLI, FirefoxRunner
from six import string_types from six import string_types
PORT = 8888 PORT = 8888

View File

@@ -2,9 +2,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import buildconfig
import textwrap
import string import string
import textwrap
import buildconfig
def generate_bool(name): def generate_bool(name):

View File

@@ -2,13 +2,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from argparse import ArgumentParser
import os import os
from pathlib import Path
import re import re
import shutil import shutil
import subprocess import subprocess
import sys import sys
from argparse import ArgumentParser
from pathlib import Path
from buildconfig import substs from buildconfig import substs
""" """

View File

@@ -15,9 +15,9 @@
# to indicate that files should be uploaded including their paths relative # to indicate that files should be uploaded including their paths relative
# to the base path. # to the base path.
import sys
import os import os
import shutil import shutil
import sys
from optparse import OptionParser from optparse import OptionParser

View File

@@ -6,22 +6,23 @@
from __future__ import absolute_import, print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import argparse import argparse
from contextlib import contextmanager
import gzip import gzip
import io import io
import logging import logging
import os
import sys
import tarfile
import time
from contextlib import contextmanager
from threading import Event, Thread
import requests
from mozbuild.generated_sources import ( from mozbuild.generated_sources import (
get_filename_with_digest, get_filename_with_digest,
get_s3_region_and_bucket, get_s3_region_and_bucket,
) )
import os
from six.moves.queue import Queue
import requests
import sys
import tarfile
from requests.packages.urllib3.util.retry import Retry from requests.packages.urllib3.util.retry import Retry
from threading import Event, Thread from six.moves.queue import Queue
import time
# Arbitrary, should probably measure this. # Arbitrary, should probably measure this.
NUM_WORKER_THREADS = 10 NUM_WORKER_THREADS = 10

View File

@@ -6,18 +6,13 @@ from __future__ import absolute_import, unicode_literals
import json import json
import logging import logging
import mozinfo
import os import os
import time import time
from mach.decorators import ( import mozinfo
Command, from mach.decorators import Command, CommandArgument
CommandArgument, from mozbuild.base import BinaryNotFoundException
) from mozbuild.base import MachCommandConditions as conditions
from mozbuild.base import (
MachCommandConditions as conditions,
BinaryNotFoundException,
)
def is_valgrind_build(cls): def is_valgrind_build(cls):

View File

@@ -3,17 +3,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import yaml
from vsdownload import ( from vsdownload import (
getArgsParser, getArgsParser,
getManifest, getManifest,
getPackages, getPackages,
getSelectedPackages, getSelectedPackages,
setPackageSelection,
lowercaseIgnores, lowercaseIgnores,
setPackageSelection,
) )
import sys
import yaml
if __name__ == "__main__": if __name__ == "__main__":
parser = getArgsParser() parser = getArgsParser()

View File

@@ -3,17 +3,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from vsdownload import (
downloadPackages,
extractPackages,
)
from pathlib import Path
from tempfile import TemporaryDirectory
from zstandard import ZstdCompressor
import argparse import argparse
import os import os
import tarfile import tarfile
from pathlib import Path
from tempfile import TemporaryDirectory
import yaml import yaml
from vsdownload import downloadPackages, extractPackages
from zstandard import ZstdCompressor
def tzstd_path(path): def tzstd_path(path):

View File

@@ -7,11 +7,12 @@
# run the Winchecksec tool (https://github.com/trailofbits/winchecksec) # run the Winchecksec tool (https://github.com/trailofbits/winchecksec)
# against a given Windows binary. # against a given Windows binary.
import buildconfig
import json import json
import subprocess import subprocess
import sys import sys
import buildconfig
# usage # usage
if len(sys.argv) != 2: if len(sys.argv) != 2:
print("""usage : autowinchecksec.by path_to_binary""") print("""usage : autowinchecksec.by path_to_binary""")

View File

@@ -4,6 +4,7 @@
import os import os
import subprocess import subprocess
from buildconfig import substs from buildconfig import substs