Skip to content

Commit 103c1e7

Browse files
authored
test: default tox to 3.8 (#972)
fixes #965 Default to test with 3.8 Also adds other environments to run. A tiny bit more maintenance when we add/remove version support but useful for both the gh action and easily running different versions locally
1 parent b9109e0 commit 103c1e7

File tree

4 files changed

+56
-6
lines changed

4 files changed

+56
-6
lines changed

.github/workflows/test-python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
working-directory: 'plugins/${{ inputs.package }}'
2828

2929
- name: Run tox
30-
run: tox -e py
30+
run: tox -e py${{ matrix.python }}
3131
working-directory: 'plugins/${{ inputs.package }}'

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,30 @@ You should be able to pass arguments to these commands as if you were running Pl
7373
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.
7474

7575
### Running Python tests
76-
77-
The above steps will also set up `tox` to run tests for the python plugins that support it.
76+
The [venv setup](#pre-commit-hookspython-formatting) steps will also set up `tox` to run tests for the python plugins that support it.
77+
Note that `tox` sets up an isolated environment for running tests.
78+
Be default, `tox` will run against Python 3.8, which will need to be installed on your system before running tests.
7879
You can run tests with the following command from the `plugins/<plugin>` directory:
79-
8080
```shell
8181
tox -e py
8282
```
8383

84+
> [!IMPORTANT]
85+
> Linux, and possibly other setups such as MacOS depending on method, may require additional packages to be installed to run Python 3.8.
86+
> ```shell
87+
> sudo apt install python3.8 python3.8-distutils libpython3.8
88+
> # or just full install although it will include more packages than necessary
89+
> sudo apt install python3.8-full
90+
> ```
91+
92+
You can also run tests against a specific version of python by appending the version to `py`
93+
This assumes that the version of Python you're targeting is installed on your system.
94+
For example, to run tests against Python 3.12, run:
95+
```shell
96+
tox -e py3.12
97+
```
98+
99+
84100
### Running plugin against deephaven-core
85101
86102
#### Building Python plugins for development

plugins/plotly-express/tox.ini

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,22 @@ isolated_build = True
55
deps =
66
deephaven-server
77
commands =
8-
python -m unittest discover
8+
python -m unittest discover
9+
basepython = python3.8
10+
11+
[testenv:py3.8]
12+
basepython = python3.8
13+
14+
[testenv:py3.9]
15+
basepython = python3.9
16+
17+
[testenv:py3.10]
18+
basepython = python3.10
19+
20+
[testenv:py3.11]
21+
basepython = python3.11
22+
23+
[testenv:py3.12]
24+
basepython = python3.12
25+
26+

plugins/ui/tox.ini

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,20 @@ isolated_build = True
55
deps =
66
deephaven-server
77
commands =
8-
python -m unittest {posargs}
8+
python -m unittest {posargs}
9+
basepython = python3.8
10+
11+
[testenv:py3.8]
12+
basepython = python3.8
13+
14+
[testenv:py3.9]
15+
basepython = python3.9
16+
17+
[testenv:py3.10]
18+
basepython = python3.10
19+
20+
[testenv:py3.11]
21+
basepython = python3.11
22+
23+
[testenv:py3.12]
24+
basepython = python3.12

0 commit comments

Comments
 (0)