Bug 1961909 - Removed usage of six in tools directory and removed six from mozfile's setup.py. r=firefox-build-system-reviewers,perftest-reviewers,ahochheiden,fbilt
Differential Revision: https://phabricator.services.mozilla.com/D246363
This commit is contained in:
@@ -29,6 +29,6 @@ setup(
|
|||||||
packages=["mozfile"],
|
packages=["mozfile"],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
install_requires=["six >= 1.13.0"],
|
install_requires=[],
|
||||||
tests_require=["wptserve"],
|
tests_require=["wptserve"],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ import stat
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
import mozpack.path as mozpath
|
import mozpack.path as mozpath
|
||||||
from mach.decorators import Command, CommandArgument
|
from mach.decorators import Command, CommandArgument
|
||||||
from mozbuild.base import BinaryNotFoundException, MachCommandBase
|
from mozbuild.base import BinaryNotFoundException, MachCommandBase
|
||||||
from mozbuild.dirutils import mkdir
|
from mozbuild.dirutils import mkdir
|
||||||
from six import StringIO
|
|
||||||
|
|
||||||
AUTOMATION = "MOZ_AUTOMATION" in os.environ
|
AUTOMATION = "MOZ_AUTOMATION" in os.environ
|
||||||
BROWSERTIME_ROOT = os.path.dirname(__file__)
|
BROWSERTIME_ROOT = os.path.dirname(__file__)
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ topsrcdir = os.path.join(here, os.pardir, os.pardir)
|
|||||||
|
|
||||||
EXTRA_PATHS = (
|
EXTRA_PATHS = (
|
||||||
"python/mach",
|
"python/mach",
|
||||||
"python/mozbuild",
|
|
||||||
"python/mozversioncontrol",
|
"python/mozversioncontrol",
|
||||||
"testing/mozbase/mozfile",
|
"testing/mozbase/mozfile",
|
||||||
"third_party/python/jsmin",
|
"third_party/python/jsmin",
|
||||||
"third_party/python/six",
|
|
||||||
)
|
)
|
||||||
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
|
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import sqlite3
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import six
|
|
||||||
from mach.util import get_state_dir
|
from mach.util import get_state_dir
|
||||||
from mozbuild.base import MozbuildObject
|
from mozbuild.base import MozbuildObject
|
||||||
from mozpack.files import FileFinder
|
from mozpack.files import FileFinder
|
||||||
@@ -37,9 +36,10 @@ def setup_globals():
|
|||||||
build = MozbuildObject.from_environment(cwd=here)
|
build = MozbuildObject.from_environment(cwd=here)
|
||||||
vcs = get_repository_object(build.topsrcdir)
|
vcs = get_repository_object(build.topsrcdir)
|
||||||
|
|
||||||
root_hash = hashlib.sha256(
|
topsrcdir = build.topsrcdir
|
||||||
six.ensure_binary(os.path.abspath(build.topsrcdir))
|
if isinstance(topsrcdir, str):
|
||||||
).hexdigest()
|
topsrcdir = topsrcdir.encode()
|
||||||
|
root_hash = hashlib.sha256(os.path.abspath(topsrcdir)).hexdigest()
|
||||||
cache_dir = os.path.join(get_state_dir(), "cache", root_hash, "chunk_mapping")
|
cache_dir = os.path.join(get_state_dir(), "cache", root_hash, "chunk_mapping")
|
||||||
if not os.path.isdir(cache_dir):
|
if not os.path.isdir(cache_dir):
|
||||||
os.makedirs(cache_dir)
|
os.makedirs(cache_dir)
|
||||||
@@ -421,11 +421,7 @@ def run(
|
|||||||
print("Found " + test_count_message)
|
print("Found " + test_count_message)
|
||||||
|
|
||||||
# Set the test paths to be run by setting MOZHARNESS_TEST_PATHS.
|
# Set the test paths to be run by setting MOZHARNESS_TEST_PATHS.
|
||||||
path_env = {
|
path_env = {"MOZHARNESS_TEST_PATHS": json.dumps(resolve_tests_by_suite(test_files))}
|
||||||
"MOZHARNESS_TEST_PATHS": six.ensure_text(
|
|
||||||
json.dumps(resolve_tests_by_suite(test_files))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
try_config_params.setdefault("try_task_config", {}).setdefault("env", {}).update(
|
try_config_params.setdefault("try_task_config", {}).setdefault("env", {}).update(
|
||||||
path_env
|
path_env
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ from textwrap import dedent
|
|||||||
|
|
||||||
import mozpack.path as mozpath
|
import mozpack.path as mozpath
|
||||||
import requests
|
import requests
|
||||||
import six
|
|
||||||
from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
|
from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
|
||||||
from taskgraph.util import taskcluster
|
from taskgraph.util import taskcluster
|
||||||
|
|
||||||
@@ -224,9 +223,7 @@ class Path(TryConfig):
|
|||||||
]
|
]
|
||||||
return {
|
return {
|
||||||
"env": {
|
"env": {
|
||||||
"MOZHARNESS_TEST_PATHS": six.ensure_text(
|
"MOZHARNESS_TEST_PATHS": json.dumps(resolve_tests_by_suite(paths)),
|
||||||
json.dumps(resolve_tests_by_suite(paths))
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# 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 os
|
||||||
|
from importlib import reload
|
||||||
|
|
||||||
import mozunit
|
import mozunit
|
||||||
import pytest
|
import pytest
|
||||||
from six.moves import reload_module as reload
|
|
||||||
from tryselect import push
|
from tryselect import push
|
||||||
from tryselect.selectors import again
|
from tryselect.selectors import again
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import mozfile
|
import mozfile
|
||||||
import six
|
|
||||||
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
|
from gecko_taskgraph.target_tasks import filter_by_uncommon_try_tasks
|
||||||
from mach.util import get_state_dir
|
from mach.util import get_state_dir
|
||||||
from mozboot.util import http_download_and_save
|
from mozboot.util import http_download_and_save
|
||||||
@@ -239,7 +238,7 @@ def get_fzf_version(fzf_bin):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Some fzf versions have extra, e.g 0.18.0 (ff95134)
|
# Some fzf versions have extra, e.g 0.18.0 (ff95134)
|
||||||
fzf_version = six.ensure_text(fzf_version.split()[0])
|
fzf_version = fzf_version.split()[0].decode()
|
||||||
|
|
||||||
return fzf_version
|
return fzf_version
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import os
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import six
|
|
||||||
|
|
||||||
TASK_DURATION_URL = (
|
TASK_DURATION_URL = (
|
||||||
"https://storage.googleapis.com/mozilla-mach-data/task_duration_history.json"
|
"https://storage.googleapis.com/mozilla-mach-data/task_duration_history.json"
|
||||||
@@ -96,7 +95,7 @@ def download_task_history_data(cache_dir):
|
|||||||
return
|
return
|
||||||
|
|
||||||
with open(graph_quantile_cache, "w") as f:
|
with open(graph_quantile_cache, "w") as f:
|
||||||
f.write(six.ensure_text(r.content))
|
f.write(r.text)
|
||||||
|
|
||||||
with open(task_duration_tag_file, "w") as f:
|
with open(task_duration_tag_file, "w") as f:
|
||||||
json.dump({"download_date": datetime.now().strftime("%Y-%m-%d")}, f, indent=4)
|
json.dump({"download_date": datetime.now().strftime("%Y-%m-%d")}, f, indent=4)
|
||||||
|
|||||||
Reference in New Issue
Block a user