From f51d3f16222cbd5a3460de3d74d6362a87f03ec8 Mon Sep 17 00:00:00 2001 From: anita-steiner Date: Thu, 29 Aug 2019 07:47:04 +0200 Subject: [PATCH 01/22] changes for version v2.2.0 --- package.json | 4 ++-- requirements.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f5ee3b2..f706340 100644 --- a/package.json +++ b/package.json @@ -59,12 +59,12 @@ "iojs": ">= 3" }, "dependencies": { - "phovea_core": "~2.1.2" + "phovea_core": "github:phovea/phovea_core#develop" }, "name": "phovea_processing_queue", "description": "Process long-running tasks in the background using Celery.", "homepage": "https://phovea.caleydo.org", - "version": "2.2.0", + "version": "2.2.1-SNAPSHOT", "author": { "name": "The Caleydo Team", "email": "contact@caleydo.org", diff --git a/requirements.txt b/requirements.txt index c4c0b72..e164242 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -phovea_data_redis>=2.3.0,<2.4.0 -phovea_server>=2.3.0,<2.4.0 +-e git+https://github.com/phovea/phovea_data_redis.git@develop#egg=phovea_data_redis +-e git+https://github.com/phovea/phovea_server.git@develop#egg=phovea_server celery[redis,auth,msgpack]==4.0.1 From 9c71b9c42b058b80ad886d12270aab91791f0460 Mon Sep 17 00:00:00 2001 From: rumersdorfer <45141967+rumersdorfer@users.noreply.github.com> Date: Fri, 15 Nov 2019 13:54:33 +0100 Subject: [PATCH 02/22] Update node-sass to ^4.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f706340..229475f 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "karma-sourcemap-loader": "0.3.7", "karma-webpack": "2.0.2", "mkdirp": "0.5.1", - "node-sass": "4.5.0", + "node-sass": "^4.12.0", "null-loader": "0.1.1", "raw-loader": "0.5.1", "sass-loader": "5.0.0", From 5254438d735d03e7f313918e66b8cef2bbc0fb19 Mon Sep 17 00:00:00 2001 From: rumersdorfer <45141967+rumersdorfer@users.noreply.github.com> Date: Thu, 12 Dec 2019 11:05:36 +0100 Subject: [PATCH 03/22] Add TS compiler flags for i18n to tsconfig.json --- tsconfig.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index e65e1a7..e5cbf65 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,9 @@ ], "baseUrl": "../", "noImplicitAny": false, - "skipLibCheck": true + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true }, "include": [ "src/**/*.ts", From 6fe97cbe05b62b24e08cece67038cc5ce9796b6f Mon Sep 17 00:00:00 2001 From: Holger Stitz Date: Thu, 12 Dec 2019 17:26:15 +0100 Subject: [PATCH 04/22] Using generator-phovea v3.0.0 Closes #18 - Update docker base images from `caleydo/phovea_python:v1.0` to `caleydo/phovea_python:v1.1` - Update CircleCI config - Update dev dependencies - Update buildPython.js --- .circleci/config.yml | 95 ++++++++++++ .gitignore | 1 + .gitlab-ci.yml | 57 +++++++ .yo-rc.json | 6 + buildInfo.js | 29 ++-- buildPython.js | 69 +++++++++ deploy/Dockerfile | 14 +- deploy/Dockerfile_dev | 11 +- docs/.gitignore | 1 - docs/phovea_processing_queue.rst | 54 +++++++ index.js | 8 +- karma.conf.js | 2 +- package.json | 55 ++++--- requirements.txt | 2 +- setup.py | 2 +- tests.webpack.js | 5 +- tox.ini | 2 +- tsconfig.json | 8 +- tsconfig_dev.json | 6 + tsd.d.ts | 5 + webpack.config.js | 251 +++++++++++++++++++------------ 21 files changed, 527 insertions(+), 156 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .gitlab-ci.yml create mode 100644 buildPython.js create mode 100644 docs/phovea_processing_queue.rst create mode 100644 tsconfig_dev.json diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7e3d2e7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,95 @@ +version: 2 +jobs: + build: + working_directory: ~/phovea + docker: + - image: caleydo/phovea_circleci_python:v3.0 + steps: + - checkout + - run: + name: Show Node.js and npm version + command: | + node -v + npm -v + - run: + name: Show Python and pip version + command: | + python --version + pip --version + - run: + name: Install Docker packages from docker_packages.txt + command: | + (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y)) + - restore_cache: + key: deps2-{{ .Branch }}-{{ checksum "package.json" }} + - run: + name: Install npm dependencies + command: npm install + - run: + name: Remove npm dependencies installed from git repositories (avoid caching of old commits) + command: | + (grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf + - save_cache: + key: deps2-{{ .Branch }}-{{ checksum "package.json" }} + paths: + - ./node_modules + - run: + name: Install npm dependencies from git repositories (always get latest commit) + command: npm install + - run: + name: Show installed npm dependencies + command: npm list --depth=1 || true + - restore_cache: + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }} + - run: + name: Install pip requirements + command: | + virtualenv ~/venv + . ~/venv/bin/activate + pip install -r requirements_dev.txt + pip install -r requirements.txt + - save_cache: + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }} + paths: + - ~/venv + - run: + name: Force an update of pip dependencies from git repositories # not sure if this is working ? + command: | + . ~/venv/bin/activate + pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt + - run: + name: Show installed pip packages + command: pip list || true + - run: + name: Build + command: | + . ~/venv/bin/activate + npm run dist + - store_artifacts: + path: dist +workflows: + version: 2 +# build-nightly: +# triggers: +# - schedule: +# cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5 +# filters: +# branches: +# only: +# - develop +# jobs: +# - build + build-branch: + jobs: + - build: + filters: + tags: + ignore: /^v.*/ + build-tag: + jobs: + - build: + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ diff --git a/.gitignore b/.gitignore index 2104b5e..4969b7c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ node_modules/ /tests/**/*.js *.map *.css +/.cache-loader diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7feb561 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,57 @@ +image: caleydo/phovea_circleci_python:v3.0 + +variables: + GIT_DEPTH: "1" + +cache: + key: "$CI_REPOSITORY_URL-$CI_COMMIT_REF_NAME" + paths: + - node_modules + - ~/venv + +before_script: + # Install ssh-agent if not already installed, it is required by Docker. + # (change apt-get to yum if you use a CentOS-based image) + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + + # Run ssh-agent (inside the build environment) + - eval $(ssh-agent -s) + + # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store + - ssh-add <(echo "$SSH_PRIVATE_KEY") + + # For Docker builds disable host key checking. Be aware that by adding that + # you are suspectible to man-in-the-middle attacks. + # WARNING: Use this only with the Docker executor, if you use it with shell + # you will overwrite your user's SSH config. + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + +stages: + - install + - build + +install-npm-wee: + stage: install + script: + - npm install + +install-pip-wee: + stage: install + script: | + (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y)) + virtualenv ~/venv + . ~/venv/bin/activate + pip install --upgrade --upgrade-strategy=only-if-needed -r requirements_dev.txt + pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt + +dist: + stage: build + script: | + . ~/venv/bin/activate + npm run dist + allow_failure: false + artifacts: + expire_in: 1 week + paths: + - dist diff --git a/.yo-rc.json b/.yo-rc.json index fdc7784..c2f4781 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -43,6 +43,12 @@ "unknown": { "requirements": [], "dockerPackages": [] + }, + "promptValues": { + "authorName": "The Caleydo Team", + "authorEmail": "contact@caleydo.org", + "authorUrl": "https://caleydo.org", + "githubAccount": "phovea" } } } \ No newline at end of file diff --git a/buildInfo.js b/buildInfo.js index 3814ddc..4e7bd68 100644 --- a/buildInfo.js +++ b/buildInfo.js @@ -2,13 +2,11 @@ * Created by sam on 13.11.2016. */ - const spawnSync = require('child_process').spawnSync; const path = require('path'); const resolve = path.resolve; const fs = require('fs'); - function dependencyGraph(cwd) { const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const r = spawnSync(npm, ['ls', '--prod', '--json'], { @@ -37,7 +35,7 @@ function gitHead(cwd) { function resolveModules() { const reg = fs.readFileSync('../phovea_registry.js').toString(); - const regex = /import '(.*)\/phovea_registry.js'/g; + const regex = /^import '(.*)\/phovea_registry.js'/gm; const modules = []; let r; while ((r = regex.exec(reg)) !== null) { @@ -55,19 +53,20 @@ function resolveWorkspace() { const workspaceDeps = dependencyGraph('..').dependencies; const modules = new Set(resolveModules()); + let deps = null; const resolveModule = (m) => { console.log('resolve', m); - const pkg = require(`../${m}/package.json`); + const pkg = JSON.parse(fs.readFileSync(`../${m}/package.json`).toString()); const head = gitHead('../' + m); const repo = pkg.repository.url; return { name: pkg.name, version: pkg.version, - resolved: head ? `${repo.endsWith('.git') ? repo.slice(0, repo.length-4) : repo}/commit/${head}` : pkg.version, + resolved: head ? `${repo.endsWith('.git') ? repo.slice(0, repo.length - 4) : repo}/commit/${head}` : pkg.version, dependencies: deps(pkg.dependencies) }; }; - const deps = (deps) => { + deps = (deps) => { const r = {}; Object.keys(deps).forEach((d) => { if (d in workspaceDeps) { @@ -121,21 +120,18 @@ function generate() { const isWorkspaceContext = fs.existsSync('../phovea_registry.js'); if (isWorkspaceContext) { return resolveWorkspace(); - } else { - return resolveSingle(); } + return resolveSingle(); } - const IS_WINDOWS = process.platform === 'win32'; function tmpdir() { if (IS_WINDOWS) { return process.env.TEMP || process.env.TMP || - (process.env.SystemRoot || process.env.windir) + '\\temp'; - } else { - return process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp'; + (process.env.SystemRoot || process.env.windir) + '\\temp'; } + return process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp'; } function resolveScreenshot() { @@ -143,7 +139,7 @@ function resolveScreenshot() { if (!fs.existsSync(f)) { return null; } - const buffer = new Buffer(fs.readFileSync(f)).toString('base64'); + const buffer = Buffer.from(fs.readFileSync(f)).toString('base64'); return `data:image/png;base64,${buffer}`; } @@ -151,29 +147,30 @@ function metaData(pkg) { pkg = pkg || require(`./package.json`); return { name: pkg.name, + displayName: pkg.displayName, version: pkg.version, repository: pkg.repository.url, + homepage: pkg.homepage, description: pkg.description, screenshot: resolveScreenshot() }; } module.exports.metaData = metaData; -module.exports.metaDataTmpFile = function(pkg) { +module.exports.metaDataTmpFile = function (pkg) { const s = metaData(pkg); const file = `${tmpdir()}/metaData${Math.random().toString(36).slice(-8)}.txt`; fs.writeFileSync(file, JSON.stringify(s, null, ' ')); return file; }; module.exports.generate = generate; -module.exports.tmpFile = function() { +module.exports.tmpFile = function () { const s = generate(); const file = `${tmpdir()}/buildInfo${Math.random().toString(36).slice(-8)}.txt`; fs.writeFileSync(file, JSON.stringify(s, null, ' ')); return file; }; - if (require.main === module) { fs.writeFile('deps.json', JSON.stringify(generate(), null, ' ')); } diff --git a/buildPython.js b/buildPython.js new file mode 100644 index 0000000..c30f2e8 --- /dev/null +++ b/buildPython.js @@ -0,0 +1,69 @@ +/** + * Created by sam on 13.11.2016. + */ + +const spawnSync = require('child_process').spawnSync; +const fs = require('fs'); + +function gitHead(cwd) { + const r = spawnSync('git', ['rev-parse', '--verify', 'HEAD'], { + cwd: cwd + }); + if (!r.stdout) { + console.error(cwd, r.error); + return 'error'; + } + return r.stdout.toString().trim(); +} + +function resolvePlugin(repo, version) { + if (fs.lstatSync('.git').isDirectory() && repo) { + if (repo.endsWith('.git')) { + repo = repo.slice(0, repo.length - 4); + return repo + '/commit/' + gitHead('.'); + } + } + // not a git repo + return version; +} + +function toVersion(v) { + const now = new Date().toISOString(); + // %Y%m%d-%H%M%S + const fmt = now + .replace(/T/, ' ') + .replace(/\..+/, '') + .replace(/[-:]/, '') + .replace(' ', '-'); + return v.replace('SNAPSHOT', fmt); +} + +function _main() { + const pkg = require('./package.json'); + const name = pkg.name; + const version = toVersion(pkg.version); + const resolved = resolvePlugin((pkg.repository || {}).url, version); + + const buildInfo = { + name, + version, + resolved, + description: pkg.description, + homepage: pkg.homepage, + repository: (pkg.repository || {}).url + }; + + const l = ('build/source/' + name.toLowerCase()).split('/'); + l.forEach((_, i) => { + const path = l.slice(0, i + 1).join('/'); + if (!fs.existsSync(path)) { + fs.mkdirSync(path); + } + }); + + fs.writeFileSync('build/source/' + name.toLowerCase() + '/buildInfo.json', JSON.stringify(buildInfo, null, ' ')); +} + +if (require.main === module) { + _main(); +} diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 693f04a..eca276c 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -1,16 +1,20 @@ -FROM caleydo/phovea_python:v1.0 +FROM caleydo/phovea_python:v1.1 -MAINTAINER Samuel Gratzl +LABEL maintainer="contact@caleydo.org" WORKDIR /phovea -RUN printf "from phovea_server import launch\nlaunch.run()\n" > ./launch.py +RUN printf "from phovea_server import launch\nlaunch.run()\n" > /phovea/launch.py # install dependencies last step such that everything before can be cached -COPY requirements*.txt docker_packages.txt ./ -RUN (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs apt-get install -y)) && pip install --no-cache-dir -r requirements.txt +COPY requirements*.txt docker_packages.txt docker_script*.sh ./ +RUN (!(test -s docker_packages.txt) || (apt-get update && \ + (cat docker_packages.txt | xargs apt-get install -y))) && \ + (pip install --no-cache-dir -r requirements.txt) +RUN (!(test -f docker_script.sh) || (bash ./docker_script.sh)) COPY ./build/source ./ ENV PHOVEA_ENV=production ENV PHOVEA_SERVICE=celery +ENV PHOVEA_CONFIG_PATH=config.json CMD python launch.py --env ${PHOVEA_ENV} ${PHOVEA_SERVICE} EXPOSE 80 diff --git a/deploy/Dockerfile_dev b/deploy/Dockerfile_dev index 89ce8c6..1dfccb8 100644 --- a/deploy/Dockerfile_dev +++ b/deploy/Dockerfile_dev @@ -1,11 +1,14 @@ -FROM caleydo/phovea_python:v1.0-dev +FROM caleydo/phovea_python:v1.1-dev -MAINTAINER Samuel Gratzl +LABEL maintainer="contact@caleydo.org" WORKDIR /phovea # install dependencies last step such that everything before can be cached -COPY requirements*.txt docker_packages.txt ./ -RUN (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs apt-get install -y)) && pip install --no-cache-dir -r requirements.txt && (pip install --no-cache-dir -r requirements_dev.txt) +COPY requirements*.txt docker_packages.txt docker_script*.sh ./ +RUN (!(test -f docker_packages.txt) || (apt-get -y update && cat docker_packages.txt | xargs apt-get install -y)) && \ + pip install --no-cache-dir -r requirements.txt && \ + (pip install --no-cache-dir -r requirements_dev.txt) +RUN (!(test -f docker_script.sh) || bash ./docker_script.sh) ENV PHOVEA_ENV=dev ENV PHOVEA_SERVICE=celery diff --git a/docs/.gitignore b/docs/.gitignore index 226186b..0af02c8 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,4 +1,3 @@ /modules.rst /phovea_server.rst -/phovea_processing_queue.rst diff --git a/docs/phovea_processing_queue.rst b/docs/phovea_processing_queue.rst new file mode 100644 index 0000000..53ddf73 --- /dev/null +++ b/docs/phovea_processing_queue.rst @@ -0,0 +1,54 @@ +phovea_processing_queue package +=============================== + +Submodules +---------- + +phovea_processing_queue.processing module +----------------------------------------- + +.. automodule:: phovea_processing_queue.processing + :members: + :undoc-members: + :show-inheritance: + +phovea_processing_queue.security module +--------------------------------------- + +.. automodule:: phovea_processing_queue.security + :members: + :undoc-members: + :show-inheritance: + +phovea_processing_queue.server module +------------------------------------- + +.. automodule:: phovea_processing_queue.server + :members: + :undoc-members: + :show-inheritance: + +phovea_processing_queue.task_definition module +---------------------------------------------- + +.. automodule:: phovea_processing_queue.task_definition + :members: + :undoc-members: + :show-inheritance: + +phovea_processing_queue.tasks module +------------------------------------ + +.. automodule:: phovea_processing_queue.tasks + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: phovea_processing_queue + :members: + :undoc-members: + :show-inheritance: diff --git a/index.js b/index.js index beb0591..61859c3 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ * generates and object that contain all modules in the src folder accessible as properties */ -/*** +/** * magic file name for the pseudo root file * @type {string} */ @@ -28,19 +28,19 @@ function byName(a, b) { } return a.toLowerCase().localeCompare(b.toLowerCase()); } -//list all modules in the src folder excluding the one starting with _ +// list all modules in the src folder excluding the one starting with _ var req = require.context('./src', true, /^\.\/(?!internal)(([^_][\w]+)|(\w+\/index))\.tsx?$/); var files = req.keys().sort(byName); -//root file exists? else use anonymous root object +// root file exists? else use anonymous root object if (files[0] === INDEX_FILE) { module.exports = req(files.shift()); } else { module.exports = {}; } -//generate getter for all modules +// generate getter for all modules files.forEach(function (f) { Object.defineProperty(module.exports, f.substring(2, f.lastIndexOf('/index.') > 0 ? f.lastIndexOf('/index.') : f.lastIndexOf('.')), { get: function () { diff --git a/karma.conf.js b/karma.conf.js index d15ca8b..eb434ab 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,7 +14,7 @@ module.exports = (config) => { // list of files / patterns to load in the browser files: [ - 'tests.webpack.js' //just load this file + 'tests.webpack.js' // just load this file ], // preprocess matching files before serving them to the browser diff --git a/package.json b/package.json index 229475f..32e610c 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "scripts": { "start": "webpack-dev-server --inline", - "check": "flake8", + "check": "flake8 --exclude=.git,venv,deploy,docs,__pycache__,node_modules", "pretest": "echo hybrid", "test": "npm run test:web && npm run test:python", "predist": "echo hybrid", "dist": "npm run dist:web && npm run dist:python", "compile": "tsc", - "lint": "tslint -c tslint.json src/**.ts tests/**.ts", + "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", "docs": "npm run docs:web && npm run docs:python", "prebuild": "echo hybrid", "posttest": "echo hybrid", @@ -19,8 +19,8 @@ "release:major": "npm version major && npm publish && git push --follow-tags", "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", - "test:web": "test ! -d tests || karma start", - "test:python": "test ! -d tests || python setup.py test", + "test:web": "test ! $(find tests -name \"*.ts\") || karma start", + "test:python": "test ! $(find tests -name \"*.py\") || python setup.py test", "dist:web": "mkdirp dist && cd build && tar cvzf ../dist/phovea_processing_queue.tar.gz *", "dist:python": "python setup.py sdist bdist_wheel", "pretest:web": "npm run compile", @@ -33,7 +33,7 @@ "prepublish": "npm run build", "docs:web": "typedoc --options typedoc.json src/**.ts", "docs:python": "sphinx-apidoc -o docs -f ./phovea_processing_queue && sphinx-build ./docs build/docs", - "build:python": "python build.py", + "build:python": "rm -rf build/source && find . -name '*.pyc' -delete && node buildPython.js && cp -r ./phovea_processing_queue build/source/", "build:web": "webpack --env prod", "prebuild:python": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test:python", "prebuild:web": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test:web", @@ -54,8 +54,8 @@ ], "main": "build/phovea_processing_queue.js", "engines": { - "npm": ">= 3", - "node": ">= 6", + "npm": ">= 6.12", + "node": ">= 12.13", "iojs": ">= 3" }, "dependencies": { @@ -79,35 +79,40 @@ "url": "https://github.com/phovea/phovea_processing_queue.git" }, "devDependencies": { - "@types/jasmine": "2.5.41", - "awesome-typescript-loader": "3.0.3", - "css-loader": "0.26.1", - "extract-text-webpack-plugin": "2.0.0-rc.3", + "@types/jasmine": "2.5.47", + "awesome-typescript-loader": "3.1.2", + "cache-loader": "1.2.0", + "css-loader": "0.28.0", + "extract-text-webpack-plugin": "2.1.0", "extract-loader": "0.1.0", - "file-loader": "0.10.0", - "html-loader": "0.4.4", - "imports-loader": "0.7.0", + "ifdef-loader": "2.0.0", + "file-loader": "0.11.1", + "fork-ts-checker-webpack-plugin": "0.4.1", + "html-loader": "0.4.5", + "imports-loader": "0.7.1", "jasmine": "2.5.3", "json-loader": "0.5.4", - "karma": "1.4.0", + "karma": "1.5.0", "karma-chrome-launcher": "2.0.0", - "karma-firefox-launcher": "1.0.0", + "karma-firefox-launcher": "1.0.1", "karma-jasmine": "1.1.0", "karma-junit-reporter": "2.0.0", "karma-sourcemap-loader": "0.3.7", - "karma-webpack": "2.0.2", + "karma-webpack": "2.0.3", "mkdirp": "0.5.1", "node-sass": "^4.12.0", "null-loader": "0.1.1", "raw-loader": "0.5.1", - "sass-loader": "5.0.0", - "style-loader": "0.13.1", - "tslib": "1.5.0", - "tslint": "4.4.2", - "typedoc": "0.5.5", - "typescript": "2.2.0", - "url-loader": "0.5.7", - "webpack": "2.2.1", + "sass-loader": "6.0.7", + "style-loader": "0.16.1", + "thread-loader": "1.1.2", + "ts-loader": "4.0.1", + "tslib": "1.9.0", + "tslint": "5.9.1", + "typedoc": "0.11.1", + "typescript": "2.8.1", + "url-loader": "0.5.8", + "webpack": "2.3.3", "webpack-dev-server": "2.4.2" } } diff --git a/requirements.txt b/requirements.txt index e164242..97d8c1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -e git+https://github.com/phovea/phovea_data_redis.git@develop#egg=phovea_data_redis -e git+https://github.com/phovea/phovea_server.git@develop#egg=phovea_server -celery[redis,auth,msgpack]==4.0.1 +celery[redis,auth,msgpack]==4.0.1 \ No newline at end of file diff --git a/setup.py b/setup.py index 0c2dfa9..b4f30f1 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ def to_version(v): setup( - name=pkg['name'], + name=pkg['name'].lower(), version=to_version(pkg['version']), url=pkg['homepage'], description=pkg['description'], diff --git a/tests.webpack.js b/tests.webpack.js index e0b8754..9438ac4 100644 --- a/tests.webpack.js +++ b/tests.webpack.js @@ -4,10 +4,11 @@ * Licensed under the new BSD license, available at http://caleydo.org/license **************************************************************************** */ -//build registry +// build registry require('./phovea_registry.js'); + /** * find all tests in the spec directory and load them */ -var context = require.context('./tests', true, /\.test\.ts$/); //make sure you have your directory and regex test set correctly! +var context = require.context('./tests', true, /\.test\.ts$/); // make sure you have your directory and regex test set correctly! context.keys().forEach(context); diff --git a/tox.ini b/tox.ini index f2734b2..a349028 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ commands = py.test tests [flake8] -ignore=E111,E114,E501 +ignore=E111,E114,E501,E121,E123,E126,E226,E24,E704 exclude = .tox,*.egg,build,data,.git,__pycache__,docs,node_modules [pytest] diff --git a/tsconfig.json b/tsconfig.json index e65e1a7..ab4451b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,11 +9,15 @@ "experimentalDecorators": true, "lib": [ "dom", - "es2015" + "es2015", + "es2016.array.include", + "es2017.object" ], "baseUrl": "../", "noImplicitAny": false, - "skipLibCheck": true + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true }, "include": [ "src/**/*.ts", diff --git a/tsconfig_dev.json b/tsconfig_dev.json new file mode 100644 index 0000000..807b9bf --- /dev/null +++ b/tsconfig_dev.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "target": "es6" + } +} diff --git a/tsd.d.ts b/tsd.d.ts index 0c265d5..9e343ca 100644 --- a/tsd.d.ts +++ b/tsd.d.ts @@ -9,7 +9,12 @@ declare module "*.scss" { const content:string; export default content; } +declare module "*.css" { + const content:string; + export default content; +} declare module "*.png"; +declare module "*.jpg"; //allow html dependencies declare module "*.html" { const content:string; diff --git a/webpack.config.js b/webpack.config.js index 6b51f6f..7dbb9a1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,17 +4,18 @@ * Licensed under the new BSD license, available at http://caleydo.org/license **************************************************************************** */ -const {libraryAliases, libraryExternals, modules, entries, ignores, type} = require('./.yo-rc.json')['generator-phovea']; +const {libraryAliases, libraryExternals, modules, entries, ignores, type, registry, vendor} = require('./.yo-rc.json')['generator-phovea']; const resolve = require('path').resolve; const pkg = require('./package.json'); const webpack = require('webpack'); const fs = require('fs'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const buildInfo = require('./buildInfo.js'); const now = new Date(); const prefix = (n) => n < 10 ? ('0' + n) : n.toString(); -const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth())}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; +const buildId = `${now.getUTCFullYear()}${prefix(now.getUTCMonth() + 1)}${prefix(now.getUTCDate())}-${prefix(now.getUTCHours())}${prefix(now.getUTCMinutes())}${prefix(now.getUTCSeconds())}`; pkg.version = pkg.version.replace('SNAPSHOT', buildId); const year = (new Date()).getFullYear(); @@ -23,32 +24,75 @@ const banner = '/*! ' + (pkg.title || pkg.name) + ' - v' + pkg.version + ' - ' + '* Copyright (c) ' + year + ' ' + pkg.author.name + ';' + ' Licensed ' + pkg.license + '*/\n'; +const preCompilerFlags = {flags: (registry || {}).flags || {}}; +const includeFeature = registry ? (extension, id) => { + const exclude = registry.exclude || []; + const include = registry.include || []; + if (!exclude && !include) { + return true; + } + const test = (f) => Array.isArray(f) ? extension.match(f[0]) && (id || '').match(f[1]) : extension.match(f); + return include.every(test) && !exclude.some(test); +} : () => true; + +const tsLoader = [ + { + loader: 'awesome-typescript-loader' + } +]; -//list of loaders and their mappings +const tsLoaderDev = [ + {loader: 'cache-loader'}, + { + loader: 'thread-loader', + options: { + // there should be 1 cpu for the fork-ts-checker-webpack-plugin + workers: require('os').cpus().length - 1 + } + }, + { + loader: 'ts-loader', + options: { + happyPackMode: true, // IMPORTANT! use happyPackMode mode to speed-up compilation and reduce errors reported to webpack, + compilerOptions: { + target: 'es6' + } + } + } +]; + +// list of loaders and their mappings const webpackloaders = [ - {test: /\.scss$/, loader: 'style-loader!css-loader!sass-loader'}, - {test: /\.tsx?$/, loader: 'awesome-typescript-loader'}, - {test: /\.json$/, loader: 'json-loader'}, + {test: /\.scss$/, use: 'style-loader!css-loader!sass-loader'}, + {test: /\.css$/, use: 'style-loader!css-loader'}, + {test: /\.tsx?$/, use: tsLoader}, + { + test: /phovea(_registry)?\.js$/, use: [{ + loader: 'ifdef-loader', + options: Object.assign({include: includeFeature}, preCompilerFlags) + }] + }, + {test: /\.json$/, use: 'json-loader'}, { test: /\.(png|jpg)$/, loader: 'url-loader', - query: { - limit: 10000, //inline <= 10kb + options: { + limit: 10000 // inline <= 10kb } }, { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader', - query: { - limit: 10000, //inline <= 10kb + options: { + limit: 10000, // inline <= 10kb mimetype: 'application/font-woff' } }, { test: /\.svg(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader', - query: { - limit: 10000, //inline <= 10kb + options: { + limit: 10000, // inline <= 10kb mimetype: 'image/svg+xml' } }, @@ -58,15 +102,15 @@ const webpackloaders = [ /** * tests whether the given phovea module name is matching the requested file and if so convert it to an external lookup * depending on the loading type - **/ + */ function testPhoveaModule(moduleName, request) { if (!(new RegExp('^' + moduleName + '/src.*')).test(request)) { return false; } const subModule = request.match(/.*\/src\/?(.*)/)[1]; - //skip empty modules = root + // skip empty modules = root const path = subModule === '' ? [moduleName] : [moduleName, subModule]; - //phovea_ ... phovea.name + // phovea_ ... phovea.name const rootPath = /phovea_.*/.test(moduleName) ? ['phovea', moduleName.slice(7)].concat(path.slice(1)) : path; return { root: rootPath, @@ -88,7 +132,6 @@ function testPhoveaModules(modules) { }; } - // use workspace registry file if available const isWorkspaceContext = fs.existsSync(resolve(__dirname, '..', 'phovea_registry.js')); const registryFile = isWorkspaceContext ? '../phovea_registry.js' : './phovea_registry.js'; @@ -102,18 +145,17 @@ const actBuildInfoFile = `file-loader?name=buildInfo.json!${buildInfo.tmpFile()} */ function injectRegistry(entry) { const extraFiles = [registryFile, actBuildInfoFile, actMetaData]; - //build also the registry + // build also the registry if (typeof entry === 'string') { return extraFiles.concat(entry); - } else { - const transformed = {}; - Object.keys(entry).forEach((eentry) => { - transformed[eentry] = extraFiles.concat(entry[eentry]); - }); - return transformed; } - + const transformed = {}; + Object.keys(entry).forEach((eentry) => { + transformed[eentry] = extraFiles.concat(entry[eentry]); + }); + return transformed; } + /** * generate a webpack configuration */ @@ -123,28 +165,24 @@ function generateWebpack(options) { output: { path: resolve(__dirname, 'build'), filename: (options.name || (pkg.name + (options.bundle ? '_bundle' : ''))) + (options.min && !options.nosuffix ? '.min' : '') + '.js', - publicPath: '' //no public path = relative + chunkFilename: '[chunkhash].js', + publicPath: '' // no public path = relative }, resolve: { - // Add `.ts` and `.tsx` as a resolvable extension. + // add `.ts` and `.tsx` as a resolvable extension. extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'], alias: Object.assign({}, options.libs || {}), - //fallback to the directory above if they are siblings just in the workspace context + symlinks: false, + // fallback to the directory above if they are siblings just in the workspace context modules: isWorkspaceContext ? [ resolve(__dirname, '../'), 'node_modules' ] : ['node_modules'] }, plugins: [ - new webpack.BannerPlugin({ - banner: banner, - raw: true - }), - //define magic constants that are replaced + // define magic constants that are replaced new webpack.DefinePlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify(options.isProduction ? 'production': 'development') - }, + 'process.env.NODE_ENV': JSON.stringify(options.isProduction ? 'production' : 'development'), __VERSION__: JSON.stringify(pkg.version), __LICENSE__: JSON.stringify(pkg.license), __BUILD_ID__: buildId, @@ -152,21 +190,14 @@ function generateWebpack(options) { __TEST__: options.isTest, __PRODUCTION__: options.isProduction, __APP_CONTEXT__: JSON.stringify('/') - }), - new webpack.optimize.MinChunkSizePlugin({ - minChunkSize: 10000 //at least 10.000 characters - }), - new webpack.optimize.AggressiveMergingPlugin() - //rest depends on type + }) + // rest depends on type ], externals: [], module: { loaders: webpackloaders.slice() }, devServer: { - watchOptions: { - ignored: '/node_modules/' - }, proxy: { '/api/*': { target: 'http://localhost:9000', @@ -186,45 +217,70 @@ function generateWebpack(options) { secure: false } }, - contentBase: resolve(__dirname, 'build') + contentBase: resolve(__dirname, 'build'), + watchOptions: { + aggregateTimeout: 500, + ignored: /node_modules/ + } + }, + watchOptions: { + aggregateTimeout: 500, + ignored: /node_modules/ } }; + if (options.isProduction) { + base.plugins.unshift(new webpack.BannerPlugin({ + banner: banner, + raw: true + })); + base.plugins.push(new webpack.optimize.MinChunkSizePlugin({ + minChunkSize: 10000 // at least 10.000 characters + })); + // base.plugins.push(new webpack.optimize.ModuleConcatenationPlugin()); + } else if (options.isDev) { + // switch to def settings + base.module.loaders.find((d) => d.use === tsLoader).use = tsLoaderDev; + base.plugins.push(new ForkTsCheckerWebpackPlugin({checkSyntacticErrors: true, tsconfig: './tsconfig_dev.json'})); + } + if (options.library) { let libName = /phovea_.*/.test(pkg.name) ? ['phovea', pkg.name.slice(7)] : pkg.name; - //generate a library, i.e. output the last entry element - //create library name + // generate a library, i.e. output the last entry element + // create library name if (options.moduleBundle) { libName = 'phovea'; } base.output.library = libName; base.output.libraryTarget = 'umd'; - base.output.umdNamedDefine = false; //anonymous require module + base.output.umdNamedDefine = false; // anonymous require module } - if (!options.bundle) { - //if we don't bundle don't include external libraries and other phovea modules + // if we don't bundle don't include external libraries and other phovea modules base.externals.push(...(options.externals || Object.keys(options.libs || {}))); - //ignore all phovea modules + // ignore all phovea modules if (options.modules) { base.externals.push(testPhoveaModules(options.modules)); } - //ignore extra modules + // ignore extra modules (options.ignore || []).forEach(function (d) { - base.module.loaders.push({test: new RegExp(d), loader: 'null-loader'}); //use null loader + base.module.loaders.push({test: new RegExp(d), loader: 'null-loader'}); // use null loader }); - //ingore phovea module registry calls + // ingore phovea module registry calls (options.modules || []).forEach(function (m) { - base.module.loaders.push({test: new RegExp('.*[\\\\/]' + m + '[\\\\/]phovea_registry.js'), loader: 'null-loader'}); //use null loader + base.module.loaders.push({ + test: new RegExp('.*[\\\\/]' + m + '[\\\\/]phovea_registry.js'), + loader: 'null-loader' + }); // use null loader }); } if (!options.bundle || options.isApp) { - //extract the included css file to own file - let p = new ExtractTextPlugin({ - filename: (options.isApp || options.moduleBundle ? 'style' : pkg.name) + (options.min && !options.nosuffix ? '.min' : '') + '.css', + // extract the included css file to own file + const p = new ExtractTextPlugin({ + filename: (options.isApp || options.moduleBundle ? '[name]' : pkg.name) + (options.min && !options.nosuffix ? '.min' : '') + '.css', allChunks: true // there seems to be a bug in dynamically loaded chunk styles are not loaded, workaround: extract all styles from all chunks }); base.plugins.push(p); @@ -232,38 +288,45 @@ function generateWebpack(options) { test: /\.scss$/, loader: p.extract(['css-loader', 'sass-loader']) }; + base.module.loaders[1] = { + test: /\.css$/, + loader: p.extract(['css-loader']) + }; } if (options.isApp) { // create manifest // base.plugins.push(new webpack.optimize.AppCachePlugin()); } if (options.commons) { - //build a commons plugin + // build a commons plugin base.plugins.push(new webpack.optimize.CommonsChunkPlugin({ // The order of this array matters - names: ['common'], + name: 'common', + filename: 'common.js', minChunks: 2 })); } + if (options.vendor) { + (Array.isArray(options.vendor) ? options.vendor : [options.vendor]).forEach((reg) => { + base.plugins.push(new webpack.optimize.CommonsChunkPlugin({ + async: true, + children: true, + deepChildren: true, + minChunks: (module, count) => new RegExp(reg, 'i').test(module.resource) && count >= 2 + })); + }); + } if (options.min) { - //use a minifier + // use a minifier base.plugins.push( new webpack.LoaderOptionsPlugin({ minimize: true, debug: false }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - }, - output: { - comments: false - }, - sourceMap: false - })); + new webpack.optimize.UglifyJsPlugin()); } else { - //generate source maps - base.devtool = 'source-map'; + // generate source maps + base.devtool = 'inline-source-map'; } return base; } @@ -278,6 +341,7 @@ function generateWebpackConfig(env) { libs: libraryAliases, externals: libraryExternals, modules: modules, + vendor: vendor, ignore: ignores, isProduction: isProduction, isDev: isDev, @@ -292,36 +356,37 @@ function generateWebpackConfig(env) { if (type.startsWith('app')) { base.isApp = true; - base.bundle = true; //bundle everything together - base.name = '[name]'; //multiple entries case - base.commons = true; //extract commons module + base.bundle = true; // bundle everything together + base.name = '[name]'; // multiple entries case + base.commons = true; // extract commons module } else if (type === 'bundle') { - base.library = true; //expose as library - base.moduleBundle = true; //expose as library 'phovea' - base.name = pkg.name; //to avoid adding _bundle + base.library = true; // expose as library + base.moduleBundle = true; // expose as library 'phovea' + base.name = pkg.name; // to avoid adding _bundle base.bundle = true; - } else { //type === 'lib' + } else { // type === 'lib' base.library = true; } - //single generation + // single generation if (isDev) { return generateWebpack(base); - } else if (type.startsWith('app')) { //isProduction app + } + if (type.startsWith('app')) { // isProduction app return generateWebpack(Object.assign({}, base, { - min: true, - nosuffix: true - })); - } else { //isProduction - return [ - //plain - generateWebpack(base), - //minified - generateWebpack(Object.assign({}, base, { - min: true - })) - ]; + min: true, + nosuffix: true + })); } + // isProduction + return [ + // plain + generateWebpack(base), + // minified + generateWebpack(Object.assign({}, base, { + min: true + })) + ]; } module.exports = generateWebpackConfig; From 35f8d5cd0e31256dfe093dd8cd03a10c5db12e14 Mon Sep 17 00:00:00 2001 From: rumersdorfer <45141967+rumersdorfer@users.noreply.github.com> Date: Tue, 7 Jan 2020 17:04:09 +0100 Subject: [PATCH 05/22] Ignore package-lock.json --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2104b5e..1e6a486 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ node_modules/ /tests/**/*.js *.map *.css +package-lock.json From 1e8075188832394b262fbf7b96d2c57004f05ab8 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 07:59:37 +0100 Subject: [PATCH 06/22] update requirements for python 3.7 --- requirements_dev.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 7ca3f68..03169b4 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,6 +1,6 @@ -flake8==3.0.4 -pep8-naming==0.4.1 -pytest==3.0.3 -pytest-runner==2.9 -Sphinx==1.5.2 -recommonmark==0.4.0 +flake8==3.5.0 +pep8-naming==0.8.2 +pytest==3.5.0 +pytest-runner==4.2 +Sphinx==1.7.2 +recommonmark==0.6.0 From 07630651dc327b94bfcad4559bb5a82334d78bd0 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:00:33 +0100 Subject: [PATCH 07/22] use `circleci/python:3.7-buster-node-browsers` as Docker image --- .circleci/config.yml | 2 +- .gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e3d2e7..d957bbe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/phovea docker: - - image: caleydo/phovea_circleci_python:v3.0 + - image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python steps: - checkout - run: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7feb561..39f5d9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: caleydo/phovea_circleci_python:v3.0 +image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python variables: GIT_DEPTH: "1" From 608a430a508f5cfb0c4219bd6507fa7d422adda4 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:01:20 +0100 Subject: [PATCH 08/22] Replace python tests with `py37`in_tox.ini_ --- tox.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index a349028..9b4ec36 100644 --- a/tox.ini +++ b/tox.ini @@ -5,12 +5,11 @@ ############################################################################### [tox] -envlist = py{27,34} +envlist = py{37} [testenv] basepython = - py27: python2.7 - py34: python3.4 + py37: python3.7 deps = flake8 pytest From a58c96674d23da77262d1e2322fa77bb91d6fcf3 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:01:36 +0100 Subject: [PATCH 09/22] Update python setup.py classifiers to Python 3.7 --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b4f30f1..89b4913 100644 --- a/setup.py +++ b/setup.py @@ -65,8 +65,7 @@ def to_version(v): # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: ' + ('BSD License' if pkg['license'] == 'BSD-3-Clause' else pkg['license']), 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4' + 'Programming Language :: Python :: 3.7' ], # You can just specify the packages manually here if your project is From c2ad73509665c2d7b86b5924b1c4d109ae2d2b0c Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:02:02 +0100 Subject: [PATCH 10/22] Remove `.encode('ascii')` from _setup.py_ --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 89b4913..64add79 100644 --- a/setup.py +++ b/setup.py @@ -26,12 +26,12 @@ def read_it(name): def packaged(*files): r = {} global pkg - r[pkg['name'].encode('ascii')] = list(files) + r[pkg['name']] = list(files) return r def requirements(file): - return [r.strip().encode('ascii') for r in read_it(file).strip().split('\n') if not r.startswith('-e git+https://')] + return [r.strip() for r in read_it(file).strip().split('\n') if not r.startswith('-e git+https://')] def to_version(v): From 86025b0efb6021b9315c9b4b40953c45c58373b0 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:02:34 +0100 Subject: [PATCH 11/22] use `destination` instead of removed `prefix` --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d957bbe..2740dfa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,7 @@ jobs: npm run dist - store_artifacts: path: dist + destination: dist workflows: version: 2 # build-nightly: From bc913d1adf5323a547e64dcaaa366bf02e0ebfd6 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:03:18 +0100 Subject: [PATCH 12/22] Use python:3.7 as base Docker image in Dockerfile --- deploy/Dockerfile | 2 +- deploy/Dockerfile_dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/Dockerfile b/deploy/Dockerfile index eca276c..cfde61d 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -1,4 +1,4 @@ -FROM caleydo/phovea_python:v1.1 +FROM python:3.7 LABEL maintainer="contact@caleydo.org" WORKDIR /phovea diff --git a/deploy/Dockerfile_dev b/deploy/Dockerfile_dev index 1dfccb8..05957e0 100644 --- a/deploy/Dockerfile_dev +++ b/deploy/Dockerfile_dev @@ -1,4 +1,4 @@ -FROM caleydo/phovea_python:v1.1-dev +FROM python:3.7 LABEL maintainer="contact@caleydo.org" WORKDIR /phovea From 48821e52f910d7bd060d7b661fa3415bc56b48ba Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:05:05 +0100 Subject: [PATCH 13/22] update `TOXENV` in _.travis.yml_ --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d98645e..a838a76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ language: python sudo: required env: -- TOXENV=py27 -- TOXENV=py34 +- TOXENV=py37 node_js: - 6 addons: From 3108a8c4eb6a17cee9dea710905f955ba2d7aefc Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Thu, 9 Jan 2020 08:06:15 +0100 Subject: [PATCH 14/22] use lib2to3 to convert to new syntax --- phovea_processing_queue/processing.py | 2 +- phovea_processing_queue/server.py | 3 +-- phovea_processing_queue/task_definition.py | 4 ++-- phovea_processing_queue/tasks.py | 2 +- setup.py | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/phovea_processing_queue/processing.py b/phovea_processing_queue/processing.py index 2500cc1..eb1bb68 100644 --- a/phovea_processing_queue/processing.py +++ b/phovea_processing_queue/processing.py @@ -40,7 +40,7 @@ def get_result(task_id): @app.route('/add//', methods=['GET']) def add(x, y): - import tasks + from . import tasks res = tasks.add.delay(x, y) return res.id diff --git a/phovea_processing_queue/server.py b/phovea_processing_queue/server.py index b60c7a5..0687a29 100644 --- a/phovea_processing_queue/server.py +++ b/phovea_processing_queue/server.py @@ -1,7 +1,6 @@ -from __future__ import absolute_import -__author__ = 'Samuel Gratzl' +__author__ = 'Samuel Gratzl' def run(args): """ diff --git a/phovea_processing_queue/task_definition.py b/phovea_processing_queue/task_definition.py index 586bfe9..5eef3f3 100644 --- a/phovea_processing_queue/task_definition.py +++ b/phovea_processing_queue/task_definition.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, print_function + import functools import redis from celery.result import AsyncResult @@ -25,7 +25,7 @@ def _map(p): _log.info('add processing task: %s', p.module) return p.module - task_modules = map(_map, plugins) + task_modules = list(map(_map, plugins)) app = Celery(cc.get('celery.name'), broker=cc.get('celery.broker'), diff --git a/phovea_processing_queue/tasks.py b/phovea_processing_queue/tasks.py index 7549588..3f2926c 100644 --- a/phovea_processing_queue/tasks.py +++ b/phovea_processing_queue/tasks.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import + from phovea_processing_queue.task_definition import task, getLogger diff --git a/setup.py b/setup.py index 64add79..4027003 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # Copyright (c) The Caleydo Team. All rights reserved. # Licensed under the new BSD license, available at http://caleydo.org/license ############################################################################### -from __future__ import with_statement, print_function + from setuptools import setup, find_packages from codecs import open from os import path From d78eb6ce81368296168ea8f9853f9b894c60191d Mon Sep 17 00:00:00 2001 From: Anita Steiner Date: Thu, 9 Jan 2020 14:23:25 +0100 Subject: [PATCH 15/22] Update webpack.config.js --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 7dbb9a1..95542e3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -280,7 +280,7 @@ function generateWebpack(options) { if (!options.bundle || options.isApp) { // extract the included css file to own file const p = new ExtractTextPlugin({ - filename: (options.isApp || options.moduleBundle ? '[name]' : pkg.name) + (options.min && !options.nosuffix ? '.min' : '') + '.css', + filename: (options.isApp || options.moduleBundle ? 'style' : pkg.name) + (options.min && !options.nosuffix ? '.min' : '') + '.css', allChunks: true // there seems to be a bug in dynamically loaded chunk styles are not loaded, workaround: extract all styles from all chunks }); base.plugins.push(p); From 6278236721283dbb66497ea390bbc43dddda1ca0 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 07:44:03 +0100 Subject: [PATCH 16/22] Prepare release 3.0.0 --- package.json | 4 ++-- requirements.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 32e610c..3e42e84 100644 --- a/package.json +++ b/package.json @@ -59,12 +59,12 @@ "iojs": ">= 3" }, "dependencies": { - "phovea_core": "github:phovea/phovea_core#develop" + "phovea_core": "^3.1.0" }, "name": "phovea_processing_queue", "description": "Process long-running tasks in the background using Celery.", "homepage": "https://phovea.caleydo.org", - "version": "2.2.1-SNAPSHOT", + "version": "3.0.0", "author": { "name": "The Caleydo Team", "email": "contact@caleydo.org", diff --git a/requirements.txt b/requirements.txt index 97d8c1c..89c544a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ --e git+https://github.com/phovea/phovea_data_redis.git@develop#egg=phovea_data_redis --e git+https://github.com/phovea/phovea_server.git@develop#egg=phovea_server -celery[redis,auth,msgpack]==4.0.1 \ No newline at end of file +phovea_data_redis>=4.0.0,<5.0.0 +phovea_server>=4.0.0,<5.0.0 +celery[redis,auth,msgpack]==4.0.1 From 696f208392a1d4b57415c81ea181b7fdff52720d Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 07:44:30 +0100 Subject: [PATCH 17/22] Remove .travis.yml and .gitlab-ci.yml --- .gitlab-ci.yml | 57 -------------------------------------------------- .travis.yml | 51 -------------------------------------------- 2 files changed, 108 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 .travis.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 39f5d9c..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,57 +0,0 @@ -image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python - -variables: - GIT_DEPTH: "1" - -cache: - key: "$CI_REPOSITORY_URL-$CI_COMMIT_REF_NAME" - paths: - - node_modules - - ~/venv - -before_script: - # Install ssh-agent if not already installed, it is required by Docker. - # (change apt-get to yum if you use a CentOS-based image) - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - # Run ssh-agent (inside the build environment) - - eval $(ssh-agent -s) - - # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - # For Docker builds disable host key checking. Be aware that by adding that - # you are suspectible to man-in-the-middle attacks. - # WARNING: Use this only with the Docker executor, if you use it with shell - # you will overwrite your user's SSH config. - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - -stages: - - install - - build - -install-npm-wee: - stage: install - script: - - npm install - -install-pip-wee: - stage: install - script: | - (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y)) - virtualenv ~/venv - . ~/venv/bin/activate - pip install --upgrade --upgrade-strategy=only-if-needed -r requirements_dev.txt - pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt - -dist: - stage: build - script: | - . ~/venv/bin/activate - npm run dist - allow_failure: false - artifacts: - expire_in: 1 week - paths: - - dist diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a838a76..0000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: python -sudo: required -env: -- TOXENV=py37 -node_js: -- 6 -addons: - firefox: 49.0.1 -before_install: -- export DISPLAY=:99.0 -- sh -e /etc/init.d/xvfb start -- nvm install 6 -- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi -install: -- "(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get - install -y))" -- pip install -r requirements_dev.txt -- pip install -r requirements.txt -- npm install -script: npm run dist -notifications: - slack: - secure: Bqus22Epmkq/NpI7dfQgY1jis/CAMCnFTaoDm6QdqJqeW4JQkotiK6qejSWlnWufXUAuQQ5ch8dDH6nO4H2JA4aBUxXSKm8uFZK/WdnHzv55WBgvGs1X/YIpcG6RsCrwUmlHr5IF6fexFiTvmokdlwihD1v6/Z+ZvCmnYkfWuilsQrCeykVfu2VoaBMIeWBcaID1WCIBB8vs79Oe59PvVQwk3gaGBKdmIw+19rUTZ5815YVlXWd6A9+RU0WF7532H07FNFq3JAhEbJXFIHHaPMc8WDmyOX6rSuSpGIqMGsswXGiirHiM+1A1SAXuqEzqcjY24PwTLrBAua5YF0vOguLfV8LV+gn68arOtJLhYkiBGbLuer9wtpnXW0wIPDnqtksebENLXXQoKGrwjXw5bx3F7dTJ3QcUFKj/MFvrl7pD7Nj4YE33LRRAtOc4FeQP8BXfTyooCmhyKj4zECNetz1qTUPiduX2tJ5hufpIXRVRM1kIoLIYSSodPcum/QvXwJRzjRdxZ2QepJ/WoeDJbhUs4dcbpsD2pgG7XGmatBALO1x1uShHWV8pHZJ311oJq7JKxqPoxZ3BIpyu+yAER7p2t/EwwlpBmtw6Pn4L7YNstapAagzKtUDrnUSXpN4w1briIZtUG/O9nua67jaU6moNKSUd3RtPpi+sdGH1eQo= - on_success: change - on_failure: always -deploy: -- provider: releases - api_key: - secure: kTHum1Q7HCOqWv8h97zVa0/9YauP3dz2QicgNwnpdRJF2Pf+BOrdCUCRQEMh3fJ9tnXo+safIDkBKeNefyzrrqyHax9W+77TCVHIYZowyVD2uUkv85//WzXftFBJ+FBZUbeZCeistyb58YYXQayUKm1bmeeAhpY36FKW1fMYyYmRNh9MI/TK3MVzHchtxV2vNMO6+LaQG8NmL4p+wThRKHadc76SePeLNoxRQHmQEgMVPgjS0dmeNhnOjkdPRCH7sFqxqzIK9iZ1QhVizVR0aCq62Wf8qg7p67N6bbVX2qfUME7JQ2RLVOBp2nl/AaLD95DKDy9yXly3ntz9ga6St76JZ+o/EvPKUTKk0XHzPNE2tbJCPo9zcn55hYXNmVcmSDIuEmMIPfZnK5kOgWhCsdpSza6G8M4u5Ra2JG2qNL+NzU6CEiNqB1CrNdbfaui/gBVIYcEWmAVXavCrt+GNaBGQChEzk3UymKzKSYitdwgmr58Vnqk6fvoPWP1tswW3zgaUacizxuxIpKm2o4imasYP2a4ChBJHU+d2cnkQL7aTZBU1UdQBKNp8KNE/BOcwohxUrzHpMO5jk9A/A/eClYNXEAecv9rOrHxFS2xD3P9KZH3h5GI2DRJuSbzg7fi4+BgZpi0iNwDDfyTCkhi6MfwgGkUfrmUyNf50WnQ0DQw= - file_glob: true - file: - - dist/phovea_processing_queue*.egg - - dist/phovea_processing_queue.tar.gz - on: - tags: true - repo: phovea/phovea_processing_queue -- provider: npm - email: samuel.gratzl@jku.at - api_key: - secure: mC34w6/ue076uW5OkawHoD1K1Bb0O1aU0mraJVF+gRzy4eSJ0d40xENIIU8ULlXWB/l7dntMI/J2VyedtgMl4PVeMWQ/ukLZ8oX1CS/ZdgywwvA/6AEd53psoA9JsDcQBhzc8a2RwHLwQv9k7gbi0jLiHncP4T1IgL37j9bZJDgF06d9qT32JiETYAnwzFvk5MpxhlYgc97EgCJaTyBmo3eHzZIRIaFS7xCXBTAW9S+VHIv0Od4mX6lb71h857/L8eOUnwe51tjbk1nKkyNJWRG3OYYbOtdKW+kaZYRI+oO4dDnIoX1l0Y8kUqctuYISVTv0CH4ur4+bWO1i/rUgTcJJGBcOv7C1NcUBDAsGZKn59N92aGpcK2C5TxYCt5qlrMyCpckD7lWLHmhA+ik0mWQhl98yLNz5JSOe+YlUFualj0yleMqdj/WnK5xQTVDO56PX2m/liGNCnNEw+/AoXTJol7S8Gq2TQ1eIj+9Jof590Ze51qgVRSjmUDTJZ/puEL6lLCA0/vgJxaWr4S72ulXN0idQMXRtDyWs+dVGELdOAHzCw382gLfCIdmWWClHzR+nuvWGazf5/Ra8mKmb3y+vwPmzr9pcR9/6a8N0H0KzQ0gvDfm2mwV1yjFkD1jnchJZ2Jaex2JsDL29aAzLQwLIJZ+VVG1cTtSLgCS3aeg= - on: - tags: true - repo: phovea/phovea_processing_queue -- provider: pypi - user: caleydo-bot - password: - secure: qSQAVD+hJih0IKHc1dhMXL0gPJqvIC+/MCNYIjQiVk/MBZwy+ZjetN28RxMn0hsG/q8RrS7xAoeVBbRLImN+pcU90sKliYK2SP5/qon1+2WtFC3fD7Q+tqQrm4+h43egr4imQwjlLwDoZjzVUXMKoiVaCrayw1uq145iwnlDo0+B8Jz/GHRxaZwE734dFi7pxUJxQvk6RIHbG+4XnH1eUd2EN91ilNqdVyMgf7w6CcnIHFyS/YHckPmKBa39KCLimhYXHJZV8cVzBEgzTy6pJeVQVLKu7iCIMCD1xiR+LF7Na6tVMPlu4iJlnQxn96dpHplwOT5C0KJVAecPvsBB1BbaV6NezUjwSjuw0Mnj+2KZbG/MG3iWfc9ghz5CyLzJtFo7XjFrob27RP8ArWRD2QXR05EN/o7bnUwHYj6YxUoLIf5ttQD18hyeaGQFrW24LFhOqI3uXWin6uJ9/h7+WgtHRlKoxgrgYuna/ZxFHVJl1bcpbkqGjdWknI6BYOIJPog9iaLEMYq+D+Slc7oOVpnG5OJVvRh9pliqLyBWZ9ABbmW7E//v1O+JE4wYd+k783Uz+UbPjV2OZiw74mp+nbnsvVT+lJs/yR5PsdZGvRmY+xlwpKCThwnWb7aG51PKQqColY2WK/9pbzm/XaqFw79kUcdx3JW6J01GT7r2n+M= - on: - tags: true - distributions: sdist bdist_wheel - repo: phovea/phovea_processing_queue From fb88d143928288e3c73880e865591ffaf55b7564 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 13:39:53 +0100 Subject: [PATCH 18/22] update celery version cannot be higher due to compatiblity issues with currently used redis version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 89c544a..46a8d78 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ phovea_data_redis>=4.0.0,<5.0.0 phovea_server>=4.0.0,<5.0.0 -celery[redis,auth,msgpack]==4.0.1 +celery[redis,auth,msgpack]==4.2.2 From c18ee1dc8e6883c2f83fbeabb5c55fb9a4735170 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 13:40:56 +0100 Subject: [PATCH 19/22] fix flake8 --- phovea_processing_queue/server.py | 1 + phovea_processing_queue/task_definition.py | 4 ++-- phovea_processing_queue/tasks.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phovea_processing_queue/server.py b/phovea_processing_queue/server.py index 0687a29..91d664d 100644 --- a/phovea_processing_queue/server.py +++ b/phovea_processing_queue/server.py @@ -2,6 +2,7 @@ __author__ = 'Samuel Gratzl' + def run(args): """ starts celery internally diff --git a/phovea_processing_queue/task_definition.py b/phovea_processing_queue/task_definition.py index 5eef3f3..793b93e 100644 --- a/phovea_processing_queue/task_definition.py +++ b/phovea_processing_queue/task_definition.py @@ -147,7 +147,7 @@ def __call__(self, *args, **kwargs): task = functools.partial(app.task, base=BaseTask) # use common name -getLogger = get_task_logger +get_logger = get_task_logger def get_result(task_id): @@ -160,4 +160,4 @@ def get_result(task_id): # just expose the needed stuff -__all__ = ['task', 'app', 'BaseTask', 'notifier', 'getLogger', 'get_result'] +__all__ = ['task', 'app', 'BaseTask', 'notifier', 'get_logger', 'get_result'] diff --git a/phovea_processing_queue/tasks.py b/phovea_processing_queue/tasks.py index 3f2926c..a5e941b 100644 --- a/phovea_processing_queue/tasks.py +++ b/phovea_processing_queue/tasks.py @@ -1,8 +1,8 @@ -from phovea_processing_queue.task_definition import task, getLogger +from phovea_processing_queue.task_definition import task, get_logger -_log = getLogger(__name__) +_log = get_logger(__name__) @task From c1e9af8312261f547af1a6c7111861037fbec959 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 13:41:27 +0100 Subject: [PATCH 20/22] update doc file --- docs/phovea_processing_queue.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/phovea_processing_queue.rst b/docs/phovea_processing_queue.rst index 53ddf73..02e22fa 100644 --- a/docs/phovea_processing_queue.rst +++ b/docs/phovea_processing_queue.rst @@ -1,43 +1,43 @@ -phovea_processing_queue package -=============================== +phovea\_processing\_queue package +================================= Submodules ---------- -phovea_processing_queue.processing module ------------------------------------------ +phovea\_processing\_queue.processing module +------------------------------------------- .. automodule:: phovea_processing_queue.processing :members: :undoc-members: :show-inheritance: -phovea_processing_queue.security module ---------------------------------------- +phovea\_processing\_queue.security module +----------------------------------------- .. automodule:: phovea_processing_queue.security :members: :undoc-members: :show-inheritance: -phovea_processing_queue.server module -------------------------------------- +phovea\_processing\_queue.server module +--------------------------------------- .. automodule:: phovea_processing_queue.server :members: :undoc-members: :show-inheritance: -phovea_processing_queue.task_definition module ----------------------------------------------- +phovea\_processing\_queue.task\_definition module +------------------------------------------------- .. automodule:: phovea_processing_queue.task_definition :members: :undoc-members: :show-inheritance: -phovea_processing_queue.tasks module ------------------------------------- +phovea\_processing\_queue.tasks module +-------------------------------------- .. automodule:: phovea_processing_queue.tasks :members: From 1d104f98d58bcd08ce309d1e485150a2e9eac9f7 Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 13:58:34 +0100 Subject: [PATCH 21/22] update tslint and webpack config --- tslint.json | 42 +++++++++++++++++++++++++++--------------- webpack.config.js | 2 +- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/tslint.json b/tslint.json index 434c5eb..ec45867 100644 --- a/tslint.json +++ b/tslint.json @@ -23,6 +23,7 @@ "forin": true, "indent": [ true, + "spaces", 2 ], "interface-name": true, @@ -31,9 +32,25 @@ "max-line-length": false, "member-ordering": [ false, - "public-before-private", - "static-before-instance", - "variables-before-functions" + { + "order": [ + "public-static-field", + "public-static-method", + "public-instance-field", + "public-constructor", + "public-instance-method", + "protected-static-field", + "protected-static-method", + "protected-instance-field", + "protected-constructor", + "protected-instance-method", + "private-static-field", + "private-static-method", + "private-instance-field", + "private-constructor", + "private-instance-method" + ] + } ], "new-parens": true, "no-arg": true, @@ -96,18 +113,13 @@ ], "typedef-whitespace": [ true, - [ - "callSignature", - "noSpace" - ], - [ - "catchClause", - "noSpace" - ], - [ - "indexSignature", - "space" - ] + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } ], "use-isnan": true, "variable-name": [ diff --git a/webpack.config.js b/webpack.config.js index 95542e3..b4e63ac 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -74,7 +74,7 @@ const webpackloaders = [ }, {test: /\.json$/, use: 'json-loader'}, { - test: /\.(png|jpg)$/, + test: /\.(png|jpg|gif|webp)$/, loader: 'url-loader', options: { limit: 10000 // inline <= 10kb From e9cc008262c2f59cfe7dbbc90ac74ed630d514af Mon Sep 17 00:00:00 2001 From: dvvanessastoiber Date: Mon, 13 Jan 2020 14:03:46 +0100 Subject: [PATCH 22/22] update npm scripts --- package.json | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 3e42e84..5e981c8 100644 --- a/package.json +++ b/package.json @@ -1,43 +1,42 @@ { "scripts": { "start": "webpack-dev-server --inline", + "predocker": "npm run build", + "docker": "docker build -t phovea_processing_queue -f deploy/Dockerfile .", + "docker:dev": "docker build -t phovea_processing_queue -f deploy/Dockerfile_dev .", "check": "flake8 --exclude=.git,venv,deploy,docs,__pycache__,node_modules", "pretest": "echo hybrid", "test": "npm run test:web && npm run test:python", + "docs": "npm run docs:web && npm run docs:python", + "prebuild": "echo hybrid", + "build": "npm run build:web && npm run build:python", "predist": "echo hybrid", "dist": "npm run dist:web && npm run dist:python", "compile": "tsc", "lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'", - "docs": "npm run docs:web && npm run docs:python", - "prebuild": "echo hybrid", "posttest": "echo hybrid", "test:watch": "karma start --autoWatch=true --singleRun=false", "build:dev": "webpack", - "build": "npm run build:web && npm run build:python", "start:hot": "webpack-dev-server --inline --hot", "watch": "webpack --watch", "release:major": "npm version major && npm publish && git push --follow-tags", "release:minor": "npm version minor && npm publish && git push --follow-tags", "release:patch": "npm version patch && npm publish && git push --follow-tags", - "test:web": "test ! $(find tests -name \"*.ts\") || karma start", - "test:python": "test ! $(find tests -name \"*.py\") || python setup.py test", - "dist:web": "mkdirp dist && cd build && tar cvzf ../dist/phovea_processing_queue.tar.gz *", - "dist:python": "python setup.py sdist bdist_wheel", + "docs:web": "typedoc --options typedoc.json src/**.ts", + "docs:python": "sphinx-apidoc -o docs -f ./phovea_processing_queue && sphinx-build ./docs build/docs", "pretest:web": "npm run compile", "pretest:python": "npm run check", "posttest:web": "npm run lint", - "predist:web": "npm run build:web && npm run docs:web", - "predocker": "npm run build", - "docker": "docker build -t phovea_processing_queue -f deploy/Dockerfile .", - "docker:dev": "docker build -t phovea_processing_queue -f deploy/Dockerfile_dev .", - "prepublish": "npm run build", - "docs:web": "typedoc --options typedoc.json src/**.ts", - "docs:python": "sphinx-apidoc -o docs -f ./phovea_processing_queue && sphinx-build ./docs build/docs", - "build:python": "rm -rf build/source && find . -name '*.pyc' -delete && node buildPython.js && cp -r ./phovea_processing_queue build/source/", - "build:web": "webpack --env prod", + "test:web": "test ! $(find tests -name \"*.ts\") || karma start", + "test:python": "test ! $(find tests -name \"*.py\") || python setup.py test", "prebuild:python": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test:python", "prebuild:web": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test:web", - "predist:python": "npm run build:python && npm run docs:python" + "build:python": "rm -rf build/source && find . -name '*.pyc' -delete && node buildPython.js && cp -r ./phovea_processing_queue build/source/", + "build:web": "webpack --env prod", + "predist:web": "npm run build:web && npm run docs:web", + "predist:python": "npm run build:python && npm run docs:python", + "dist:web": "mkdirp dist && cd build && tar cvzf ../dist/phovea_processing_queue.tar.gz *", + "dist:python": "python setup.py sdist bdist_wheel" }, "files": [ "src",