From 7b5a1d99dc04dfbb3ae0b7b8d0001490b62fae9a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 28 Feb 2020 11:19:06 +0100 Subject: [PATCH 1/3] Use browser locale over global default Not 100% sure this is correct, but it seems logical to me. Should fix https://github.com/galaxyproject/galaxy/issues/9459. --- client/galaxy/scripts/app/galaxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/galaxy/scripts/app/galaxy.js b/client/galaxy/scripts/app/galaxy.js index 8431bd1cb5f..584a7608c7d 100644 --- a/client/galaxy/scripts/app/galaxy.js +++ b/client/galaxy/scripts/app/galaxy.js @@ -209,7 +209,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); }; From 34ca9c3167918325aa7c60d2ac78e4ddcedf4c0d Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 28 Feb 2020 11:31:14 -0500 Subject: [PATCH 2/3] Fix handling of default locale as 'auto' --- client/galaxy/scripts/app/galaxy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/galaxy/scripts/app/galaxy.js b/client/galaxy/scripts/app/galaxy.js index 584a7608c7d..1c1d2f484ee 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) { From 088653e2cb40717382bc5e60a6bad730ad6606f9 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Sat, 29 Feb 2020 01:53:29 +0000 Subject: [PATCH 3/3] Add missing pygithub dev-requirement Follow-up to https://github.com/galaxyproject/galaxy/pull/9271 Also move GitHub client initialisation and check for `requests` closer to where they are used to prevent error messages when running `make`. --- .../dependencies/pipfiles/default/Pipfile | 1 + .../default/pinned-dev-requirements.txt | 3 +++ scripts/bootstrap_history.py | 24 +++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) 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 cbf02baf09f..1b53e2b2826 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt @@ -11,6 +11,7 @@ commonmark==0.9.1 configparser==4.0.2 ; python_version < '3.2' contextlib2==0.6.0.post1 ; python_version < '3.5' coverage==4.5.4 +deprecated==1.2.7 docutils==0.15.2 funcsigs==1.0.2 ; python_version < '3.3' future==0.18.2 @@ -34,7 +35,9 @@ pluggy==0.13.1 port-for==0.4 psutil==5.6.7 py==1.8.0 +pygithub==1.45 pygments==2.5.2 +pyjwt==1.7.1 pyparsing==2.4.5 pytest-cov==2.8.1 pytest-html==1.22.1 diff --git a/scripts/bootstrap_history.py b/scripts/bootstrap_history.py index 87c471a4289..ce753d653a7 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: