Skip to content

Commit 5c2f05e

Browse files
authored
Merge pull request #1679 from plotly/dash-monorepo
Dash monorepo
2 parents 86c140a + 4b53e3e commit 5c2f05e

File tree

766 files changed

+350013
-1201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

766 files changed

+350013
-1201
lines changed

.circleci/config.yml

Lines changed: 482 additions & 66 deletions
Large diffs are not rendered by default.

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
ignore = C901, E203, E266, E501, E731, W503
33
select = B,C,E,F,W,T4
44
per-file-ignores =
5-
tests/*: E722, F811
5+
tests/*: E722, F811
6+
dash/html/I.py: E742

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ coverage.xml
4343
.Python
4444
build/
4545
dash/deps/
46+
dash/html/
47+
dash/dcc/
48+
dash/dash_table/
4649
develop-eggs/
4750
dist/
4851
downloads/
@@ -80,3 +83,8 @@ VERSION.txt
8083

8184
# vim
8285
*.swp
86+
87+
# Exceptions
88+
!components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv
89+
!components/dash-table/tests/assets/*.csv
90+
!components/dash-table/tests/selenium/assets/*.csv

.pylintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ ignore=CVS
1313
# regex matches against base names, not paths.
1414
ignore-patterns=
1515

16+
# Add files or directories matching the regex patterns to the ignore-list.
17+
# The regex matches against paths.
18+
ignore-paths=^dash/dcc/.*$,
19+
^dash/html/.*$,
20+
^dash/dash_table/.*$
21+
1622
# Python code to execute, usually for sys.path manipulation such as
1723
# pygtk.require().
1824
#init-hook=

.pylintrc39

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ ignore=CVS
1313
# regex matches against base names, not paths.
1414
ignore-patterns=
1515

16+
# Add files or directories matching the regex patterns to the ignore-list.
17+
# The regex matches against paths.
18+
ignore-paths=^dash/dcc/.*$,
19+
^dash/html/.*$,
20+
^dash/dash_table/.*$
21+
1622
# Python code to execute, usually for sys.path manipulation such as
1723
# pygtk.require().
1824
#init-hook=

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1111
- [#1514](https://github.com/plotly/dash/pull/1514) Perform json encoding using the active plotly JSON engine. This will default to the faster orjson encoder if the `orjson` package is installed.
1212

1313
### Changed
14-
- [#1707](https://github.com/plotly/dash/pull/1707) Change the default value of the `compress` argument to the `dash.Dash` constructor to `False`. This change reduces CPU usage, and was made in recognition of the fact that many deployment platforms (e.g. Dash Enterprise) already apply their own compression. If deploying to an environment that does not already provide compression, the Dash 1 behavior may be restored by adding `compress=True` to the `dash.Dash` constructor.
14+
- [#1679](https://github.com/plotly/dash/pull/1679) Restructure `dash`, `dash-core-components`, `dash-html-components`, and `dash-table` into a singular monorepo and move component packages into `dash`. This change makes the component modules available for import within the `dash` namespace, and simplifies the import pattern for a Dash app. From a development standpoint, all future changes to component modules will be made within the `components` directory, and relevant packages updated with the `dash-update-components` CLI command.
15+
- [#1707](https://github.com/plotly/dash/pull/1707) Change the default value of the `compress` argument to the `dash.Dash` constructor to `False`. This change reduces CPU usage, and was made in recognition of the fact that many deployment platforms (e.g. Dash Enterprise) already apply their own compression. If deploying to an environment that does not already provide compression, the Dash 1 behavior may be restored by adding `compress=True` to the `dash.Dash` constructor.
1516

1617
## [1.21.0] - 2021-07-09
1718

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ As of Dash 1.2, the renderer bundle and its peer dependencies can be packed and
4949

5050
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.
5151

52+
### Development of `dash-core-components`, `dash-html-components`, and `dash_table`
53+
54+
Specific details on making updates and contributions to `dcc`, `html`, and `dash_table` can be found within their respective sub-directories in the `components` directory. Once changes have been made in the specific directories, the `dash-update-components` command line tool can be used to update the build artifacts and dependencies of the respective packages within Dash. For example, if a change has been made to `dash-core-components`, use `dash-update-components "dash-core-components"` to move the build artifacts to Dash. By default, this is set to update `all` packages.
55+
5256
## Python 2 And 3 Compatibility
5357

5458
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.
@@ -77,7 +81,7 @@ Git command veterans might argue that a simple terminal and a cherry switch keyb
7781

7882
### Emoji
7983

80-
Plotlyers love to use emoji as an effective communication medium for
84+
Plotlyers love to use emoji as an effective communication medium for:
8185

8286
**Commit Messages**
8387

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ include dash/favicon.ico
55
include dash/extract-meta.js
66
include dash/deps/*.js
77
include dash/deps/*.map
8+
include dash/dcc/*
9+
include dash/html/*
10+
include dash/dash_table/*
811
include dash/dash-renderer/build/*.js
912
include dash/dash-renderer/build/*.map
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
version: 2.1
2+
3+
orbs:
4+
win: circleci/[email protected]
5+
6+
jobs:
7+
dcc-percy-finalize:
8+
working_directory: ~/dash/components/dash-core-components
9+
docker:
10+
- image: percyio/agent
11+
auth:
12+
username: dashautomation
13+
password: $DASH_PAT_DOCKERHUB
14+
steps:
15+
- checkout:
16+
path: ~/dash
17+
- run: percy finalize --all
18+
19+
dcc-lint-unit-39: &lint-unit
20+
working_directory: ~/dash/components/dash-core-components
21+
docker:
22+
- image: circleci/python:3.9.2-buster-node-browsers
23+
auth:
24+
username: dashautomation
25+
password: $DASH_PAT_DOCKERHUB
26+
environment:
27+
PYTHON_VERSION: py39
28+
steps:
29+
- checkout:
30+
path: ~/dash
31+
- run: echo $PYTHON_VERSION > ver.txt
32+
- restore_cache:
33+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
34+
- run:
35+
name: 🐍 pip dev requirements
36+
command: |
37+
sudo pip install virtualenv --upgrade
38+
python -m venv venv || virtualenv venv && . venv/bin/activate
39+
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing]
40+
pip install --progress-bar off --no-cache-dir -r dev-requirements.txt
41+
- save_cache:
42+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
43+
paths:
44+
- venv
45+
- run:
46+
name: 🌸 Lint
47+
command: |
48+
. venv/bin/activate
49+
set -eo pipefail
50+
npm ci
51+
npm run lint
52+
53+
dcc-lint-unit-36:
54+
<<: *lint-unit
55+
docker:
56+
- image: circleci/python:3.6.13-stretch-node-browsers
57+
auth:
58+
username: dashautomation
59+
password: $DASH_PAT_DOCKERHUB
60+
environment:
61+
PYTHON_VERSION: py36
62+
63+
dcc-build-dash-39: &build-dash
64+
working_directory: ~/dash/components/dash-core-components
65+
docker:
66+
- image: circleci/python:3.9.2-buster-node-browsers
67+
auth:
68+
username: dashautomation
69+
password: $DASH_PAT_DOCKERHUB
70+
environment:
71+
PYTHON_VERSION: py39
72+
steps:
73+
- checkout:
74+
path: ~/dash
75+
- run: echo $PYTHON_VERSION > ver.txt
76+
- restore_cache:
77+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
78+
- run:
79+
name: 🐍 pip dev requirements
80+
command: |
81+
sudo pip install virtualenv --upgrade
82+
python -m venv venv || virtualenv venv && . venv/bin/activate
83+
set -eo pipefail
84+
pip install --progress-bar off --no-cache-dir -r dev-requirements.txt
85+
- save_cache:
86+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
87+
paths:
88+
- venv
89+
- run:
90+
name: 🏗️ build dash
91+
command: |
92+
. venv/bin/activate && mkdir packages
93+
set -eo pipefail
94+
# build main dash & renderer
95+
git clone --depth 1 -b dash-monorepo [email protected]:plotly/dash.git dash-main
96+
cd dash-main && pip install -e .[dev] --progress-bar off && renderer build
97+
python setup.py sdist && mv dist/* ../packages/ && cd ..
98+
# build html
99+
git clone --depth 1 https://github.com/plotly/dash-html-components.git
100+
git clone --depth 1 [email protected]:plotly/dash-table.git
101+
cd dash-html-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages && cd ..
102+
cd dash-table && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages && cd ..
103+
# build dcc
104+
npm ci && npm run build && python setup.py sdist && mv dist/* ./packages && ls -la packages
105+
- persist_to_workspace:
106+
root: ~/dash/components/dash-core-components
107+
paths:
108+
- packages
109+
110+
dcc-build-dash-36:
111+
<<: *build-dash
112+
docker:
113+
- image: circleci/python:3.6.13-stretch-node-browsers
114+
auth:
115+
username: dashautomation
116+
password: $DASH_PAT_DOCKERHUB
117+
environment:
118+
PYTHON_VERSION: py36
119+
120+
dcc-test-39: &test
121+
working_directory: ~/dash/components/dash-core-components
122+
docker:
123+
- image: circleci/python:3.9.2-buster-node-browsers
124+
auth:
125+
username: dashautomation
126+
password: $DASH_PAT_DOCKERHUB
127+
environment:
128+
PYTHON_VERSION: py39
129+
PERCY_PARALLEL_TOTAL: -1
130+
PERCY_ENABLE: 1
131+
parallelism: 3
132+
steps:
133+
- checkout:
134+
path: ~/dash
135+
- run: echo $PYTHON_VERSION > ver.txt
136+
- restore_cache:
137+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
138+
- attach_workspace:
139+
at: ~/dash/components/dash-core-components
140+
- run:
141+
name: 🧪 Run Integration Tests
142+
command: |
143+
. venv/bin/activate && rm -rf dash_core_components && ls -la
144+
set -eo pipefail
145+
cd packages && mv dash-*.tar.gz main.tar.gz && ls -la
146+
find . -name "dash_*.gz" | xargs pip install -I --progress-bar off --no-cache-dir
147+
pip install --no-cache-dir --progress-bar off main.tar.gz[dev,testing]
148+
pip list | grep dash | xargs pip show && cd ..
149+
echo $(python -V 2>&1) | grep 3.
150+
TESTFILES=$(circleci tests glob "tests/integration/**/test_*.py" | circleci tests split --split-by=timings)
151+
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
152+
- store_artifacts:
153+
path: ~/dash/components/dash-core-components/test-reports
154+
- store_test_results:
155+
path: ~/dash/components/dash-core-components/test-reports
156+
- store_artifacts:
157+
path: /tmp/dash_artifacts
158+
159+
dcc-test-36:
160+
<<: *test
161+
docker:
162+
- image: circleci/python:3.6.13-stretch-node-browsers
163+
auth:
164+
username: dashautomation
165+
password: $DASH_PAT_DOCKERHUB
166+
environment:
167+
PYTHON_VERSION: py36
168+
PERCY_ENABLE: 0
169+
170+
workflows:
171+
dcc-python3.9:
172+
jobs:
173+
- dcc-lint-unit-39
174+
- dcc-build-dash-39
175+
- dcc-test-39:
176+
requires:
177+
- dcc-build-dash-39
178+
- dcc-percy-finalize:
179+
requires:
180+
- dcc-test-39
181+
182+
dcc-python3.6:
183+
jobs:
184+
- dcc-lint-unit-36
185+
- dcc-build-dash-36
186+
- dcc-test-36:
187+
requires:
188+
- dcc-build-dash-36
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
# Matches multiple files with brace expansion notation
9+
# Set default charset
10+
[*.{js,py}]
11+
charset = utf-8
12+
indent_style = space
13+
indent_size = 4
14+
15+
# Matches the exact files either package.json or .travis.yml
16+
[{package.json,.circleci/config.yml}]
17+
indent_style = space
18+
indent_size = 2

0 commit comments

Comments
 (0)