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

Missing dependency on py package #313

Closed
treiher opened this issue Sep 2, 2023 · 10 comments
Closed

Missing dependency on py package #313

treiher opened this issue Sep 2, 2023 · 10 comments

Comments

@treiher
Copy link

treiher commented Sep 2, 2023

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
@BeyondEvil
Copy link
Contributor

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

@sandre35
Copy link
Contributor

sandre35 commented Sep 4, 2023

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

@sdiemer
Copy link

sdiemer commented Sep 4, 2023

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...

@sdiemer
Copy link

sdiemer commented Sep 4, 2023

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

@sandre35
Copy link
Contributor

sandre35 commented Sep 4, 2023

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.

@RuslanBM
Copy link

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

@twise-code
Copy link

@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?

@sandre35
Copy link
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?

@BeyondEvil
Copy link
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.

@Mogost
Copy link

Mogost commented Nov 20, 2023

Should be closed. Fixed in #317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants