Skip to content

Commit 9423aa1

Browse files
committed
Specify plotly.express dependencies
1 parent 143acb0 commit 9423aa1

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
@@ -140,17 +140,17 @@ We will support Python 3.12 and higher versions soon.
140140

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

150150
```bash
151-
(plotly_dev) $ pip install -r packages/python/plotly/requirements.txt
151+
(plotly_dev) $ pip install -r packages/python/plotly/requires-install.txt
152152
(plotly_dev) $ conda install fiona
153-
(plotly_dev) $ pip install -r packages/python/plotly/optional-requirements.txt
153+
(plotly_dev) $ pip install -r packages/python/plotly/requires-dev.txt
154154
```
155155

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

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

262262
### Running Tests with `pytest`
263263

264-
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.
264+
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.
265265

266266
After you've done that, go ahead and run the test suite!
267267

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)