Repository: holoviz/datashader (language: python)

Issue:
Polygon User Guide Long CSV Download Output 
Under the "[Realistic Example](https://datashader.org/user_guide/Polygons.html#realistic-example)" in the Polygon User Guide, the CSV download is taking up the majority of the page.

![image](https://github.com/holoviz/datashader/assets/67855069/db184602-9a3d-4812-9f80-66981a923856)

It continues like this for about 80% of the entire page. 


Discussion / hints:
Thanks for the alert! Something changed about how chatty it was compared to when that page was first built. Gotta fix that!

Fix patch:
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
index bcf3536df..e16052d57 100644
--- a/.github/workflows/docs.yaml
+++ b/.github/workflows/docs.yaml
@@ -47,7 +47,7 @@ jobs:
       - name: fetch data
         run: |
           conda activate test-environment
-          datashader fetch-data --path=examples --force
+          python scripts/download_data.py
       - name: generate rst
         run: |
           conda activate test-environment
diff --git a/examples/user_guide/8_Polygons.ipynb b/examples/user_guide/8_Polygons.ipynb
index cc9a6bf81..fddd00691 100644
--- a/examples/user_guide/8_Polygons.ipynb
+++ b/examples/user_guide/8_Polygons.ipynb
@@ -166,7 +166,7 @@
    "metadata": {},
    "source": [
     "## Realistic Example\n",
-    "Here is a more realistic example, plotting the unemployment rate of the counties in Texas. "
+    "Here is a more realistic example, plotting the unemployment rate of the counties in Texas. To run you need to run `bokeh sampledata` or install the package `bokeh_sampledata`. "
    ]
   },
   {
@@ -175,11 +175,6 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "import bokeh.sampledata\n",
-    "try:\n",
-    "    from bokeh.sampledata.us_counties import data # noqa\n",
-    "except:\n",
-    "    bokeh.sampledata.download()\n",
     "from bokeh.sampledata.us_counties  import data as counties\n",
     "from bokeh.sampledata.unemployment import data as unemployment\n",
     "\n",
diff --git a/scripts/download_data.py b/scripts/download_data.py
new file mode 100644
index 000000000..9b7a494a9
--- /dev/null
+++ b/scripts/download_data.py
@@ -0,0 +1,23 @@
+from contextlib import suppress
+
+import pyct.cmd
+from packaging.version import Version
+
+pyct.cmd.fetch_data(name="data", path="examples", datasets="datasets.yml")
+
+
+with suppress(ImportError):
+    import bokeh
+
+    # Replaced with bokeh_sampledata in 3.5
+    if Version(bokeh.__version__) < Version("3.5"):
+        import bokeh.sampledata
+
+        bokeh.sampledata.download()
+
+
+with suppress(ImportError):
+    import geodatasets as gds
+
+    gds.get_path("geoda.natregimes")
+    gds.get_path("nybb")
diff --git a/setup.py b/setup.py
index 78a09d0b9..f5c184250 100644
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,11 @@
     'spatialpandas',
 ]
 
+if sys.version_info[:2] >= (3, 10):
+    examples += [
+        'bokeh_sampledata',
+    ]
+
 # Numpy 2 packages, should be removed when all commented out packages works with Numpy 2
 numpy2 = [
     'numba ==0.60.0rc1',
diff --git a/tox.ini b/tox.ini
index a6bdc77b0..477ff0e3b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -32,8 +32,7 @@ commands = pytest datashader -k "not benchmarks and not test_tiles" --cov=./data
 [_examples]
 description = Test that default examples run
 deps = .[examples, tests]
-commands = datashader fetch-data --path=examples --use-test-data
-           pytest --nbsmoke-run -k ".ipynb"
+commands = pytest --nbsmoke-run -k ".ipynb"
 # could add more, to test types of example other than nbs
 
 [_examples_extra]


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 7a036d5fd..b80c33641 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -164,6 +164,10 @@ jobs:
         run: |
           conda activate test-environment
           doit test_lint
+      - name: download data
+        run: |
+          conda activate test-environment
+          python scripts/download_data.py
       - name: doit test_unit
         run: |
           conda activate test-environment
@@ -210,6 +214,9 @@ jobs:
       - name: doit develop_install
         run: |
           doit ecosystem=pip develop_install -o tests -o examples
+      - name: download data
+        run: |
+          python scripts/download_data.py
       - name: doit env_capture
         run: |
           doit ecosystem=pip env_capture