Skip to content

Commit 64865e6

Browse files
committed
Specify plotly.express dependencies
1 parent 7ff4a12 commit 64865e6

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

contributing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ conda activate plotly-dev
137137

138138
### Install requirements - (Non-Windows)
139139
```bash
140-
(plotly_dev) $ pip install -r packages/python/plotly/requirements.txt
141-
(plotly_dev) $ pip install -r packages/python/plotly/optional-requirements.txt
140+
(plotly_dev) $ pip install -r packages/python/plotly/requires-install.txt
141+
(plotly_dev) $ pip install -r packages/python/plotly/requires-dev.txt
142142
```
143143
### Install requirements - (Windows + Conda)
144144
Because Windows requires Visual Studio libraries to compile some of the optional dependencies, follow these steps to
145145
complete installation and avoid gdal-config errors.
146146

147147
```bash
148-
(plotly_dev) $ pip install -r packages/python/plotly/requirements.txt
148+
(plotly_dev) $ pip install -r packages/python/plotly/requires-install.txt
149149
(plotly_dev) $ conda install fiona
150-
(plotly_dev) $ pip install -r packages/python/plotly/optional-requirements.txt
150+
(plotly_dev) $ pip install -r packages/python/plotly/requires-dev.txt
151151
```
152152

153153
### Editable install of plotly packages
@@ -170,7 +170,7 @@ documentation on _development mode_.
170170
This repo uses the [Black](https://black.readthedocs.io/en/stable/) code formatter,
171171
and the [pre-commit](https://pre-commit.com/) library to manage a git commit hook to
172172
run Black prior to each commit. Both pre-commit and black are included in the
173-
`packages/python/plotly/optional-requirements.txt` file, so you should have them
173+
`packages/python/plotly/requires-dev.txt` file, so you should have them
174174
installed already if you've been following along.
175175

176176
To enable the Black formatting git hook, run the following from within your virtual
@@ -258,7 +258,7 @@ We take advantage of two tools to run tests:
258258

259259
### Running Tests with `pytest`
260260

261-
Since our tests cover *all* the functionality, to prevent tons of errors from showing up and having to parse through a messy output, you'll need to install `optional-requirements.txt` as explained above.
261+
Since our tests cover *all* the functionality, to prevent tons of errors from showing up and having to parse through a messy output, you'll need to install `requires-dev.txt` as explained above.
262262

263263
After you've done that, go ahead and run the test suite!
264264

packages/python/plotly/requirements.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/python/plotly/optional-requirements.txt renamed to packages/python/plotly/requires-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Optional Dependencies for Additional Plotly Functionality ###
22
### ###
33
### To install, run: ###
4-
### $ pip install -r optional-requirements.txt ###
4+
### $ pip install -r requires-dev.txt ###
55
### ###
66
###################################################################
77

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pandas>=2.2.0 # Minimum pin to ensure compatibility with all versions of numpy
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tenacity>=6.2.0
2+
packaging

packages/python/plotly/setup.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
else:
6666
skip_npm = False
6767

68+
6869
# Load plotly.js version from js/package.json
6970
def plotly_js_version():
7071
path = os.path.join(
@@ -273,9 +274,7 @@ def overwrite_plotlyjs_version_file(plotlyjs_version):
273274
# DO NOT EDIT
274275
# This file is generated by the updatebundle setup.py command
275276
__plotlyjs_version__ = "{plotlyjs_version}"
276-
""".format(
277-
plotlyjs_version=plotlyjs_version
278-
)
277+
""".format(plotlyjs_version=plotlyjs_version)
279278
)
280279

281280

@@ -289,9 +288,7 @@ def overwrite_plotlywidget_version_file(version):
289288
#
290289
# It is edited by hand prior to official releases
291290
__frontend_version__ = "{version}"
292-
""".format(
293-
version=version
294-
)
291+
""".format(version=version)
295292
)
296293

297294

@@ -303,7 +300,6 @@ def request_json(url):
303300

304301

305302
def get_latest_publish_build_info(repo, branch):
306-
307303
url = (
308304
r"https://circleci.com/api/v1.1/project/github/"
309305
r"{repo}/tree/{branch}?limit=100&filter=completed"
@@ -537,6 +533,14 @@ def run(self):
537533
]
538534

539535
versioneer_cmds = versioneer.get_cmdclass()
536+
537+
538+
def read_req_file(req_type):
539+
with open(f"requires-{req_type}.txt", encoding="utf-8") as fp:
540+
requires = (line.strip() for line in fp)
541+
return [req for req in requires if req and not req.startswith("#")]
542+
543+
540544
setup(
541545
name="plotly",
542546
version=versioneer.get_version(),
@@ -603,7 +607,11 @@ def run(self):
603607
data_files=[
604608
("etc/jupyter/nbconfig/notebook.d", ["jupyterlab-plotly.json"]),
605609
],
606-
install_requires=["tenacity>=6.2.0", "packaging"],
610+
install_requires=read_req_file("install"),
611+
extras_require={
612+
"express": read_req_file("express"),
613+
"dev": read_req_file("dev"),
614+
},
607615
zip_safe=False,
608616
cmdclass=dict(
609617
build_py=js_prerelease(versioneer_cmds["build_py"]),

0 commit comments

Comments
 (0)