Skip to content

Commit

Permalink
Merge branch 'upstream/pr-5553' into usegalaxy
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Feb 19, 2018
2 parents 69f784b + 55a405f commit 229ad3c
Show file tree
Hide file tree
Showing 882 changed files with 10,183 additions and 26,451 deletions.
19 changes: 10 additions & 9 deletions .ci/check_py3_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ else
fi

export ACK_OPTIONS=" --type python \
--ignore-dir=.git/ \
--ignore-dir=.tox/ \
--ignore-dir=.venv/ \
--ignore-dir=client/node_modules/ \
--ignore-dir=database/ \
--ignore-dir=doc/build/ \
--ignore-dir=eggs/ \
--ignore-dir=static/maps/ \
--ignore-dir=static/scripts/"
--ignore-dir=.git \
--ignore-dir=.tox \
--ignore-dir=.venv \
--ignore-dir=.venv3 \
--ignore-dir=client/node_modules \
--ignore-dir=database \
--ignore-dir=doc/build \
--ignore-dir=eggs \
--ignore-dir=static/maps \
--ignore-dir=static/scripts"

PYTHON2_ONLY_MODULES="__builtin__ _winreg BaseHTTPServer CGIHTTPServer \
ConfigParser Cookie cookielib copy_reg cPickle cStringIO Dialog dummy_thread \
Expand Down
16 changes: 10 additions & 6 deletions .ci/flake8_blacklist.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
.venv/
.tox/
client/node_modules/
database/
.git
.tox
.venv
.venv3
client/node_modules
database
doc/build
doc/source/conf.py
eggs/
eggs
lib/galaxy/util/jstree.py
lib/galaxy/web/proxy/js/node_modules/
static/maps
static/scripts
2 changes: 1 addition & 1 deletion .ci/flake8_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

flake8 --exclude `paste -sd, .ci/flake8_blacklist.txt` .
flake8 --exclude $(paste -sd, .ci/flake8_blacklist.txt) .

# Apply stricter rules for the directories shared with Pulsar
flake8 --ignore=D --max-line-length=150 lib/galaxy/jobs/runners/util/
4 changes: 2 additions & 2 deletions .ci/flake8_wrapper_docstrings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ args="--ignore=D --select=D100,D201,D202,D206,D207,D208,D209,D211,D3,D403"

if [ "$1" = "--include" ];
then
flake8 $args `paste .ci/flake8_docstrings_include_list.txt`
flake8 $args $(paste -sd' ' .ci/flake8_docstrings_include_list.txt)
else
flake8 $args --exclude `paste -sd, .ci/flake8_blacklist.txt` .
flake8 $args --exclude $(paste -sd, .ci/flake8_blacklist.txt) .
fi
4 changes: 2 additions & 2 deletions .ci/jenkins/selenium-compose/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ find test -iname '*pyc' -exec rm -rf {} \;
pip install docker-compose

# TODO: Let docker-compose pick these at random.
export GALAXY_PORT=`python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'`
export SELENIUM_PORT=`python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'`
export GALAXY_PORT=`python -c 'from __future__ import print_function; import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'`
export SELENIUM_PORT=`python -c 'from __future__ import print_function; import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'`

export TARGET_ROOT=`pwd`
export TARGET_PATH=/galaxy
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ scripts/scramble/archives

# Python virtualenv
.venv
.venv3

# Database stuff
database/beaker_sessions
Expand Down Expand Up @@ -123,9 +124,8 @@ tool-data/shared/jars/
sprite-*.less

# JS, Local node_modules, and bower_components directories
static/scripts/bundled/[0-9]*
static/scripts
static/maps
static/scripts/bundled/*.map
node_modules
bower_components
client/galaxy/scripts/libs/*
Expand Down
19 changes: 13 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ env:
- TOX_ENV=py27-lint
- TOX_ENV=py27-unit
- TOX_ENV=qunit
- TOX_ENV=first_startup
- TOX_ENV=py27-lint-docstring-include-list
- TOX_ENV=check-python-dependencies
- TOX_ENV=py27-first_startup
- TOX_ENV=py27-lint_docstring_include_list
- TOX_ENV=check_python_dependencies

matrix:
include:
- env: TOX_ENV=validate-test-tools
- env: TOX_ENV=validate_test_tools
addons:
apt:
packages:
Expand All @@ -25,12 +25,19 @@ matrix:
packages:
- ack-grep
allow_failures:
- env: TOX_ENV=check-python-dependencies
- env: TOX_ENV=check_python_dependencies


install:
- set -e
- pip install tox
- if [ "$TOX_ENV" == "first_startup" ]; then bash -c "bash scripts/common_startup.sh && wget -q https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0127.sqlite && mv db_gx_rev_0127.sqlite database/universe.sqlite && bash manage_db.sh -c ./config/galaxy.yml.sample upgrade"; fi
- |
if [ "$TOX_ENV" == "py27-first_startup" ]; then
sh scripts/common_startup.sh
wget -q https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0127.sqlite
mv db_gx_rev_0127.sqlite database/universe.sqlite
sh manage_db.sh -c ./config/galaxy.yml.sample upgrade
fi
script: tox -e $TOX_ENV

Expand Down
21 changes: 5 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ DOC_SOURCE_DIR=$(DOCS_DIR)/source
SLIDESHOW_DIR=$(DOC_SOURCE_DIR)/slideshow
OPEN_RESOURCE=bash -c 'open $$0 || xdg-open $$0'
SLIDESHOW_TO_PDF?=bash -c 'docker run --rm -v `pwd`:/cwd astefanutti/decktape /cwd/$$0 /cwd/`dirname $$0`/`basename -s .html $$0`.pdf'
CLIENT_COMMIT_WARNING="Please remember to 'make client-production' when finished developing, before a commit!"
YARN := $(shell command -v yarn 2> /dev/null)

all: help
Expand Down Expand Up @@ -72,9 +71,6 @@ tool-shed-config-convert-dry-run: ## convert old style tool shed ini to yaml (dr
tool-shed-config-convert: ## convert old style tool shed ini to yaml
$(CONFIG_MANAGE) convert tool_shed

tool-shed-config-rebuild-sample: ## Rebuild sample tool shed yaml file from schema
$(CONFIG_MANAGE) build_sample_yaml tool_shed --add-comments

reports-config-validate: ## validate reports YAML configuration file
$(CONFIG_MANAGE) validate reports

Expand All @@ -84,15 +80,9 @@ reports-config-convert-dry-run: ## convert old style reports ini to yaml (dry ru
reports-config-convert: ## convert old style reports ini to yaml
$(CONFIG_MANAGE) convert reports

reports-config-rebuild-sample: ## Rebuild sample reports yaml file from schema
$(CONFIG_MANAGE) build_sample_yaml reports --add-comments

reports-config-lint: ## lint reports YAML configuration file
$(CONFIG_MANAGE) lint reports

reports-config-rebuild-rst: ## Rebuild sample reports RST docs
$(CONFIG_MANAGE) build_rst reports > doc/source/admin/reports_options.rst

config-validate: ## validate galaxy YAML configuration file
$(CONFIG_MANAGE) validate galaxy

Expand All @@ -102,15 +92,16 @@ config-convert-dry-run: ## convert old style galaxy ini to yaml (dry run)
config-convert: ## convert old style galaxy ini to yaml
$(CONFIG_MANAGE) convert galaxy

config-rebuild-sample: ## Rebuild sample galaxy yaml file from schema
config-rebuild: ## Rebuild all sample YAML and RST files from config schema
$(CONFIG_MANAGE) build_sample_yaml galaxy --add-comments
$(CONFIG_MANAGE) build_rst galaxy > doc/source/admin/galaxy_options.rst
$(CONFIG_MANAGE) build_sample_yaml reports --add-comments
$(CONFIG_MANAGE) build_rst reports > doc/source/admin/reports_options.rst
$(CONFIG_MANAGE) build_sample_yaml tool_shed --add-comments

config-lint: ## lint galaxy YAML configuration file
$(CONFIG_MANAGE) lint galaxy

config-rebuild-rst: ## Rebuild sample galaxy RST docs
$(CONFIG_MANAGE) build_rst galaxy > doc/source/admin/galaxy_options.rst

release-ensure-upstream: ## Ensure upstream branch for release commands setup
ifeq (shell git remote -v | grep $(RELEASE_UPSTREAM), )
git remote add $(RELEASE_UPSTREAM) git@github.com:galaxyproject/galaxy.git
Expand Down Expand Up @@ -156,7 +147,6 @@ endif

client: node-deps ## Rebuild client-side artifacts for local development.
cd client && yarn run build
@echo $(CLIENT_COMMIT_WARNING)

client-production: node-deps ## Rebuild client-side artifacts for a production deployment (or committing to the repository).
cd client && yarn run build-production
Expand All @@ -169,7 +159,6 @@ client-format: node-deps ## Reformat client code

client-watch: node-deps ## A useful target for parallel development building.
cd client && yarn run watch
@echo $(CLIENT_COMMIT_WARNING)

client-test: client ## Run qunit tests via Karma
cd client && yarn run test
Expand Down
15 changes: 15 additions & 0 deletions client/galaxy/scripts/apps/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Utils from "utils/utils";
import Ui from "mvc/ui/ui-misc";
import DatasetError from "mvc/dataset/dataset-error";
import DatasetEditAttributes from "mvc/dataset/dataset-edit-attributes";
import Visualization from "mvc/visualization/visualization-view";
import Citations from "components/Citations.vue";
import Vue from "vue";

Expand Down Expand Up @@ -52,6 +53,8 @@ window.app = function app(options, bootstrapped) {
"(/)pages(/)edit(/)": "show_pages_edit",
"(/)pages(/)(:action_id)": "show_pages",
"(/)visualizations(/)edit(/)": "show_visualizations_edit",
"(/)visualizations/show/(:visualization_id)": "show_visualizations_client",
"(/)visualizations/dataset_id=(:dataset_id)": "show_visualizations_selector",
"(/)visualizations/(:action_id)": "show_visualizations",
"(/)workflows/import_workflow": "show_import_workflow",
"(/)workflows/run(/)": "show_run",
Expand Down Expand Up @@ -113,6 +116,14 @@ window.app = function app(options, bootstrapped) {
);
},

show_visualizations_selector: function(dataset_id) {
this.page.display(
new Visualization.View({
dataset_id: dataset_id
})
);
},

show_workflows_published: function() {
this.page.display(
new GridView({
Expand Down Expand Up @@ -302,6 +313,10 @@ window.app = function app(options, bootstrapped) {

// render and start the router
$(() => {
options.config = _.extend(options.config, {
hide_panels: Galaxy.params.hide_panels,
hide_masthead: Galaxy.params.hide_masthead
});
Galaxy.page = new Page.View(
_.extend(options, {
Left: ToolPanel,
Expand Down
20 changes: 20 additions & 0 deletions client/galaxy/scripts/apps/chart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as _ from "libs/underscore";
import Client from "mvc/visualization/chart/chart-client";
import Datasets from "mvc/visualization/chart/utilities/datasets";
import Series from "mvc/visualization/chart/utilities/series";
import Jobs from "mvc/visualization/chart/utilities/jobs";

window.bundleEntries = window.bundleEntries || {};

export const bundleEntries = {
chart: function(options) {
return new Client(options);
},
chartUtilities: {
Datasets: Datasets,
Jobs: Jobs,
Series: Series
}
};

_.extend(window.bundleEntries, bundleEntries);
37 changes: 37 additions & 0 deletions client/galaxy/scripts/galaxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import userModel from "mvc/user/user-model";
import metricsLogger from "utils/metrics-logger";
import addLogging from "utils/add-logging";
import localize from "utils/localization";

/* global $ */

// TODO: move into a singleton pattern and have dependents import Galaxy
// ============================================================================
/** Base galaxy client-side application.
Expand Down Expand Up @@ -70,6 +73,9 @@ GalaxyApp.prototype._init = function __init(options, bootstrapped) {
self._initUser(options.user || {});
self.debug("GalaxyApp.user: ", self.user);

self._initUserLocale();
self.debug("currentLocale: ", sessionStorage.getItem("currentLocale"));

self._setUpListeners();
self.trigger("ready", self);

Expand Down Expand Up @@ -171,6 +177,37 @@ GalaxyApp.prototype._initLocale = function _initLocale(options) {
return self;
};

/** add the localize fn to this object and the window namespace (as '_l') */
GalaxyApp.prototype._initUserLocale = function _initUserLocale(options) {
var self = this;

// Choose best locale
var global_locale = self.config.default_locale ? self.config.default_locale.toLowerCase() : false;

var extra_user_preferences = {};
if (self.user && self.user.attributes.preferences && "extra_user_preferences" in self.user.attributes.preferences) {
extra_user_preferences = JSON.parse(self.user.attributes.preferences.extra_user_preferences);
}

var user_locale =
"localization|locale" in extra_user_preferences
? extra_user_preferences["localization|locale"].toLowerCase()
: false;

if (user_locale == "auto") {
user_locale = false;
}

var nav_locale =
typeof navigator === "undefined"
? "__root"
: (navigator.language || navigator.userLanguage || "__root").toLowerCase();

let locale = user_locale || global_locale || nav_locale;

sessionStorage.setItem("currentLocale", locale);
};

/** set up the current user as a Backbone model (mvc/user/user-model) */
GalaxyApp.prototype._initUser = function _initUser(userJSON) {
var self = this;
Expand Down

0 comments on commit 229ad3c

Please sign in to comment.