Skip to content

Remove accidental playwright dependency #906

Closed
@Archmonger

Description

@Archmonger

Current Situation

In 1.0.0 we are importing from .testing.backend import _hotswap, _MountFunc within idom.widgets. This was a bad idea since the import stack now forces users to have to install playwright.

User environments aren't going to have playwright installed.

  File "C:\Users\Markg\Documents\Repositories\Conreq\conreq\config\__init__.py", line 1, in <module>
    from conreq.config.types import (
  File "C:\Users\Markg\Documents\Repositories\Conreq\conreq\config\types.py", line 8, in <module>
    from idom.html import div, span
  File "C:\Users\Markg\Documents\Repositories\Conreq\.venv\lib\site-packages\idom\__init__.py", line 1, in <module>
    from idom import backend, config, html, logging, sample, svg, types, web, widgets
  File "C:\Users\Markg\Documents\Repositories\Conreq\.venv\lib\site-packages\idom\widgets.py", line 13, in <module>
    from .testing.backend import _hotswap, _MountFunc
  File "C:\Users\Markg\Documents\Repositories\Conreq\.venv\lib\site-packages\idom\testing\__init__.py", line 3, in <module>
    from .display import DisplayFixture
  File "C:\Users\Markg\Documents\Repositories\Conreq\.venv\lib\site-packages\idom\testing\display.py", line 7, in <module>
    from playwright.async_api import (
ModuleNotFoundError: No module named 'playwright'

Proposed Actions

Either completely remove hotswap (to be honest, I don't think anyone other than IDOM Core currently uses it), or do some lazy imports for _hotswap and manually define the type hint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions