Skip to content

Commit

Permalink
Merge branch 'master' into py3638build
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine authored Mar 22, 2021
2 parents eac43b0 + d0573b9 commit 8d47ce0
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 55 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@ rust/perspective-vieux/pkg

rust/perspective-vieux/target
rust/perspective-vieux/target2
.emsdk
37 changes: 16 additions & 21 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ pr:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string

schedules:
- cron: "0 0 * * 6"
displayName: Daily midnight build
branches:
include:
- master
always: true

variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
Expand Down Expand Up @@ -72,7 +79,7 @@ jobs:
manylinux_flag: '--manylinux2010'
artifact_name: 'cp37-cp37m-manylinux2010_x86_64'

${{ if startsWith(variables['build.sourceBranch'], 'refs/tags/v') }}:
${{ if or(startsWith(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Schedule')) }}:
Python36ManyLinux2010:
python.version: '3.6'
python_flag: '--python36'
Expand Down Expand Up @@ -124,7 +131,7 @@ jobs:
displayName: "Install Yarn"

- bash: yarn
displayName: 'Install Deps'
displayName: 'Install JS Deps'

- bash: python -m pip install -U "black==20.8b1" flake8-black pip
condition: and(succeeded(), ne(variables['python.version'], '2.7'))
Expand Down Expand Up @@ -174,7 +181,7 @@ jobs:
Python37:
python.version: '3.7'
python_flag: ''
${{ if startsWith(variables['build.sourceBranch'], 'refs/tags/v') }}:
${{ if or(startsWith(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Schedule')) }}:
Python36:
python.version: '3.6'
python_flag: '--python36'
Expand Down Expand Up @@ -211,25 +218,13 @@ jobs:
displayName: "Install Yarn"

- script: yarn
displayName: 'Install Deps'
displayName: 'Install JS Deps'

- script: choco install flatc
displayName: "Install Flatbuffers"
- script: choco install boost-msvc-14.1 flatc
displayName: "System deps"

- script: yarn build_python --ci $(python_flag)
displayName: 'build'
env:
# Set `BOOST_ROOT` manually, as `BOOST_ROOT` is removed in the VM:
# https://github.com/actions/virtual-environments/issues/687
#
# 06/18/2020 - seems like boost got moved to `x86_64` inside
# the boost folder, which broke builds for a bit.
#
# 11/24/2020 - boost 1.69 was removed, so update to 1.72:
# https://github.com/actions/virtual-environments/issues/1847
BOOST_ROOT: "C:/hostedtoolcache/windows/Boost/1.72.0/x86_64/"
BOOST_INCLUDEDIR: "C:/hostedtoolcache/windows/Boost/1.72.0/x86_64/include"
BOOST_LIBRARYDIR: "C:/hostedtoolcache/windows/Boost/1.72.0/x86_64/libs"

- job: 'MacOS_Catalina'
pool:
Expand All @@ -247,7 +242,7 @@ jobs:
python_flag: '--python39'
artifact_name: 'cp39-cp39-macosx_10_15_x86_64'

${{ if startsWith(variables['build.sourceBranch'], 'refs/tags/v') }}:
${{ if or(startsWith(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Schedule')) }}:
Python36:
python.version: '3.6'
python_flag: '--python36'
Expand Down Expand Up @@ -280,14 +275,14 @@ jobs:
- script: |
python -m pip install -U delocate wheel numpy "pyarrow>=2" pip
displayName: "Python 3 deps"
displayName: "Python deps"
condition: eq(variables['python_flag'], '')
- script: npm install -g yarn
displayName: "Install Yarn"

- script: yarn --network-timeout 600000
displayName: 'Install Deps'
displayName: 'Install JS Deps'

- script: yarn build_python --ci $(python_flag)
displayName: 'build'
Expand Down
18 changes: 3 additions & 15 deletions binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,9 @@ python3 -m pip install -U perspective-python

export NODE_OPTIONS=--max-old-space-size=32768

EXTENSIONS="
@jupyter-widgets/[email protected]
@finos/perspective-jupyterlab
@jupyter-voila/[email protected]
"
EXTENSIONS="@jupyter-widgets/jupyterlab-manager @finos/perspective-jupyterlab"


until jupyter labextension install $EXTENSIONS --no-build
do
echo "Extension failed to install"
done

until jupyter lab build --dev-build=False --minimize=False
do
echo "Extension failed to install"
done

jupyter labextension install $EXTENSIONS --no-build
jupyter lab build --dev-build=False --minimize=False
jupyter serverextension enable --py jupyterlab
5 changes: 2 additions & 3 deletions binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ipywidgets==7.5.1
jupyterlab==2.2.8
jupyterlab==3.0.9
pandas==0.25.3
pyarrow==2.0.0
voila==0.2.3
pyarrow==3.0.0
4 changes: 2 additions & 2 deletions cpp/perspective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"dist/cjs/**/*"
],
"scripts": {
"build": "yarn emsdk-run node ./build.js",
"build": "node ../../scripts/run_emsdk.js node ./build.js",
"clean": "rimraf dist/cpp/build",
"test": ":",
"test:run": ":",
"test:build": ":"
}
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"cssnano": "^4.1.10",
"cssnano-preset-lite": "^1.0.1",
"dotenv": "^8.1.0",
"emsdk-npm": "https://github.com/texodus/emsdk-npm.git#bash-sub-fix",
"eslint": "^6.6.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-markdown": "^1.0.2",
Expand Down
6 changes: 4 additions & 2 deletions packages/perspective-viewer-d3fc/src/less/chart.less
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,13 @@
}

& .y-label-container .splitter-label::after {
content: "\1f847";
font-family: var(--d3fc-y1-label--font-family, inherit);
content: var(--d3fc-y1-label--content, "\1f847");
}

& .y2-label-container .splitter-label::after {
content: "\1f845";
font-family: var(--d3fc-y2-label--font-family, inherit);
content: var(--d3fc-y2-label--content, "\1f845");
}

&.d3_y_bar .y-axis path,
Expand Down
6 changes: 6 additions & 0 deletions packages/perspective-viewer/src/themes/material.less
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@ perspective-viewer, .perspective-viewer-material {
--top-panel-row--display: inline-flex;

--d3fc-treedata-axis--lines: none;

--d3fc-y1-label--font-family: "Material Icons";
--d3fc-y1-label--content: "arrow_upward";

--d3fc-y2-label--font-family: "Material Icons";
--d3fc-y2-label--content: "arrow_downward";
}
12 changes: 11 additions & 1 deletion packages/perspective/test/js/timezone/timezone.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@ const check_datetime = (output, expected) => {
describe("Timezone Tests", () => {
beforeAll(() => {
expect(process.env.TZ).toBe("America/New_York");
expect(new Date().getTimezoneOffset()).toBe(300);
const now = new Date();

// offset is 240 during DST and 300 during non-DST, since we manually
// set the timezone here just assert the timezone string

if (now.toString().includes("GMT-0400") || now.toString().includes("Eastern Daylight Time")) {
expect(new Date().getTimezoneOffset()).toBe(240);
} else {
expect(new Date().getTimezoneOffset()).toBe(300);
}

console.log("Timezone set to", process.env.TZ);
});

Expand Down
34 changes: 28 additions & 6 deletions scripts/install_emsdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,45 @@

require("dotenv").config({path: "./.perspectiverc"});

const {execute, execute_throw} = require("./script_utils.js");
const {execute_throw} = require("./script_utils.js");
const {emscripten} = require("../package.json");
const path = require("path");
const os = require("os");
const fs = require("fs");

function base() {
return path.join(__dirname, "..", ".emsdk");
}

function emsdk_checkout() {
function git(args) {
execute_throw`git ${args.join(" ")}`;
}

git(["clone", "https://github.com/emscripten-core/emsdk.git", base()]);
}

function emsdk(...args) {
const basedir = base();
const suffix = os.type() == "Windows_NT" ? ".bat" : "";
const emsdk = path.join(basedir, "emsdk" + suffix);
execute_throw`${emsdk} ${args.join(" ")}`;
}

function upgrade() {
console.log(`-- Emscripten not found, installing ${emscripten}`);
execute`yarn emsdk-checkout`;
execute`yarn emsdk install ${emscripten}`;
execute`yarn emsdk activate ${emscripten}`;
emsdk_checkout();
emsdk("install", emscripten);
emsdk("activate", emscripten);
console.log(`-- Emscripten ${emscripten} installed`);
}

function check() {
try {
execute_throw`yarn emsdk-run command -v emcc`;
execute_throw`emcc --version`;
return true;
} catch (e) {
return false;
return fs.existsSync(path.join(__dirname, "..", ".emsdk"));
}
}

Expand Down
21 changes: 21 additions & 0 deletions scripts/run_emsdk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/

const {execute_throw} = require("./script_utils.js");
const path = require("path");

try {
const cwd = process.cwd();
const cmd = process.argv.slice(2).join(" ");
const emsdkdir = path.join(__dirname, "..", ".emsdk");
execute_throw`cd ${emsdkdir} && . ./emsdk_env.sh && cd ${cwd} && ${cmd}`;
} catch (e) {
console.log(e.message);
process.exit(1);
}
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7105,10 +7105,6 @@ emojis-list@^3.0.0:
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==

"emsdk-npm@https://github.com/texodus/emsdk-npm.git#bash-sub-fix":
version "0.2.2"
resolved "https://github.com/texodus/emsdk-npm.git#19ecbaa3fb2572bd00a87173273815cf5e382fef"

encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
Expand Down

0 comments on commit 8d47ce0

Please sign in to comment.