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"],
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
install_requires=["six >= 1.13.0"],
|
||||
install_requires=[],
|
||||
tests_require=["wptserve"],
|
||||
)
|
||||
|
||||
@@ -40,12 +40,12 @@ import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from io import StringIO
|
||||
|
||||
import mozpack.path as mozpath
|
||||
from mach.decorators import Command, CommandArgument
|
||||
from mozbuild.base import BinaryNotFoundException, MachCommandBase
|
||||
from mozbuild.dirutils import mkdir
|
||||
from six import StringIO
|
||||
|
||||
AUTOMATION = "MOZ_AUTOMATION" in os.environ
|
||||
BROWSERTIME_ROOT = os.path.dirname(__file__)
|
||||
|
||||
@@ -13,11 +13,9 @@ topsrcdir = os.path.join(here, os.pardir, os.pardir)
|
||||
|
||||
EXTRA_PATHS = (
|
||||
"python/mach",
|
||||
"python/mozbuild",
|
||||
"python/mozversioncontrol",
|
||||
"testing/mozbase/mozfile",
|
||||
"third_party/python/jsmin",
|
||||
"third_party/python/six",
|
||||
)
|
||||
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import sqlite3
|
||||
import subprocess
|
||||
|
||||
import requests
|
||||
import six
|
||||
from mach.util import get_state_dir
|
||||
from mozbuild.base import MozbuildObject
|
||||
from mozpack.files import FileFinder
|
||||
@@ -37,9 +36,10 @@ def setup_globals():
|
||||
build = MozbuildObject.from_environment(cwd=here)
|
||||
vcs = get_repository_object(build.topsrcdir)
|
||||
|
||||
root_hash = hashlib.sha256(
|
||||
six.ensure_binary(os.path.abspath(build.topsrcdir))
|
||||
).hexdigest()
|
||||
topsrcdir = build.topsrcdir
|
||||
if isinstance(topsrcdir, str):
|
||||
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")
|
||||
if not os.path.isdir(cache_dir):
|
||||
os.makedirs(cache_dir)
|
||||
@@ -421,11 +421,7 @@ def run(
|
||||
print("Found " + test_count_message)
|
||||
|
||||
# Set the test paths to be run by setting MOZHARNESS_TEST_PATHS.
|
||||
path_env = {
|
||||
"MOZHARNESS_TEST_PATHS": six.ensure_text(
|
||||
json.dumps(resolve_tests_by_suite(test_files))
|
||||
)
|
||||
}
|
||||
path_env = {"MOZHARNESS_TEST_PATHS": json.dumps(resolve_tests_by_suite(test_files))}
|
||||
try_config_params.setdefault("try_task_config", {}).setdefault("env", {}).update(
|
||||
path_env
|
||||
)
|
||||
|
||||
@@ -18,7 +18,6 @@ from textwrap import dedent
|
||||
|
||||
import mozpack.path as mozpath
|
||||
import requests
|
||||
import six
|
||||
from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
|
||||
from taskgraph.util import taskcluster
|
||||
|
||||
@@ -224,9 +223,7 @@ class Path(TryConfig):
|
||||
]
|
||||
return {
|
||||
"env": {
|
||||
"MOZHARNESS_TEST_PATHS": six.ensure_text(
|
||||
json.dumps(resolve_tests_by_suite(paths))
|
||||
),
|
||||
"MOZHARNESS_TEST_PATHS": json.dumps(resolve_tests_by_suite(paths)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import os
|
||||
from importlib import reload
|
||||
|
||||
import mozunit
|
||||
import pytest
|
||||
from six.moves import reload_module as reload
|
||||
from tryselect import push
|
||||
from tryselect.selectors import again
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import subprocess
|
||||
import sys
|
||||
|
||||
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
|
||||
@@ -239,7 +238,7 @@ def get_fzf_version(fzf_bin):
|
||||
sys.exit(1)
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import os
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import requests
|
||||
import six
|
||||
|
||||
TASK_DURATION_URL = (
|
||||
"https://storage.googleapis.com/mozilla-mach-data/task_duration_history.json"
|
||||
@@ -96,7 +95,7 @@ def download_task_history_data(cache_dir):
|
||||
return
|
||||
|
||||
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:
|
||||
json.dump({"download_date": datetime.now().strftime("%Y-%m-%d")}, f, indent=4)
|
||||
|
||||
Reference in New Issue
Block a user