diff --git a/client/galaxy/scripts/app/galaxy.js b/client/galaxy/scripts/app/galaxy.js index 075ce79822d..dff9e9d1bb0 100644 --- a/client/galaxy/scripts/app/galaxy.js +++ b/client/galaxy/scripts/app/galaxy.js @@ -188,7 +188,10 @@ GalaxyApp.prototype._initLocale = function _initLocale(options) { /** add the localize fn to this object and the window namespace (as '_l') */ GalaxyApp.prototype._initUserLocale = function _initUserLocale(options) { // Choose best locale - const global_locale = this.config.default_locale ? this.config.default_locale.toLowerCase() : false; + const global_locale = + this.config.default_locale && this.config.default_locale != "auto" + ? this.config.default_locale.toLowerCase() + : false; let extra_user_preferences = {}; if (this.user && this.user.attributes.preferences && "extra_user_preferences" in this.user.attributes.preferences) { @@ -209,7 +212,7 @@ GalaxyApp.prototype._initUserLocale = function _initUserLocale(options) { ? "__root" : (navigator.language || navigator.userLanguage || "__root").toLowerCase(); - const locale = user_locale || global_locale || nav_locale; + const locale = user_locale || nav_locale || global_locale; sessionStorage.setItem("currentLocale", locale); }; diff --git a/lib/galaxy/dependencies/pipfiles/default/Pipfile b/lib/galaxy/dependencies/pipfiles/default/Pipfile index 67964f85612..5cf77f61560 100644 --- a/lib/galaxy/dependencies/pipfiles/default/Pipfile +++ b/lib/galaxy/dependencies/pipfiles/default/Pipfile @@ -13,6 +13,7 @@ gunicorn = "*" lxml = "!=4.2.2" mock = "*" NoseHTML = "*" +pygithub = "*" pytest = "*" pytest-cov = "*" pytest-html = "*" diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt index 1cba38deffc..6319e533bef 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt @@ -10,6 +10,7 @@ commonmark==0.9.1 configparser==4.0.2 ; python_version < '3.2' contextlib2==0.6.0.post1 ; python_version < '3.5' coverage==5.0.3 +deprecated==1.2.7 docutils==0.15.2 funcsigs==1.0.2 ; python_version < '3.3' future==0.18.2 @@ -33,7 +34,9 @@ pluggy==0.13.1 port-for==0.4 psutil==5.7.0 py==1.8.1 +pygithub==1.45 pygments==2.5.2 +pyjwt==1.7.1 pyparsing==2.4.6 pytest-cov==2.8.1 pytest-html==1.22.1 diff --git a/scripts/bootstrap_history.py b/scripts/bootstrap_history.py index f20cacb6f60..f9a8a758dd6 100644 --- a/scripts/bootstrap_history.py +++ b/scripts/bootstrap_history.py @@ -400,10 +400,9 @@ def do_release(argv): def check_release(argv): - github = _github_client() release_name = argv[2] for pr in _get_prs(release_name): - _text_target(github, pr, labels=_pr_to_labels(pr)) + _text_target(pr, labels=_pr_to_labels(pr)) def check_blocking_prs(argv): @@ -501,9 +500,6 @@ def _get_prs(release_name, state="closed", pr_cache=[]): def main(argv): - if requests is None: - raise Exception("Requests library not found, please pip install requests") - github = _github_client() newest_release = None if argv[1] == "--print-next-minor-version": @@ -558,6 +554,8 @@ def main(argv): ident = argv[1] + if requests is None: + raise Exception("Requests library not found, please pip install requests") message = "" if len(argv) > 2: message = argv[2] @@ -568,13 +566,13 @@ def main(argv): commit = req["commit"] message = commit["message"] message = get_first_sentence(message) - elif requests is not None and ident.startswith("pr"): + elif ident.startswith("pr"): pull_request = ident[len("pr"):] api_url = urljoin(PROJECT_API, "pulls/%s" % pull_request) if req is None: req = requests.get(api_url).json() message = req["title"] - elif requests is not None and ident.startswith("issue"): + elif ident.startswith("issue"): issue = ident[len("issue"):] api_url = urljoin(PROJECT_API, "issues/%s" % issue) if req is None: @@ -600,11 +598,10 @@ def main(argv): owner, owner, ) to_doc += "\n`Pull Request {0}`_".format(pull_request) - if github: - labels = None - if req and 'labels' in req: - labels = req['labels'] - text_target = _text_target(github, pull_request, labels=labels) + labels = None + if req and 'labels' in req: + labels = req['labels'] + text_target = _text_target(pull_request, labels=labels) elif ident.startswith("issue"): issue = ident[len("issue"):] text = ".. _Issue {0}: {1}/issues/{0}".format(issue, PROJECT_URL) @@ -642,7 +639,7 @@ def _write_file(path, contents): f.write(contents) -def _text_target(github, pull_request, labels=None): +def _text_target(pull_request, labels=None): pr_number = None if isinstance(pull_request, string_types): pr_number = pull_request @@ -652,6 +649,7 @@ def _text_target(github, pull_request, labels=None): if labels is None: labels = [] try: + github = _github_client() labels = github.issues.labels.list_by_issue(int(pr_number), user=PROJECT_OWNER, repo=PROJECT_NAME) labels = [l.name.lower() for l in labels] except Exception as e: