From afa2ae8bdfd5c611fb8b8d0a7f3b85164b9be344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 1 Oct 2020 20:51:11 -0400 Subject: [PATCH 01/24] dcg template experiment for table --- .dcg.config.yaml | 57 +++++++ .dcg/R/dashDataTable.R | 70 ++++++++ .dcg/R/df_to_list.R | 8 + .dcg/R/df_to_list.Rd | 43 +++++ .dcg/R/pkg_help_description.txt | 7 + .dcg/py/Format.py | 287 ++++++++++++++++++++++++++++++++ .dcg/py/FormatTemplate.py | 19 +++ 7 files changed, 491 insertions(+) create mode 100644 .dcg.config.yaml create mode 100644 .dcg/R/dashDataTable.R create mode 100644 .dcg/R/df_to_list.R create mode 100644 .dcg/R/df_to_list.Rd create mode 100644 .dcg/R/pkg_help_description.txt create mode 100644 .dcg/py/Format.py create mode 100644 .dcg/py/FormatTemplate.py diff --git a/.dcg.config.yaml b/.dcg.config.yaml new file mode 100644 index 000000000..5d39ce0cf --- /dev/null +++ b/.dcg.config.yaml @@ -0,0 +1,57 @@ +path: . +componentPaths: + - src/dash-table/dash/DataTable.js + +dist: + - source: dash_table/bundle.js + target: bundle.js + external: true + - source: dash_table/bundle.js.map + target: bundle.js.map + dynamic: true + external: true + - source: dash_table/async-export.js + target: async-export.js + async: true + external: true + - source: dash_table/async-export.js.map + target: async-export.js.map + async: true + external: true + - source: dash_table/async-highlight.js + target: async-highlight.js + async: true + external: true + - source: dash_table/async-highlight.js.map + target: async-highlight.js.map + async: true + external: true + - source: dash_table/async-table.js + target: async-table.js + async: true + external: true + - source: dash_table/async-table.js.map + target: async-table.js.map + async: true + external: true + +vars: + py: + dist: + - source: Format.py + target: Format.py + - source: FormatTemplate.py + target: FormatTemplate.py + + R: + pkg_help_description: ${js.core.readFile('pkg_help_description.txt')} + prefix: dash + examples: + dashDataTable: + dontrun: FALSE + code: ${js.core.readFile('dashDataTable.R')} + dist: + - source: df_to_list.Rd + target: man/df_to_list.Rd + - source: df_to_list.R + target: R/df_to_list.R \ No newline at end of file diff --git a/.dcg/R/dashDataTable.R b/.dcg/R/dashDataTable.R new file mode 100644 index 000000000..4c288f18b --- /dev/null +++ b/.dcg/R/dashDataTable.R @@ -0,0 +1,70 @@ +# For comprehensive documentation of this package's features, +# please consult https://dashr.plot.ly/datatable +# +# A package vignette is currently in development and will +# provide many of the same examples currently available online +# in an offline-friendly format. + +# The following if statement is not required to run this +# example locally, but was added at the request of CRAN +# maintainers. +if (interactive() && require(dash)) { + library(dash) + library(dashTable) + + app <- Dash$new() + + # We can easily restrict the number of rows to display at + # once by using style_table: + app$layout( + dashDataTable( + id = "table", + columns = lapply(colnames(iris), + function(colName){ + list( + id = colName, + name = colName + ) + }), + style_table = list( + maxHeight = "250px", + overflowY = "scroll" + ), + data = df_to_list(iris) + ) + ) + + app$run_server() + + app <- Dash$new() + + # We can also make rows and columns selectable/deletable + # by setting a few additional attributes: + app$layout( + dashDataTable( + id = "table", + columns = lapply(colnames(iris), + function(colName){ + list( + id = colName, + name = colName, + deletable = TRUE + ) + }), + style_table = list( + maxHeight = "250px", + overflowY = "scroll" + ), + data = df_to_list(iris), + editable = TRUE, + filter_action = "native", + sort_action = "native", + sort_mode = "multi", + column_selectable = "single", + row_selectable = "multi", + row_deletable = TRUE + ) + ) + + app$run_server() +} \ No newline at end of file diff --git a/.dcg/R/df_to_list.R b/.dcg/R/df_to_list.R new file mode 100644 index 000000000..ac4de8ae7 --- /dev/null +++ b/.dcg/R/df_to_list.R @@ -0,0 +1,8 @@ +df_to_list <- function(df) { + if(!(is.data.frame(df))) + stop("df_to_list requires a data.frame object; please verify that df is of the correct type.") + stats::setNames(lapply(split(df, seq(nrow(df))), + FUN = function (x) { + as.list(x) + }), NULL) +} diff --git a/.dcg/R/df_to_list.Rd b/.dcg/R/df_to_list.Rd new file mode 100644 index 000000000..782bf6524 --- /dev/null +++ b/.dcg/R/df_to_list.Rd @@ -0,0 +1,43 @@ +% Auto-generated: do not edit by hand +\name{df_to_list} + +\alias{df_to_list} + +\title{Convert data.frame objects to list-of-lists format} + +\description{ +Convert a \code{\link{data.frame}} to a list of lists for compatibility with \code{\link{dashDataTable}}. The function will return a nested list object in which the sublists contain named elements of varying type; the names correspond to the column names in the original \code{\link{data.frame}}. +} + +\usage{ +df_to_list(df) +} + +\arguments{ +\item{df}{A \code{data.frame} object, which will be transformed into a list of lists. Each row will become a single named list, in which the elements are named as the columns from which they were extracted.} +} + +\value{ +a \code{list} object, in which the sublists are named elements of varying type; the names correspond to the column names in the \code{data.frame} specified by \code{df}. +} + +\examples{ +# first, create data frame +df <- read.csv(url( + 'https://raw.githubusercontent.com/plotly/datasets/master/solar.csv' + ), + check.names=FALSE, + stringsAsFactors=FALSE +) + +# then convert to list-of-lists format for use in dashTable +# the following snippet below will print as JSON +# see the help for dashDataTable to see an actual app example +dashDataTable( + id = 'table', + columns = lapply(colnames(df), function(x) { + list(name = x, id = x) + }), + data = df_to_list(df) +) +} diff --git a/.dcg/R/pkg_help_description.txt b/.dcg/R/pkg_help_description.txt new file mode 100644 index 000000000..02bc1198b --- /dev/null +++ b/.dcg/R/pkg_help_description.txt @@ -0,0 +1,7 @@ +An interactive table component designed for editing and exploring +large datasets, 'dashDataTable' is rendered with standard, semantic HTML + markup, which makes it accessible, responsive, and easy +to style. This component was written from scratch in 'React.js' +specifically for the 'Dash' community. Its API was designed to be +ergonomic and its behaviour is completely customizable through its +properties. \ No newline at end of file diff --git a/.dcg/py/Format.py b/.dcg/py/Format.py new file mode 100644 index 000000000..8dd12638c --- /dev/null +++ b/.dcg/py/Format.py @@ -0,0 +1,287 @@ +import collections + + +def get_named_tuple(name, dict): + return collections.namedtuple(name, dict.keys())(*dict.values()) + + +Align = get_named_tuple( + "align", + {"default": "", "left": "<", "right": ">", "center": "^", "right_sign": "="}, +) + +Group = get_named_tuple("group", {"no": "", "yes": ","}) + +Padding = get_named_tuple("padding", {"no": "", "yes": "0"}) + +Prefix = get_named_tuple( + "prefix", + { + "yocto": 10 ** -24, + "zepto": 10 ** -21, + "atto": 10 ** -18, + "femto": 10 ** -15, + "pico": 10 ** -12, + "nano": 10 ** -9, + "micro": 10 ** -6, + "milli": 10 ** -3, + "none": None, + "kilo": 10 ** 3, + "mega": 10 ** 6, + "giga": 10 ** 9, + "tera": 10 ** 12, + "peta": 10 ** 15, + "exa": 10 ** 18, + "zetta": 10 ** 21, + "yotta": 10 ** 24, + }, +) + +Scheme = get_named_tuple( + "scheme", + { + "default": "", + "decimal": "r", + "decimal_integer": "d", + "decimal_or_exponent": "g", + "decimal_si_prefix": "s", + "exponent": "e", + "fixed": "f", + "percentage": "%", + "percentage_rounded": "p", + "binary": "b", + "octal": "o", + "lower_case_hex": "x", + "upper_case_hex": "X", + "unicode": "c", + }, +) + +Sign = get_named_tuple( + "sign", + {"default": "", "negative": "-", "positive": "+", "parantheses": "(", "space": " "}, +) + +Symbol = get_named_tuple( + "symbol", {"no": "", "yes": "$", "binary": "#b", "octal": "#o", "hex": "#x"} +) + +Trim = get_named_tuple("trim", {"no": "", "yes": "~"}) + + +class Format: + def __init__(self, **kwargs): + self._locale = {} + self._nully = "" + self._prefix = Prefix.none + self._specifier = { + "align": Align.default, + "fill": "", + "group": Group.no, + "width": "", + "padding": Padding.no, + "precision": "", + "sign": Sign.default, + "symbol": Symbol.no, + "trim": Trim.no, + "type": Scheme.default, + } + + valid_methods = [ + m for m in dir(self.__class__) if m[0] != "_" and m != "to_plotly_json" + ] + + for kw, val in kwargs.items(): + if kw not in valid_methods: + raise TypeError( + "{0} is not a format method. Expected one of".format(kw), + str(list(valid_methods)), + ) + + getattr(self, kw)(val) + + def _validate_char(self, value): + self._validate_string(value) + + if len(value) != 1: + raise ValueError("expected value to a string of length one") + + def _validate_non_negative_integer_or_none(self, value): + if value is None: + return + + if not isinstance(value, int): + raise TypeError("expected value to be an integer") + + if value < 0: + raise ValueError("expected value to be non-negative", str(value)) + + def _validate_named(self, value, named_values): + if value not in named_values: + raise TypeError("expected value to be one of", str(list(named_values))) + + def _validate_string(self, value): + if not isinstance(value, (str, u"".__class__)): + raise TypeError("expected value to be a string") + + # Specifier + def align(self, value): + self._validate_named(value, Align) + + self._specifier["align"] = value + return self + + def fill(self, value): + self._validate_char(value) + + self._specifier["fill"] = value + return self + + def group(self, value): + if isinstance(value, bool): + value = Group.yes if value else Group.no + + self._validate_named(value, Group) + + self._specifier["group"] = value + return self + + def padding(self, value): + if isinstance(value, bool): + value = Padding.yes if value else Padding.no + + self._validate_named(value, Padding) + + self._specifier["padding"] = value + return self + + def padding_width(self, value): + self._validate_non_negative_integer_or_none(value) + + self._specifier["width"] = value if value is not None else "" + return self + + def precision(self, value): + self._validate_non_negative_integer_or_none(value) + + self._specifier["precision"] = ".{0}".format(value) if value is not None else "" + return self + + def scheme(self, value): + self._validate_named(value, Scheme) + + self._specifier["type"] = value + return self + + def sign(self, value): + self._validate_named(value, Sign) + + self._specifier["sign"] = value + return self + + def symbol(self, value): + self._validate_named(value, Symbol) + + self._specifier["symbol"] = value + return self + + def trim(self, value): + if isinstance(value, bool): + value = Trim.yes if value else Trim.no + + self._validate_named(value, Trim) + + self._specifier["trim"] = value + return self + + # Locale + def symbol_prefix(self, value): + self._validate_string(value) + + if "symbol" not in self._locale: + self._locale["symbol"] = [value, ""] + else: + self._locale["symbol"][0] = value + + return self + + def symbol_suffix(self, value): + self._validate_string(value) + + if "symbol" not in self._locale: + self._locale["symbol"] = ["", value] + else: + self._locale["symbol"][1] = value + + return self + + def decimal_delimiter(self, value): + self._validate_char(value) + + self._locale["decimal"] = value + return self + + def group_delimiter(self, value): + self._validate_char(value) + + self._locale["group"] = value + return self + + def groups(self, groups): + groups = ( + groups + if isinstance(groups, list) + else [groups] + if isinstance(groups, int) + else None + ) + + if not isinstance(groups, list): + raise TypeError("expected groups to be an integer or a list of integers") + if len(groups) == 0: + raise ValueError( + "expected groups to be an integer or a list of " "one or more integers" + ) + + for group in groups: + if not isinstance(group, int): + raise TypeError("expected entry to be an integer") + + if group <= 0: + raise ValueError("expected entry to be a non-negative integer") + + self._locale["grouping"] = groups + return self + + # Nully + def nully(self, value): + self._nully = value + return self + + # Prefix + def si_prefix(self, value): + self._validate_named(value, Prefix) + + self._prefix = value + return self + + def to_plotly_json(self): + f = {} + f["locale"] = self._locale.copy() + f["nully"] = self._nully + f["prefix"] = self._prefix + aligned = self._specifier["align"] != Align.default + f["specifier"] = "{}{}{}{}{}{}{}{}{}{}".format( + self._specifier["fill"] if aligned else "", + self._specifier["align"], + self._specifier["sign"], + self._specifier["symbol"], + self._specifier["padding"], + self._specifier["width"], + self._specifier["group"], + self._specifier["precision"], + self._specifier["trim"], + self._specifier["type"], + ) + + return f diff --git a/.dcg/py/FormatTemplate.py b/.dcg/py/FormatTemplate.py new file mode 100644 index 000000000..9c2688ca8 --- /dev/null +++ b/.dcg/py/FormatTemplate.py @@ -0,0 +1,19 @@ +from .Format import Format, Group, Scheme, Sign, Symbol + + +def money(decimals, sign=Sign.default): + return Format( + group=Group.yes, + precision=decimals, + scheme=Scheme.fixed, + sign=sign, + symbol=Symbol.yes, + ) + + +def percentage(decimals, rounded=False): + if not isinstance(rounded, bool): + raise TypeError("expected rounded to be a boolean") + + rounded = Scheme.percentage_rounded if rounded else Scheme.percentage + return Format(scheme=rounded, precision=decimals) From c8d0453dacfcc9fccb603305ae8d897683991075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 1 Oct 2020 21:15:19 -0400 Subject: [PATCH 02/24] define used recipes + don't validate .dcg --- .dcg.config.yaml | 4 ++++ package.json | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.dcg.config.yaml b/.dcg.config.yaml index 5d39ce0cf..150a6f31d 100644 --- a/.dcg.config.yaml +++ b/.dcg.config.yaml @@ -2,6 +2,10 @@ path: . componentPaths: - src/dash-table/dash/DataTable.js +recipes: + - py + - R + dist: - source: dash_table/bundle.js target: bundle.js diff --git a/package.json b/package.json index bab3cfb20..8793e56d6 100644 --- a/package.json +++ b/package.json @@ -24,11 +24,11 @@ "private::build:backends": "dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json && cp dash_table_base/** dash_table/ && dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json --r-prefix 'dash' --r-suggests 'dash' --jl-prefix 'dash'", "private::format.ts": "npm run private::lint.ts -- --fix", "private::format.prettier": "prettier --config .prettierrc --write \"src/**/*.{js,ts,tsx}\"", - "private::format.black": "black --exclude dash_table .", + "private::format.black": "black --exclude dash_table .dcg .", "private::host_js": "http-server ./dash_table -c-1 --silent", "private::lint.ts": "tslint --project tsconfig.json --config tslint.json", - "private::lint.flake": "flake8 --exclude=dash_table,node_modules,venv", - "private::lint.black": "black --check --exclude dash_table .", + "private::lint.flake": "flake8 --exclude=dash_table,node_modules,venv,.dcg", + "private::lint.black": "black --check --exclude dash_table .dcg .", "private::lint.prettier": "prettier --config .prettierrc \"src/**/*.{js,ts,tsx}\" --list-different", "private::wait_js": "wait-on http://localhost:8080", "private::opentests": "cypress open", From 598d4cdf2a2ae6050a267a43a8bba9b03252c938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 1 Oct 2020 22:24:00 -0400 Subject: [PATCH 03/24] pkg_help_title --- .dcg.config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.dcg.config.yaml b/.dcg.config.yaml index 150a6f31d..9486a6e88 100644 --- a/.dcg.config.yaml +++ b/.dcg.config.yaml @@ -49,6 +49,7 @@ vars: R: pkg_help_description: ${js.core.readFile('pkg_help_description.txt')} + pkg_help_title: Core Interactive Table Component for 'Dash' prefix: dash examples: dashDataTable: From 983a51399971fce6c022c46534c6b3e8104ffe3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 2 Oct 2020 15:27:45 -0400 Subject: [PATCH 04/24] - depends/imports/suggests - pkg_* - simplified example usage --- .dcg.config.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.dcg.config.yaml b/.dcg.config.yaml index 9486a6e88..3717f994b 100644 --- a/.dcg.config.yaml +++ b/.dcg.config.yaml @@ -48,13 +48,20 @@ vars: target: FormatTemplate.py R: - pkg_help_description: ${js.core.readFile('pkg_help_description.txt')} - pkg_help_title: Core Interactive Table Component for 'Dash' prefix: dash + depends: + imports: + suggests: + - dash + + pkg_authors: c(person("Chris", "Parmer", email = "chris@plotly.com", role = c("aut")), person("Ryan Patrick", "Kyle", email = "ryan@plotly.com", role = c("cre"), comment = c(ORCID = "0000-0002-4958-2844")), person(family = "Plotly Technologies, Inc.", role = "cph")) + pkg_help_description: ${js.core.readConfigFile('pkg_help_description.txt')} + pkg_help_title: Core Interactive Table Component for 'Dash' + pkg_copyright: Plotly Technologies, Inc. examples: - dashDataTable: + DataTable: dontrun: FALSE - code: ${js.core.readFile('dashDataTable.R')} + code: ${js.core.readConfigFile('dashDataTable.R')} dist: - source: df_to_list.Rd target: man/df_to_list.Rd From 4818f1a0c412b24a9e1901fea7d98170eb90766f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 2 Oct 2020 16:15:46 -0400 Subject: [PATCH 05/24] dontrun: false --- .dcg.config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dcg.config.yaml b/.dcg.config.yaml index 3717f994b..e84c8dad0 100644 --- a/.dcg.config.yaml +++ b/.dcg.config.yaml @@ -60,7 +60,7 @@ vars: pkg_copyright: Plotly Technologies, Inc. examples: DataTable: - dontrun: FALSE + dontrun: false code: ${js.core.readConfigFile('dashDataTable.R')} dist: - source: df_to_list.Rd From 356cb091e17e9679ff1b1454bafddab612c17135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 2 Oct 2020 17:26:48 -0400 Subject: [PATCH 06/24] remove path --- .dcg.config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.dcg.config.yaml b/.dcg.config.yaml index e84c8dad0..d1f0844b8 100644 --- a/.dcg.config.yaml +++ b/.dcg.config.yaml @@ -1,4 +1,3 @@ -path: . componentPaths: - src/dash-table/dash/DataTable.js From f5b90fea445c4a67c1e189553df74dd1840f9de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 10:54:24 -0400 Subject: [PATCH 07/24] move config.yaml --- .dcg.config.yaml => .dcg/config.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .dcg.config.yaml => .dcg/config.yaml (100%) diff --git a/.dcg.config.yaml b/.dcg/config.yaml similarity index 100% rename from .dcg.config.yaml rename to .dcg/config.yaml From 4dc3c35954a2aea0dd79549c8db692c7631bea87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 15:47:15 -0400 Subject: [PATCH 08/24] async -> dynamic --- .dcg/config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.dcg/config.yaml b/.dcg/config.yaml index d1f0844b8..828ef8e83 100644 --- a/.dcg/config.yaml +++ b/.dcg/config.yaml @@ -19,7 +19,7 @@ dist: external: true - source: dash_table/async-export.js.map target: async-export.js.map - async: true + dynamic: true external: true - source: dash_table/async-highlight.js target: async-highlight.js @@ -27,7 +27,7 @@ dist: external: true - source: dash_table/async-highlight.js.map target: async-highlight.js.map - async: true + dynamic: true external: true - source: dash_table/async-table.js target: async-table.js @@ -35,7 +35,7 @@ dist: external: true - source: dash_table/async-table.js.map target: async-table.js.map - async: true + dynamic: true external: true vars: From bb1e75e5a22ee5c1e18001d7ce1b3958ca24173e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 15:54:22 -0400 Subject: [PATCH 09/24] use new generator in CI --- .circleci/config.yml | 13 +++++++------ package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78b0681b2..af238a424 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,9 +25,9 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - git clone --depth 1 git@github.com:plotly/dash.git dash-main - pip install -e ./dash-main[dev,testing] --quiet - cd dash-main/dash-renderer && npm ci && npm run build && pip install -e . && cd ./../.. + git clone --depth 1 -b dcg-template git@github.com:plotly/dash.git main + pip install -e ./main[dev,testing] --quiet + cd main/dash-renderer && npm ci && npm run build && pip install -e . && cd ./../.. - run: name: Build @@ -213,15 +213,16 @@ jobs: name: Install dependencies (dash) command: | . venv/bin/activate - git clone --depth 1 git@github.com:plotly/dash.git dash-main - pip install -e ./dash-main[dev,testing] --quiet - cd dash-main/dash-renderer && npm ci && npm run build && pip install -e . && cd ../.. + git clone --depth 1 -b dcg-template git@github.com:plotly/dash.git main + pip install -e ./main[dev,testing] --quiet + cd main/dash-renderer && npm ci && npm run build && pip install -e . && cd ../.. - run: name: Install test requirements command: | . venv/bin/activate npm run build + cd .dcg/dist/py python setup.py sdist cd dist find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd .. diff --git a/package.json b/package.json index 8793e56d6..a3c7547ed 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "private::build:js-test": "run-s \"private::build -- --mode development --config webpack.test.config.js\"", "private::build:js-test-standalone": "run-s \"private::build -- --mode development --config webpack.test.standalone.config.js\"", "private::build:js-test-watch": "run-s \"private::build -- --mode development --config webpack.test.config.js --watch\"", - "private::build:backends": "dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json && cp dash_table_base/** dash_table/ && dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json --r-prefix 'dash' --r-suggests 'dash' --jl-prefix 'dash'", + "private::build:backends": "node ../main/\\@plotly/dash-generate-components/src/run.js -c .dcg/config.yaml", "private::format.ts": "npm run private::lint.ts -- --fix", "private::format.prettier": "prettier --config .prettierrc --write \"src/**/*.{js,ts,tsx}\"", "private::format.black": "black --exclude dash_table .dcg .", From 405a69ba0208c8159551704c82258302cc697238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 16:09:37 -0400 Subject: [PATCH 10/24] . --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3c7547ed..6475c3afd 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "private::build:js-test": "run-s \"private::build -- --mode development --config webpack.test.config.js\"", "private::build:js-test-standalone": "run-s \"private::build -- --mode development --config webpack.test.standalone.config.js\"", "private::build:js-test-watch": "run-s \"private::build -- --mode development --config webpack.test.config.js --watch\"", - "private::build:backends": "node ../main/\\@plotly/dash-generate-components/src/run.js -c .dcg/config.yaml", + "private::build:backends": "node ./main/\\@plotly/dash-generate-components/src/run.js -c .dcg/config.yaml", "private::format.ts": "npm run private::lint.ts -- --fix", "private::format.prettier": "prettier --config .prettierrc --write \"src/**/*.{js,ts,tsx}\"", "private::format.black": "black --exclude dash_table .dcg .", From 80df75e957310e1e113c6115bdb9b45a82f35b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 16:17:31 -0400 Subject: [PATCH 11/24] dgc npm ci --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index af238a424..16e639871 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -221,6 +221,9 @@ jobs: name: Install test requirements command: | . venv/bin/activate + cd main/\\@plotly/dash-generate-components + npm ci + cd ../../.. npm run build cd .dcg/dist/py python setup.py sdist From de22bfc22b84bc93ca5ef2c2932a8b3d49806529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 16:35:21 -0400 Subject: [PATCH 12/24] more npm ci --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 16e639871..7e60c8abc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,9 @@ jobs: name: Build command: | . venv/bin/activate + cd main/\\@plotly/dash-generate-components + npm ci + cd ../../.. npm run private::build:js-test npm run private::build:backends python setup.py sdist From 16a411e2a9f04999a3fab61228cebf2ce3bee735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 16:51:14 -0400 Subject: [PATCH 13/24] sooner and no double escaping --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e60c8abc..eae9b6df4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,6 +26,7 @@ jobs: . venv/bin/activate pip install -r dev-requirements.txt --quiet git clone --depth 1 -b dcg-template git@github.com:plotly/dash.git main + cd ./main/\@plotly/dash-generate-components; npm ci; cd ../../.. pip install -e ./main[dev,testing] --quiet cd main/dash-renderer && npm ci && npm run build && pip install -e . && cd ./../.. @@ -33,9 +34,6 @@ jobs: name: Build command: | . venv/bin/activate - cd main/\\@plotly/dash-generate-components - npm ci - cd ../../.. npm run private::build:js-test npm run private::build:backends python setup.py sdist From 112ea6ff252e48276e4e5aba91d0030acb0bf369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 17:17:57 -0400 Subject: [PATCH 14/24] setup .dcg/dist/py for sever-test --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eae9b6df4..14e87334f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,8 +36,7 @@ jobs: . venv/bin/activate npm run private::build:js-test npm run private::build:backends - python setup.py sdist - cd dist + cd .dcg/dist/py; python setup.py sdist; cd dist find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd .. - run: From 03a1a179ee5afcaf8bc4191345abf4a705813ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 5 Oct 2020 17:44:07 -0400 Subject: [PATCH 15/24] ls -laR --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 14e87334f..41dda9786 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,6 +43,7 @@ jobs: name: Run tests command: | . venv/bin/activate + ls -laR .dcg/dist/py npm run test.server From b641a7ae8e2a67ea757a7ba5264fbb9b2de22a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 07:18:53 -0400 Subject: [PATCH 16/24] ls -laR earlier --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 41dda9786..dcdf0dd0b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,6 +36,7 @@ jobs: . venv/bin/activate npm run private::build:js-test npm run private::build:backends + ls -laR .dcg/dist/py cd .dcg/dist/py; python setup.py sdist; cd dist find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd .. @@ -43,7 +44,6 @@ jobs: name: Run tests command: | . venv/bin/activate - ls -laR .dcg/dist/py npm run test.server From ec096007035114839a39a4bf8662e7e83cadeb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 07:23:19 -0400 Subject: [PATCH 17/24] cat .dcg/dist/py/dash_table/metadata.json --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index dcdf0dd0b..5c092f9c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,6 +37,7 @@ jobs: npm run private::build:js-test npm run private::build:backends ls -laR .dcg/dist/py + cat .dcg/dist/py/dash_table/metadata.json cd .dcg/dist/py; python setup.py sdist; cd dist find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd .. From acb109f51adb340544b07bd41883149be7dd3055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 07:58:32 -0400 Subject: [PATCH 18/24] fix versions of dev-requirements --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index ff7e6f601..03d1d59c6 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,3 +1,3 @@ -pandas -preconditions -xlrd \ No newline at end of file +pandas==1.1.2 +preconditions==0.1 +xlrd==1.2.0 \ No newline at end of file From c26d19a639005aa35302ec8499052a74aa1c66d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 08:10:49 -0400 Subject: [PATCH 19/24] . --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c092f9c4..9e56301f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -216,6 +216,7 @@ jobs: command: | . venv/bin/activate git clone --depth 1 -b dcg-template git@github.com:plotly/dash.git main + cd ./main/\@plotly/dash-generate-components; npm ci; cd ../../.. pip install -e ./main[dev,testing] --quiet cd main/dash-renderer && npm ci && npm run build && pip install -e . && cd ../.. From 053d7eb799ab050e9bb31b29dd7f9eb0f8986921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 08:20:03 -0400 Subject: [PATCH 20/24] . --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e56301f1..0c579de93 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -224,9 +224,6 @@ jobs: name: Install test requirements command: | . venv/bin/activate - cd main/\\@plotly/dash-generate-components - npm ci - cd ../../.. npm run build cd .dcg/dist/py python setup.py sdist From 279152cebf4b0a49005824cbffee52ce5ab15b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 08:28:22 -0400 Subject: [PATCH 21/24] undo dev-requirements version locking --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 03d1d59c6..a4b48ca33 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,3 +1,3 @@ -pandas==1.1.2 -preconditions==0.1 -xlrd==1.2.0 \ No newline at end of file +panda +preconditions +xlrd \ No newline at end of file From 6a1eca0db36d428d8bf86e9cab6a7f9f2a21f92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 08:35:47 -0400 Subject: [PATCH 22/24] . --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index a4b48ca33..ff7e6f601 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,3 +1,3 @@ -panda +pandas preconditions xlrd \ No newline at end of file From c3909f76d8bbac7784bcc1b4c7ede08144101eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 6 Oct 2020 17:26:44 -0400 Subject: [PATCH 23/24] fix unit-tests? --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c579de93..37f3b162b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,7 +109,9 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing] + pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dcg-template#egg=dash[dev,testing] + git clone --depth 1 -b dcg-template git@github.com:plotly/dash.git main + cd ./main/\@plotly/dash-generate-components; npm ci; cd ../../.. - run: name: Run tests From 4c5197d1c80197aaab958747695ce68439f45ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 8 Oct 2020 13:50:07 -0400 Subject: [PATCH 24/24] trigger build