Repository: deephaven/deephaven-plugins (language: python)

Issue:
Use Python 3.8 for tox tests locally
Sometimes running our tests locally pass, then fail in CI. This is because in CI we test against Python 3.8, whereas we default to whatever the user has by default locally (which could be 3.10).
Should be able to specify version in the tox config: https://tox.wiki/en/latest/config.html#python-options


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index 2d2eb0252..ac0235460 100644
--- a/README.md
+++ b/README.md
@@ -73,14 +73,30 @@ You should be able to pass arguments to these commands as if you were running Pl
 It is highly recommended to use `npm run e2e:docker` (instead of `npm run e2e`) as CI also uses the same environment. You can also use `npm run e2e:update-snapshots` to regenerate snapshots in said environment. Run Playwright in [UI Mode](https://playwright.dev/docs/test-ui-mode) with `npm run e2e:ui` when creating new tests or debugging, as this will allow you to run each test individually, see the browser as it runs it, inspect the console, evaluate locators, etc.
 
 ### Running Python tests
-
-The above steps will also set up `tox` to run tests for the python plugins that support it.
+The [venv setup](#pre-commit-hookspython-formatting) steps will also set up `tox` to run tests for the python plugins that support it.
+Note that `tox` sets up an isolated environment for running tests.  
+Be default, `tox` will run against Python 3.8, which will need to be installed on your system before running tests.
 You can run tests with the following command from the `plugins/<plugin>` directory:
-
 ```shell
 tox -e py
 ```
 
+> [!IMPORTANT]
+> Linux, and possibly other setups such as MacOS depending on method, may require additional packages to be installed to run Python 3.8.
+> ```shell
+> sudo apt install python3.8 python3.8-distutils libpython3.8
+> # or just full install although it will include more packages than necessary
+> sudo apt install python3.8-full
+> ```
+
+You can also run tests against a specific version of python by appending the version to `py`  
+This assumes that the version of Python you're targeting is installed on your system.  
+For example, to run tests against Python 3.12, run:  
+```shell
+tox -e py3.12
+```
+
+
 ### Running plugin against deephaven-core
 
 #### Building Python plugins for development
diff --git a/plugins/plotly-express/tox.ini b/plugins/plotly-express/tox.ini
index b214f738a..edcbe5445 100644
--- a/plugins/plotly-express/tox.ini
+++ b/plugins/plotly-express/tox.ini
@@ -5,4 +5,22 @@ isolated_build = True
 deps =
     deephaven-server
 commands =
-    python -m unittest discover
\ No newline at end of file
+    python -m unittest discover
+basepython = python3.8
+
+[testenv:py3.8]
+basepython = python3.8
+
+[testenv:py3.9]
+basepython = python3.9
+
+[testenv:py3.10]
+basepython = python3.10
+
+[testenv:py3.11]
+basepython = python3.11
+
+[testenv:py3.12]
+basepython = python3.12
+
+
diff --git a/plugins/ui/tox.ini b/plugins/ui/tox.ini
index a66bff89f..bdebb2457 100644
--- a/plugins/ui/tox.ini
+++ b/plugins/ui/tox.ini
@@ -5,4 +5,20 @@ isolated_build = True
 deps =
     deephaven-server
 commands =
-    python -m unittest {posargs}
\ No newline at end of file
+    python -m unittest {posargs}
+basepython = python3.8
+
+[testenv:py3.8]
+basepython = python3.8
+
+[testenv:py3.9]
+basepython = python3.9
+
+[testenv:py3.10]
+basepython = python3.10
+
+[testenv:py3.11]
+basepython = python3.11
+
+[testenv:py3.12]
+basepython = python3.12
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/test-python-package.yml b/.github/workflows/test-python-package.yml
index 268c69d33..e17443041 100644
--- a/.github/workflows/test-python-package.yml
+++ b/.github/workflows/test-python-package.yml
@@ -27,5 +27,5 @@ jobs:
         working-directory: 'plugins/${{ inputs.package }}'
 
       - name: Run tox
-        run: tox -e py
+        run: tox -e py${{ matrix.python }}
         working-directory: 'plugins/${{ inputs.package }}'