From a8420e2602fabb2286bdc1d777db9947c3dda786 Mon Sep 17 00:00:00 2001 From: "Martindale, Nathan" Date: Fri, 14 Jun 2024 11:55:11 -0400 Subject: [PATCH] Add extremely restrictive setup dependencies to get back to a working instance --- makefile | 8 ++++++++ notebooks/simple_example.ipynb | 14 ++------------ setup.py | 29 ++++++++++++++++++++++++----- tests/test_browser.py | 8 ++++++++ 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/makefile b/makefile index 9f7bbb2..2a91448 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,7 @@ # https://madewithml.com/courses/mlops/makefile SHELL = /bin/bash VERSION := $(shell python -c "import icat; print(icat.__version__)") +MM_INIT = eval "$$(micromamba shell hook --shell bash)" .PHONY: help help: ## display all the make commands @@ -46,3 +47,10 @@ test: ## run unit tests .PHONY: test_debug test_debug: ## run unit tests with playwright debugging enabled PWDEBUG=1 pytest -s + + +.PHONY: scratch +scratch: ## build an environment completely from scratch and run tests + -micromamba env remove -n icat-scratch -y + micromamba create -n icat-scratch python -y + $(MM_INIT) && micromamba activate icat-scratch && pip install -e . && pip install -r requirements.txt && playwright install && pytest -s diff --git a/notebooks/simple_example.ipynb b/notebooks/simple_example.ipynb index e067e85..a074cdd 100644 --- a/notebooks/simple_example.ipynb +++ b/notebooks/simple_example.ipynb @@ -74,7 +74,7 @@ "id": "66b5d51f-ad83-496e-9eeb-9edbcec98ca2", "metadata": {}, "source": [ - "Now we create a model to explore with. ICAT's \"anchor types\" tab will automatically detect any `Anchor` class definitions, allowing you to dynamically add that anchor type to work with directly within the interface. Alternatively, you can pass the types you want to use to the constructor, or subsequently call `model.anchor_list.add_anchor_type(LMSimAnchor)`" + "We create a model instance with the dataset, pointing it at the column containing the text to apply any created features to." ] }, { @@ -101,16 +101,6 @@ "model.view" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "dcafa0a9-59d9-4db0-a5d8-769e2034fe77", - "metadata": {}, - "outputs": [], - "source": [ - "model.data.active_data" - ] - }, { "cell_type": "code", "execution_count": null, @@ -136,7 +126,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.14" + "version": "3.12.3" } }, "nbformat": 4, diff --git a/setup.py b/setup.py index 8a051eb..a40e424 100644 --- a/setup.py +++ b/setup.py @@ -40,17 +40,36 @@ def get_property(prop): ], python_requires=">=3.10", packages=["icat"], + # install_requires=[ + # "panel", + # "pyviz_comms", + # "numpy", + # "pandas", + # "scikit-learn", + # "ipyanchorviz", + # "altair", + # #"jupyter_bokeh", + # #"ipywidgets-bokeh", + # "ipyvuetify", + # "ipywidgets==8.1.2", + # "jupyterlab-widgets==3.0.10", + # ], install_requires=[ - "panel", + "panel<1.2", "pyviz_comms<3", "numpy", "pandas", "scikit-learn", - "ipyvuetify", - "ipywidgets", "ipyanchorviz", "altair", - "jupyter_bokeh", - "ipywidgets-bokeh", + "ipyvue==1.9.1", + "ipyvuetify==1.8.10", + "ipywidgets==8.0.6", + "param<2", + "traitlets==5.9.0", + "bokeh==3.1.1", + "jupyterlab==4.1.2", + "jupyterlab_server==2.23.0", + "jupyterlab-widgets==3.0.7", ], ) diff --git a/tests/test_browser.py b/tests/test_browser.py index a11a414..3963653 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -31,3 +31,11 @@ def test_jupyter(jupyter_server, page): page.keyboard.press("Shift+Enter") expect(page.locator(".anchorviz")).to_be_visible(timeout=15000) + + page.get_by_role("button", name="Dictionary").click() + + expect(page.locator("div.v-data-table.softhover-table").all()[1]).to_be_visible() + # inner_tables = page.locator(".softhover-table").all() + # assert len(inner_tables) > 0 + # for table in inner_tables: + # expect(table).to_be_visible()