Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
file: Dockerfile
load: true
- name: Run ruff check
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run ruff check
run: docker run --rm ${{ steps.build.outputs.imageid }} ruff check
- name: Run format check
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run ruff format --check
run: docker run --rm ${{ steps.build.outputs.imageid }} ruff format --check
- name: Run mypy
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run mypy .
run: docker run --rm ${{ steps.build.outputs.imageid }} mypy .
- name: Run tests
run: docker run --rm -e GALAXY_URL=${{ env.GALAXY_URL }} -e GALAXY_API_KEY=${{ env.GALAXY_API_KEY }} ${{ steps.build.outputs.imageid }} poetry run pytest test_examples.py
run: docker run --rm -e GALAXY_URL=${{ env.GALAXY_URL }} -e GALAXY_API_KEY=${{ env.GALAXY_API_KEY }} ${{ steps.build.outputs.imageid }} pytest test_examples.py
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
hooks:
- id: mypy
name: mypy
entry: poetry run mypy .
entry: pixi run mypy .
language: system
types: [python]
verbose: true
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ RUN apt update && apt install -y \
libx11-dev \
libxrender1

ENV POETRY_HOME=/poetry
ENV PATH=/poetry/bin:$PATH
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN curl -fsSL https://pixi.sh/install.sh | sh
ENV PATH="/root/.pixi/bin:${PATH}"

RUN mkdir -p /opt/run/examples
COPY examples/ /opt/run/examples/
COPY tests/ /opt/run/
COPY pyproject.toml /opt/run/pyproject.toml
COPY poetry.lock /opt/run/poetry.lock

WORKDIR /opt/run
RUN poetry install
RUN pixi install
SHELL [ "pixi", "run" ]
ENTRYPOINT [ "pixi", "run" ]

CMD []
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,19 @@ We also provide examples that take advantage of ORNL resources:

## Running Examples

If you want to run the examples, then you will need to install [Poetry](https://python-poetry.org/). Once done, run the following to run an example.
If you want to run the examples, then you will need to install [Pixi](https://pixi.sh/latest/). Once done, run the following to run an example.

```bash
poetry install
poetry run python examples/{example_folder}/main.py
pixi install
pixi run python -m examples.{example_folder}
```

## Running Tests

This repo includes an automated test to ensure that each example runs:

```bash
poetry install
poetry run pytest
pixi run pytest
```

You can set the environment variable `INCLUDE_ORNL_TESTS=1` if you want to test the examples that rely on specific ORNL resources. Note that you will need to run them from a location that has access to these resources.
Expand Down
5 changes: 5 additions & 0 deletions examples/complex_pydantic_rules/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/conditional_disabling/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/conditional_rendering/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/data_selector/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/dialog/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/dynamic_pydantic_rules/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/matplotlib/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/multitab/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/ornl/neutron_data_selector/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/ornl/oncat/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/plotly/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/pydantic_form/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/pydantic_form_with_options/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/pydantic_monaco/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/run_galaxy_tool/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/run_galaxy_workflow/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
5 changes: 5 additions & 0 deletions examples/vtk/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Entrypoint."""

from .main import main

main()
2,022 changes: 2,022 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

3,375 changes: 0 additions & 3,375 deletions poetry.lock

This file was deleted.

27 changes: 16 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
[tool.poetry]
[project]
name = "nova-examples"
version = "0.1.0"
description = "NOVA Examples"
authors = []
license = "MIT"
keywords = ["Galaxy", "NOVA", "python"]
requires-python = ">=3.11,<3.14"

packages = [
{ include = "examples" }
]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64"]

[tool.pixi.dependencies]

[tool.poetry.dependencies]
python = "^3.10"
[tool.pixi.pypi-dependencies]
nova-examples = { path = ".", editable = true }
nova-galaxy = "*"
nova-mvvm = "*"
nova-trame = "*"
Expand All @@ -23,20 +25,23 @@ requests = "*"
ruff = "*"
trame-code = "*"
nltk = "*"
pillow = "^11.3.0"
trame-vtk = "^2.9.1"
vtk = "^9.5.2"
pillow = ">=11.3.0"
trame-vtk = ">=2.9.1"
vtk = ">=9.5.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["examples"]

[tool.pytest.ini_options]
python_files = ["test*.py"]
norecursedirs = [".git", "tmp*", "_tmp*", "__pycache__"]

[tool.ruff]
extend-exclude = [".pixi"]
line-length = 120

[tool.ruff.lint]
Expand Down