Skip to content

Commit e72429e

Browse files
Split code block for building dash in CONTRIBUTING.md
Following Martha's suggestions, the big code block in the build Dash part is split up and the comments, containing explanations, are replaced as regular text
1 parent 24a1e30 commit e72429e

File tree

1 file changed

+38
-29
lines changed

1 file changed

+38
-29
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,53 +75,62 @@ The build process is mostly the same for Windows and Linux systems. Wherever the
7575
---
7676
</details>
7777

78-
Open a Bash terminal in the `dash` repository, Git Bash terminal for example on Windows:
78+
Open a Bash terminal in the `dash` repository, Git Bash terminal for example on Windows. Create and activate virtual environment (skip this part if you manage the Python Interpreter via Pycharm):
79+
- Linux/Mac:
7980

80-
```bash
81-
# Create and activate virtual environment
82-
#### LINUX ####
81+
On some Linux/Mac environments, use `.` instead of `source`
82+
```bash
8383
$ python3 -m venv .venv/dev
84-
# on some linux / mac environments, use `.` instead of `source`
8584
$ source .venv/dev/bin/activate
86-
#### WINDOWS ####
87-
# Skip this if you manage the Python Interpreter via Pycharm.
88-
# Create and activate virtual environment
85+
```
86+
- Windows:
87+
```bash
8988
$ python -m venv .venv/dev
9089
$ source .venv/dev/scripts/activate
91-
########
90+
```
9291

93-
# install dash and dependencies
92+
Install dash and dependencies:
93+
```bash
9494
$ pip install -e .[ci,dev,testing,celery,diskcache] # in some shells you need \ to escape []
95-
96-
# Do a clean install of all packages listed in package-lock.json. Package versions will be
97-
# exactly like stated in the file
9895
$ npm ci
96+
```
97+
`npm ci` does a clean install of all packages listed in package-lock.json. Package versions will be exactly like stated in the file.
9998

100-
# Build dash-core-components, dash-html-components, dash-table,
101-
# and renderer bundles; this will build all bundles from source code in their
102-
# respective directories. The only true source of npm version is defined
103-
# in package.json for each package.
104-
#### LINUX ####
99+
Next, build dash-core-components, dash-html-components, dash-table, and renderer bundles. This will build all bundles from source code in their respective directories. The only true source of npm version is defined in package.json for each package:
100+
- Linux/Mac:
101+
```bash
105102
$ npm run build # runs `renderer build` and `npm build` in dcc, html, table
106-
#### WINDOWS ####
107-
# On Windows the build is done via the first-build script. This adds extra steps
108-
# that are automatically applied on Linux systems, but not on Windows systems.
103+
```
104+
105+
- Windows:
106+
107+
On Windows the build is done via the first-build script. This adds extra steps that are automatically applied on Linux systems, but not on Windows systems:
108+
```bash
109109
$ npm run first-build
110-
########
110+
```
111111

112-
# When you first clone the repository, and check out a new branch, you must
113-
# run the full build as above. Later on, when you only work in one part of
114-
# the library, you could run part of the build process e.g.
115-
# $ dash-update-components "dash-core-components"
116-
# to only build dcc when developing dcc
112+
When you first clone the repository, and check out a new branch, you must run the full build as above. Later on, when you only work in one part of the library, you could run part of the build process e.g.
113+
```bash
114+
$ dash-update-components "dash-core-components"
115+
116+
```
117+
to only build dcc when developing dcc.
117118

118-
# Build and install components used in tests
119+
Build and install components used in tests:
120+
```bash
119121
$ npm run setup-tests.py # or npm run setup-tests.R
122+
```
120123

121-
# Verify that Dash is refering to a local source repo
124+
Finally, check that the installation succeeded by checking the output of this command:
125+
```bash
122126
$ pip list | grep dash
123127
```
124128

129+
The output should look like this:
130+
```bash
131+
dash <version number> /path/to/local/dash/repo/
132+
```
133+
125134
### Dash-Renderer Beginner Guide
126135

127136
`Dash Renderer` began as a separate repository. It was merged into the main `Dash` repository as part of the 1.0 release. It is the common frontend for all Dash backends (**R** and **Python**), and manages React Component layout and backend event handling.

0 commit comments

Comments
 (0)