Skip to content

Missing dependency on py package #313

Description

@treiher

pytest-selenium depends on the py package, but py is not mentioned in pyproject.toml. The problem becomes apparent after updating pytest-html to 4.0.0, which removes py as a dependency.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/runner/.local/lib/python3.11/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/config/__init__.py", line 189, in console_main
    code = main()
           ^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/config/__init__.py", line 147, in main
    config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/config/__init__.py", line 328, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/pluggy/_callers.py", line 130, in _multicall
    teardown[0].send(outcome)
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/helpconfig.py", line 103, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/.local/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse
    self.parse(args)
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/config/__init__.py", line 14[25](https://github.com/treiher/valens/actions/runs/6055803738/job/16435139062#step:5:26), in parse
    self._preparse(args, addopts=addopts)
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1305, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/runner/.local/lib/python3.11/site-packages/pluggy/_manager.py", line 398, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/importlib/__init__.py", line 1[26](https://github.com/treiher/valens/actions/runs/6055803738/job/16435139062#step:5:27), in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 11[47](https://github.com/treiher/valens/actions/runs/6055803738/job/16435139062#step:5:48), in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line [69](https://github.com/treiher/valens/actions/runs/6055803738/job/16435139062#step:5:70)0, in _load_unlocked
  File "/home/runner/.local/lib/python3.11/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
    exec(co, module.__dict__)
  File "/home/runner/.local/lib/python3.11/site-packages/pytest_selenium/drivers/crossbrowsertesting.py", line 5, in <module>
    from py.xml import html
ModuleNotFoundError: No module named 'py.xml'; 'py' is not a package

Activity

  1. BeyondEvil commented on Sep 2, 2023

    @BeyondEvil
    Contributor

    I welcome a PR that fixes this by removing the dependency on py (as it's deprecated).

  2. sandre35 commented on Sep 4, 2023

    @sandre35
    Contributor

    @BeyondEvil I have created a PR to solve this issue. Feedback appreciated 🙏

  3. sdiemer commented on Sep 4, 2023

    @sdiemer

    Hello, I'm also very interested for a fix for this issue.
    But since the other major issue is still opened (#283), we will have to wait for a fix for both...

  4. sdiemer commented on Sep 4, 2023

    @sdiemer

    By the way, the easiest workaround for this issue is to add py to the requirements of the project using pytest-selenium.

  5. sandre35 commented on Sep 4, 2023

    @sandre35
    Contributor

    Hello, I'm also very interested for a fix for this issue. But since the other major issue is still opened (#283), we will have to wait for a fix for both...

    Issues are linked one to another. We don't need to wait for issue #283 to be solved to make a release with commits solving this issue.

  6. RuslanBM commented on Sep 13, 2023

    @RuslanBM

    I remain patient and pray that the problem is resolved as soon as possible.

  7. twise-code commented on Sep 14, 2023

    @twise-code

    @sandre35 Hi. We are really looking forward to a release with a fix for these problems. Can you tell me approximately when it will be?

  8. sandre35 commented on Sep 14, 2023

    @sandre35
    Contributor

    Hello @twise-code . I also would like to merge this PR and proceed to a release asap.

    @BeyondEvil Can you give us any update on this, please?

  9. BeyondEvil commented on Oct 31, 2023

    @BeyondEvil
    Contributor

    Hello @twise-code . I also would like to merge this PR and proceed to a release asap.

    @BeyondEvil Can you give us any update on this, please?

    Sorry, the only update I can give is that it's on my todo-list, but I can't give an ETA unfortunately.

  10. Mogost commented on Nov 20, 2023

    @Mogost

    Should be closed. Fixed in #317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions