Skip to content

Commit ffddd66

Browse files
authored
Merge branch 'master' into master
2 parents 15266f7 + 04ced3b commit ffddd66

File tree

4 files changed

+44
-26
lines changed

4 files changed

+44
-26
lines changed

.circleci/config.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
version: 2
1+
version: 2.1
2+
3+
orbs:
4+
browser-tools: circleci/[email protected]
25

36
jobs:
4-
python-3.6: &test-template
7+
python-3-8: &test-template
58
docker:
6-
- image: circleci/python:3.6-stretch-node-browsers
9+
- image: cimg/python:3.8.20-browsers
710
auth:
811
username: dashautomation
912
password: $DASH_PAT_DOCKERHUB
@@ -14,6 +17,10 @@ jobs:
1417
steps:
1518
- checkout
1619

20+
- browser-tools/install-browser-tools:
21+
install-firefox: false
22+
install-geckodriver: false
23+
1724
- run:
1825
name: ✍️ Write job name.
1926
command: echo $CIRCLE_JOB > circlejob.txt
@@ -22,10 +29,9 @@ jobs:
2229
key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
2330

2431
- run:
25-
name: 🏗️ Create virtualenv
32+
name: 🏗️ Create venv
2633
command: |
27-
sudo pip install virtualenv
28-
python -m venv venv || virtualenv venv
34+
python -m venv venv
2935
3036
- run:
3137
name: 🏗️ Install requirements
@@ -45,9 +51,9 @@ jobs:
4551
pytest
4652
when: always
4753

48-
python-3.7-install-test:
54+
python-3-12-install-test:
4955
docker:
50-
- image: circleci/python:3.7-stretch-node-browsers
56+
- image: cimg/python:3.12.7-browsers
5157
auth:
5258
username: dashautomation
5359
password: $DASH_PAT_DOCKERHUB
@@ -58,6 +64,10 @@ jobs:
5864
steps:
5965
- checkout
6066

67+
- browser-tools/install-browser-tools:
68+
install-firefox: false
69+
install-geckodriver: false
70+
6171
- run:
6272
name: ✍️ Write job name.
6373
command: echo $CIRCLE_JOB > circlejob.txt
@@ -66,10 +76,9 @@ jobs:
6676
key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
6777

6878
- run:
69-
name: 🏗️ Create virtualenv
79+
name: 🏗️ Create venv
7080
command: |
71-
sudo pip install virtualenv
72-
python -m venv venv || virtualenv venv
81+
python -m venv venv
7382
7483
- run:
7584
name: 🏗️ Install requirements
@@ -102,7 +111,7 @@ workflows:
102111
version: 2
103112
build:
104113
jobs:
105-
- python-3.6:
114+
- python-3-8:
106115
context: dash-docker-hub
107-
- python-3.7-install-test:
116+
- python-3-12-install-test:
108117
context: dash-docker-hub

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ This repository contains a [Cookiecutter](https://github.com/audreyr/cookiecutte
66
- If it's the first time creating a Dash component, start with our [React guide for Python developers](https://dash.plotly.com/react-for-python-developers)
77
- Need help with your component? Create a post on the [Dash Community Forum](https://community.plotly.com/c/dash)
88

9+
<div align="center">
10+
<a href="https://dash.plotly.com/project-maintenance">
11+
<img src="https://dash.plotly.com/assets/images/maintained-by-plotly.png" width="400px" alt="Maintained by Plotly">
12+
</a>
13+
</div>
14+
15+
916
## Usage
1017

1118
To use this boilerplate:

{{cookiecutter.project_shortname}}/cookiecutter_templates/FunctionComponent.react.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@ import PropTypes from 'prop-types';
1111
const {{cookiecutter.component_name}} = (props) => {
1212
const {id, label, setProps, value} = props;
1313

14+
const handleInputChange = (e) => {
15+
/*
16+
* Send the new value to the parent component.
17+
* setProps is a prop that is automatically supplied
18+
* by dash's front-end ("dash-renderer").
19+
* In a Dash app, this will update the component's
20+
* props and send the data back to the Python Dash
21+
* app server if a callback uses the modified prop as
22+
* Input or State.
23+
*/
24+
setProps({ value: e.target.value });
25+
};
26+
1427
return (
1528
<div id={id}>
1629
ExampleComponent: {label}&nbsp;
1730
<input
1831
value={value}
19-
onChange={
20-
/*
21-
* Send the new value to the parent component.
22-
* setProps is a prop that is automatically supplied
23-
* by dash's front-end ("dash-renderer").
24-
* In a Dash app, this will update the component's
25-
* props and send the data back to the Python Dash
26-
* app server if a callback uses the modified prop as
27-
* Input or State.
28-
*/
29-
e => setProps({ value: e.target.value })
30-
}
32+
onChange={handleInputChange}
3133
/>
3234
</div>
3335
);

{{cookiecutter.project_shortname}}/usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def display_output(value):
1919

2020

2121
if __name__ == '__main__':
22-
app.run_server(debug=True)
22+
app.run(debug=True)

0 commit comments

Comments
 (0)