Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Rivet committed Sep 17, 2019
2 parents b89c85b + 8f2e58e commit cdbf2be
Show file tree
Hide file tree
Showing 45 changed files with 20,162 additions and 23,850 deletions.
33 changes: 20 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- checkout
- run: echo $PYVERSION > ver.txt
- restore_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
- attach_workspace:
at: ~/dash
- store_artifacts:
Expand All @@ -34,15 +34,15 @@ jobs:
- checkout
- run: echo $PYVERSION > ver.txt
- restore_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
- run:
name: ️️🏗️ pip dev requirements
command: |
sudo pip install --upgrade virtualenv
python -m venv venv || virtualenv venv && . venv/bin/activate
pip install -e . -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --quiet
- save_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
paths:
- "venv"
- run:
Expand All @@ -55,10 +55,14 @@ jobs:
pylint tests/unit tests/integration/devtools tests/integration/renderer tests/integration/dash_assets -d all -e C0410,C0411,C0412,C0413,W0109
cd dash-renderer && npm install --ignore-scripts && npm run lint:test && npm run format:test
- run:
name: 🔎 Unit Tests
name: 🐍 Python Unit Tests
command: |
. venv/bin/activate
PYTHONPATH=~/dash/tests/assets pytest tests/unit
- run:
name: ☕ JS Unit Tests
command: |
cd dash-renderer && npm run test:js
"lint-unit-36":
<<: *lint-unit
Expand Down Expand Up @@ -86,31 +90,33 @@ jobs:
- checkout
- run: echo $PYVERSION > ver.txt
- restore_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
- run:
name: ️️🏗️ pip dev requirements
command: |
sudo pip install --upgrade virtualenv
python -m venv venv || virtualenv venv && . venv/bin/activate
sed -i '/dash-/d' requires-install.txt
pip install -e . -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --quiet
- save_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
paths:
- "venv"
- run:
name: ️️🏗️ build core
command: |
. venv/bin/activate && pip install --upgrade -e . --quiet && mkdir packages
cd dash-renderer && renderer build && pip uninstall -y dash-renderer && pip install -e . && python setup.py sdist && mv dist/* ../packages/ && cd ..
python setup.py sdist && mv dist/* packages/
cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd ..
git clone --depth 1 https://github.com/plotly/dash-core-components.git
cd dash-core-components && npm install --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
git clone --depth 1 https://github.com/plotly/dash-renderer-test-components
cd dash-renderer-test-components && npm install --ignore-scripts && npm run build:all && python setup.py sdist && mv dist/* ../packages/ && cd ..
ls -la packages
- persist_to_workspace:
root: ~/dash
paths:
- packages
- packages/*.tar.gz

"build-core-36":
<<: *build-core
Expand All @@ -137,15 +143,15 @@ jobs:
- checkout
- run: echo $PYVERSION > ver.txt
- restore_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
- run:
name: ️️🏗️ pip dev requirements
command: |
sudo pip install --upgrade virtualenv
python -m venv venv || virtualenv venv && . venv/bin/activate
pip install -e . -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --quiet
- save_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
paths:
- "venv"
- run:
Expand All @@ -156,10 +162,11 @@ jobs:
cd dash-table && npm install --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
git clone --depth 1 https://github.com/plotly/dash-html-components.git
cd dash-html-components && npm install --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
ls -la packages
- persist_to_workspace:
root: ~/dash
paths:
- packages
- packages/*.tar.gz

"build-misc-36":
<<: *build-misc
Expand Down Expand Up @@ -187,7 +194,7 @@ jobs:
- checkout
- run: echo $PYVERSION > ver.txt
- restore_cache:
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
- attach_workspace:
at: ~/dash
- run:
Expand Down Expand Up @@ -262,4 +269,4 @@ workflows:
- "test-27":
requires:
- build-core-27
- build-misc-27
- build-misc-27
15 changes: 2 additions & 13 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence
* @alexcjohnson @byronz @Marc-Andre-Rivet

tests/* @byronz

*.js @Marc-Andre-Rivet @alexcjohnson

_r_* @rpkyle

*.md @alexcjohnson

*.py @alexcjohnson @byronz


* @alexcjohnson @byronz @Marc-Andre-Rivet

_r_* @alexcjohnson @byronz @Marc-Andre-Rivet @rpkyle
17 changes: 12 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,30 @@ As of Dash 1.2, the renderer bundle and its peer dependencies can be packed and
3. `renderer bundles` parses the locked version JSON, copies all the peer dependencies into dash_renderer folder, bundles the renderer assets, and generates an `__init__.py` to map all the resources. There are also a list of helpful `scripts` property defined in `package.json` you might need to do some handy tasks like linting, syntax format with prettier, etc.
4. `renderer digest` computes the content hash of each asset in `dash_renderer` folder, prints out the result in logs, and dumps into a JSON file `digest.json`. Use this when you have a doubt about the current assets in `dash_renderer`, and compare it with previous result in one shot by this command.
5. `renderer build` runs 1, 2, 3, 4 in sequence as a complete build process from scratch.
6. `renderer watch` runs the webpack in watch mode, so any source code change triggers a rebuild. Use this if you are actively updating renderer code and you want to test your changes immediately.
6. `renderer build local` runs the same order as in 5 and also generates source maps for debugging purposes. You also need to install dash-renderer with editable mode: `pip install -e .`.

When a change in renderer code doesn't reflect in your browser as expected, this could be: confused bundle generation, caching issue in a browser, python package not in `editable` mode, etc. The new tool reduces the risk of bundle assets by adding the digest to help compare asset changes.

## Python 2 And 3 Compatibility

Writing Python 2/3 compatible code might be a challenging task for contributors used to working on one particular version, especially new learners who start directly with Python 3.

From the #892, we started to adopt `python-future` instead of `six` as our tool to better achieve the goal where we can mainly write Python 3 code and make it back-compatible in Python 2.7 (last Python 2 version Dash supports before it gets deprecated).

Please refer to [this list of idioms](https://python-future.org/compatible_idioms.html "https://python-future.org/compatible_idioms.html") for more details on working with `python-future`.

## Git

Use the [GitHub flow](https://guides.github.com/introduction/flow/) when proposing contributions to this repository (i.e. create a feature branch and submit a PR against the default branch).

### Organize your commits

For pull request with notable file changes or a big feature developmennt, we highly recommend to organize the commits in a logical manner, so it
For pull request with notable file changes or a big feature development, we highly recommend to organize the commits in a logical manner, so it

- makes a code review experience much more pleasant
- facilitates a possible cherry picking with granular commits

*an intutive [example](https://github.com/plotly/dash-core-components/pull/548) is worth a thousand words.*
*an intuitive [example](https://github.com/plotly/dash-core-components/pull/548) is worth a thousand words.*

#### Git Desktop

Expand Down Expand Up @@ -106,15 +114,14 @@ Note: *You might find out that we have more integration tests than unit tests in

We introduced the `dash.testing` feature in [Dash 1.0](https://community.plot.ly/t/announcing-dash-testing/24868). It makes writing a Dash integration test much easier. Please read the [tutorial](http://dash.plot.ly/testing) and add relevant integration tests with any new features or bug fixes.


## Financial Contributions

Dash, and many of Plotly's open source products, have been funded through direct sponsorship by companies. [Get in touch] about funding feature additions, consulting, or custom app development.

[Dash Core Components]: https://dash.plot.ly/dash-core-components
[Dash HTML Components]: https://github.com/plotly/dash-html-components
[write your own components]: https://dash.plot.ly/plugins
[Dash Component Biolerplate]: https://github.com/plotly/dash-component-boilerplate
[Dash Component Boilerplate]: https://github.com/plotly/dash-component-boilerplate
[issues]: https://github.com/plotly/dash-core-components/issues
[GitHub flow]: https://guides.github.com/introduction/flow/
[semantic versioning]: https://semver.org/
Expand Down
15 changes: 4 additions & 11 deletions dash-renderer/.babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"presets": ["es2015", "react", "stage-2"],
"env": {
"development": {
"presets": ["es2015", "react", "stage-2"],
"plugins": [
["transform-es2015-modules-commonjs-simple", {
"noMangle": true
}]
]
}
}
"presets": [["@babel/preset-env", {
"useBuiltIns": "usage",
"corejs": 3
}], "@babel/preset-react"]
}
3 changes: 1 addition & 2 deletions dash-renderer/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
"no-sequences": ["error"],
"no-shadow": ["off"],
"no-throw-literal": ["error"],
"no-undefined": ["error"],
"no-unused-expressions": ["error"],
"no-use-before-define": ["error", "nofunc"],
"no-useless-call": ["error"],
Expand Down Expand Up @@ -147,4 +146,4 @@
"no-underscore-dangle": ["off"],
"no-useless-escape": ["off"]
}
}
}
7 changes: 7 additions & 0 deletions dash-renderer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.0] - 2019-09-17
### Added
- [#903](https://github.com/plotly/dash/pull/903) enables props edited by the user to persist across recreating the component or reloading the page. Components need to define three new props: `persistence`, `persisted_props`, and `persistence_type` as described in the lead comment of `src/persistence.js`. App developers then enable this behavior by, in the simplest case, setting `persistence: true` on the component. First use case is table, see [dash-table#566](https://github.com/plotly/dash-table/pull/566)

### Fixed
- Reduced about 55% of the dash-renderer packages size on **PyPI** by removing the source maps. To do more advanced debugging, the source maps needs to be generated from source code with `npm run build:local` and pip install in editable mode, i.e. `pip install -e .` [#910](https://github.com/plotly/dash/pull/910)

## [1.0.1] - 2019-08-27
- Clean all the binary assets in dash-renderer repo, add tool to build all the required bundles from fresh source code to avoid confusion of the assets and improve the release process. [#874](https://github.com/plotly/dash/pull/874)

Expand Down
6 changes: 2 additions & 4 deletions dash-renderer/dash_renderer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys

__file__
__version__ = "1.0.1"
__version__ = "1.1.0"

_js_dist_dependencies = [
{
Expand Down Expand Up @@ -38,15 +38,13 @@
{
"relative_package_path": "{}.min.js".format(__name__),
"dev_package_path": "{}.dev.js".format(__name__),
"external_url": "https://unpkg.com/dash-renderer@1.0.1"
"external_url": "https://unpkg.com/dash-renderer@1.1.0"
"/dash_renderer/dash_renderer.min.js",
"namespace": "dash_renderer",
},
{
"relative_package_path": "{}.min.js.map".format(__name__),
"dev_package_path": "{}.dev.js.map".format(__name__),
"external_url": "https://unpkg.com/[email protected]"
"/dash_renderer/dash_renderer.min.js.map",
"namespace": "dash_renderer",
"dynamic": True,
},
Expand Down
Loading

0 comments on commit cdbf2be

Please sign in to comment.