Skip to content

Commit

Permalink
Merge pull request #1728 from girder/girder-5-tox
Browse files Browse the repository at this point in the history
Make CI testing compatible with large image and girder 5
  • Loading branch information
naglepuff authored Dec 12, 2024
2 parents d046aa5 + 5e85390 commit 197b853
Show file tree
Hide file tree
Showing 40 changed files with 504 additions and 326 deletions.
15 changes: 8 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ executors:
toxandnode:
working_directory: ~/project
docker:
- image: girder/girder_test:py38-node16
- image: girder/tox-and-node
commands:
tox:
description: "Run tox"
Expand Down Expand Up @@ -57,6 +57,7 @@ commands:
type: string
node:
type: string
default: v20
steps:
- switchpython:
version: << parameters.version >>
Expand Down Expand Up @@ -125,6 +126,12 @@ commands:
nvm alias default << parameters.node >>
NODE_DIR=$(dirname $(which node))
echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV
- run:
name: Install and build large_image plugin
command: |
npm ci
npm run build
working_directory: girder/girder_large_image/web_client
- save_cache:
name: Save nvm cache
key: v1-nvm-cache-<< parameters.node >>
Expand Down Expand Up @@ -169,7 +176,6 @@ jobs:
- checkout
- allservices:
version: "3.8"
node: v14
- tox:
toxenv: test-py38
- coverage
Expand All @@ -183,7 +189,6 @@ jobs:
- checkout
- allservices:
version: "3.9"
node: v14
- tox:
toxenv: test-py39
- coverage
Expand All @@ -197,7 +202,6 @@ jobs:
- checkout
- allservices:
version: "3.10"
node: v14
- tox:
toxenv: test-py310
- coverage
Expand All @@ -211,7 +215,6 @@ jobs:
- checkout
- allservices:
version: "3.11"
node: v14
- tox:
toxenv: test-py311
- coverage
Expand All @@ -225,7 +228,6 @@ jobs:
- checkout
- allservices:
version: "3.12"
node: v14
- tox:
toxenv: test-py312
- coverage
Expand All @@ -239,7 +241,6 @@ jobs:
- checkout
- allservices:
version: "3.13"
node: v14
- tox:
toxenv: test-py313
environ: TOX_VERBOSE=4 TOX_PREFER_BINARY=1
Expand Down
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ dcda95e659a4eaa73cae85ab02f1b89059e63c32
f517ecb2b7d8c454d1374156452be42b87ca3fd1
# PR 1604: Handle ruff linting rule changes
e62083dab9a190d94841b3f4089850f43e2c9932
# PR 1728: Format client and python code
c1ba777b9fb2c927ffc98302197766cdc3c705db
3bff2771141b2d77821e29f96ac9de0428856e3d

12 changes: 8 additions & 4 deletions docs/format_examples_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
examples=[
dict(
filename='sample_image.nd2',
# originally from 'https://downloads.openmicroscopy.org/images/ND2/aryeh/MeOh_high_fluo_003.nd2',
# originally from
# 'https://downloads.openmicroscopy.org/images/ND2/aryeh/MeOh_high_fluo_003.nd2',
url='https://data.kitware.com/api/v1/file/hashsum/sha512/4e76e490c915b10f646cb516f85a4d36d52aa7eff94715b90222644180e26fef6768493887c05adf182cf0351ba0bce659204041c4698a0f6b08423586788f4d/download',
hash='8e23bb594cd18314f9c18e70d736088ae46f8bc696ab7dc047784be416d7a706',
),
Expand All @@ -127,7 +128,8 @@
examples=[
dict(
filename='US-MONO2-8-8x-execho.dcm',
# originally from 'https://downloads.openmicroscopy.org/images/DICOM/samples/US-MONO2-8-8x-execho.dcm',
# originally from
# 'https://downloads.openmicroscopy.org/images/DICOM/samples/US-MONO2-8-8x-execho.dcm',
url='https://data.kitware.com/api/v1/file/hashsum/sha512/5332044f887d82c7f3693c6ca180f07accf5f00c2b7b1a3a29ef9ae737d5f1975478b5e2d5846c391987b8051416068f57a7062e848323c700412236b35679db/download',
hash='7d3f54806d0315c6cfc8b7371649a242b5ef8f31e0d20221971dd8087f2ff1ea',
),
Expand All @@ -141,7 +143,8 @@
examples=[
dict(
filename='20191025 Test FRET 585. 423, 426.lif',
# originally from 'https://downloads.openmicroscopy.org/images/Leica-LIF/imagesc-30856/20191025%20Test%20FRET%20585.%20423,%20426.lif',
# originally from
# 'https://downloads.openmicroscopy.org/images/Leica-LIF/imagesc-30856/20191025%20Test%20FRET%20585.%20423,%20426.lif',
url='https://data.kitware.com/api/v1/file/hashsum/sha512/d25de002d8a81dfcaf6b062b9f429ca85bb81423bc09d3aa33d9d51e9392cc4ace2b8521475e373ceecaf958effd0fade163e7173c467aab66c957da14482ed7/download',
hash='8d4ee62868b9616b832c2eb28e7d62ec050fb032e0bc11ea0a392f5c84390c71',
),
Expand All @@ -155,7 +158,8 @@
examples=[
dict(
filename='Animated_PNG_example_bouncing_beach_ball.png',
# originally from 'https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png',
# originally from
# 'https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png',
url='https://data.kitware.com/api/v1/file/hashsum/sha512/465ebdc2e81b2576dfc96b34e82db7f968e6d4f32f0fa80ef4bb0e44ed216230e6be1a2e4b11ae301a2905cc582dd24cbd2c360d9567ff7b1dac2c871f6d1e37/download',
hash='3b28e2462f1b31d0d15d795e6e58baf397899c3f864be7034bf47939b5bbbc3b',
),
Expand Down
4 changes: 2 additions & 2 deletions girder/girder_large_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import hashlib
import json
import logging
from pathlib import Path
import os
import re
import threading
import time
import warnings
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as _importlib_version
from pathlib import Path

import yaml
from girder_jobs.constants import JobStatus
Expand Down Expand Up @@ -243,7 +243,7 @@ def checkForLargeImageFiles(event): # noqa
except Exception:
pass
# We couldn't automatically set this as a large image
girder.logger.info(
logger.info(
'Saved file %s cannot be automatically used as a largeImage' % str(file['_id']))


Expand Down
6 changes: 3 additions & 3 deletions girder/girder_large_image/web_client/eventStream.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* This implements a polling fallback if event streams are disabled on the
* server. */

const eventStream = girder.utilities.eventStream;
const { restRequest } = girder.rest;

import largeImageConfig from './views/configView';

const eventStream = girder.utilities.eventStream;
const {restRequest} = girder.rest;

eventStream.on('g:eventStream.disable', () => {
largeImageConfig.getSettings(() => {
if (largeImageConfig.settings['large_image.notification_stream_fallback'] === false) {
Expand Down
2 changes: 1 addition & 1 deletion girder/girder_large_image/web_client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import * as vue from './vue';
export {
utils,
views,
vue,
vue
};
2 changes: 1 addition & 1 deletion girder/girder_large_image/web_client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import './views/imageViewerSelectWidget';
// expose symbols under girder.plugins
import * as largeImage from './index';

const { registerPluginNamespace } = girder.pluginUtils;
const {registerPluginNamespace} = girder.pluginUtils;
const SearchFieldWidget = girder.views.widgets.SearchFieldWidget;

registerPluginNamespace('large_image', largeImage);
Expand Down
6 changes: 5 additions & 1 deletion girder/girder_large_image/web_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
"vue/require-prop-types": "off",
"vue/multiline-html-element-content-newline": "off"
},
"root": true
"ignorePatterns": ["dist/**"],
"root": true,
"globals": {
"girder": "readonly"
}
},
"eslintIgnore": [
"**/node_modules/"
Expand Down
8 changes: 4 additions & 4 deletions girder/girder_large_image/web_client/routes.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ConfigView from './views/configView';

const $ = girder.$;
const Backbone = girder.Backbone;
const events = girder.events;
const router = girder.router;
const { exposePluginConfig } = girder.utilities.PluginUtils;
const { parseQueryString, splitRoute } = girder.misc;

import ConfigView from './views/configView';
const {exposePluginConfig} = girder.utilities.PluginUtils;
const {parseQueryString, splitRoute} = girder.misc;

exposePluginConfig('large_image', 'plugins/large_image/config');

Expand Down
2 changes: 1 addition & 1 deletion girder/girder_large_image/web_client/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ function setFrameQuad(tileinfo, layer, options) {
layer.setFrameQuad.status = status;
}

export { setFrameQuad };
export {setFrameQuad};
2 changes: 1 addition & 1 deletion girder/girder_large_image/web_client/views/configView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const events = girder.events;
const restRequest = girder.rest.restRequest;
const BrowserWidget = girder.views.widgets.BrowserWidget;
const PluginConfigBreadcrumbWidget = girder.views.widgets.PluginConfigBreadcrumbWidget;
const { AccessType } = girder.constants;
const {AccessType} = girder.constants;

/**
* Show the default quota settings for users and collections.
Expand Down
6 changes: 3 additions & 3 deletions girder/girder_large_image/web_client/views/fileList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import '../stylesheets/fileList.styl';

const $ = girder.$;
const _ = girder._;
const { restRequest } = girder.rest;
const {restRequest} = girder.rest;
const events = girder.events;
const FileListWidget = girder.views.widgets.FileListWidget;
const { wrap } = girder.utilities.PluginUtils;
const { AccessType } = girder.constants;
const {wrap} = girder.utilities.PluginUtils;
const {AccessType} = girder.constants;

wrap(FileListWidget, 'render', function (render) {
render.call(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FrameSelector from '../vue/components/FrameSelector.vue';

const $ = girder.$;
const _ = girder._;
const { wrap } = girder.utilities.PluginUtils;
const {wrap} = girder.utilities.PluginUtils;
const eventStream = girder.utilities.EventStream;
const ItemView = girder.views.body.ItemView;
const View = girder.views.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const $ = girder.$;
const View = girder.views.View;
const { getApiRoot, restRequest } = girder.rest;
const {getApiRoot, restRequest} = girder.rest;

var ImageViewerWidget = View.extend({
initialize: function (settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Hammer from '@egjs/hammerjs';
import * as d3 from 'd3';

import ImageViewerWidget from './base';
import { setFrameQuad } from '../../utils.js';
import {setFrameQuad} from '../../utils.js';

const $ = girder.$;
const _ = girder._;
const { restRequest } = girder.rest;
const {restRequest} = girder.rest;

window.hammerjs = Hammer;
window.Hammer = Hammer;
Expand Down Expand Up @@ -37,8 +37,8 @@ var GeojsImageViewerWidget = ImageViewerWidget.extend({
return this;
}).then(() => {
this.trigger('g:beforeFirstRender', this);
this.render();
})
return this.render();
});
},

render: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export {
leaflet,
openlayers,
openseadragon,
slideatlas,
slideatlas
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ImageViewerWidget from './base';

const $ = girder.$;
const { restRequest } = girder.rest;
const {restRequest} = girder.rest;

var OpenlayersImageViewerWidget = ImageViewerWidget.extend({
initialize: function (settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ImageViewerWidget from './base';

const $ = girder.$;
const Backbone = girder.Backbone;
const { parseQueryString, splitRoute } = girder.misc;
const {parseQueryString, splitRoute} = girder.misc;

// var baseSAUrl = 'https://unpkg.com/slideatlas-viewer@4.4.1/dist/';
var baseSAUrl = 'https://cdn.jsdelivr.net/npm/slideatlas-viewer@4/dist/';
Expand Down
Loading

0 comments on commit 197b853

Please sign in to comment.