Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: default tox to 3.8 #972

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

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
```
jnumainville marked this conversation as resolved.
Show resolved Hide resolved

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
Expand Down
20 changes: 19 additions & 1 deletion plugins/plotly-express/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,22 @@ isolated_build = True
deps =
deephaven-server
commands =
python -m unittest discover
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


18 changes: 17 additions & 1 deletion plugins/ui/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ isolated_build = True
deps =
deephaven-server
commands =
python -m unittest {posargs}
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
Loading