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

Add py as dependency #555

Merged
merged 1 commit into from Oct 25, 2022

Conversation

smartEBL
Copy link
Contributor

This dependency was implicitely set through pytest. With [1] the dependency was removed from pytest, so pytest-html fails with:

ModuleNotFoundError: No module named 'py.xml'; 'py' is not a package

Specify it explicitely as dependency to fix the issue.

[1] pytest-dev/pytest@19dda7c

Signed-off-by: Erik Bloß erik.bloss@smartmicro.de

This dependency was implicitely set through pytest. With [1] the
dependency was removed from pytest, so pytest-html fails with:

ModuleNotFoundError: No module named 'py.xml'; 'py' is not a package

Specify it explicitely as dependency to fix the issue.

[1] pytest-dev/pytest@19dda7c

Signed-off-by: Erik Bloß <erik.bloss@smartmicro.de>
@RonnyPfannschmidt
Copy link
Member

@BeyondEvil lets release this as quick workaround and see to ensure the py.xml removal in a more sensible manner later

@smartYSC
Copy link

We deployed this fix on our local devpi server and can confirm that this indeed fixes the crash.

@BeyondEvil
Copy link
Contributor

Any idea why tests are failing?

@BeyondEvil BeyondEvil merged commit 00740f5 into pytest-dev:master Oct 25, 2022
@BeyondEvil
Copy link
Contributor

#556

@BeyondEvil
Copy link
Contributor

v3.2.0 released

@The-Compiler
Copy link
Member

@BeyondEvil lets release this as quick workaround and see to ensure the py.xml removal in a more sensible manner later

There should probably an issue for that so it doesn't get lost? Or is there and I just didn't find it?

@BeyondEvil
Copy link
Contributor

@BeyondEvil lets release this as quick workaround and see to ensure the py.xml removal in a more sensible manner later

There should probably an issue for that so it doesn't get lost? Or is there and I just didn't find it?

There’s a project and a label: next-gen.

Working on the last bits before putting an RC on pypi.

@ssbarnea
Copy link
Member

Everyone is dropping py and we add it as a dependency... 🤕

@BeyondEvil
Copy link
Contributor

Everyone is dropping py and we add it as a dependency... 🤕

Yeah, maybe instead of renaming the master branch, you could actually contribute towards v4 (next-gen) ?

@BrianOpteran
Copy link

This issue still affects me with pytest-html 3.2.0 🤷🏼

  Downloading pytest_html-3.2.0-py3-none-any.whl (16 kB)
Requirement already satisfied: py>=1.8.2 in /usr/lib/python3/dist-packages (from pytest-html->-r /home/user/requirements-test.txt (line 2)) (1.10.0)
Collecting pytest-metadata
  Downloading pytest_metadata-3.0.0-py3-none-any.whl (10 kB)
Collecting pytest
  Downloading pytest-7.3.1-py3-none-any.whl (320 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 320.5/320.5 KB 3.3 MB/s eta 0:00:00
Requirement already satisfied: iniconfig in /usr/lib/python3/dist-packages (from pytest->-r /home/user/requirements-test.txt (line 1)) (1.1.1)
Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/lib/python3/dist-packages (from pytest->-r /home/user/requirements-test.txt (line 1)) (0.13.0)
Collecting exceptiongroup>=1.0.0rc8
  Downloading exceptiongroup-1.1.1-py3-none-any.whl (14 kB)
Requirement already satisfied: packaging in /usr/lib/python3/dist-packages (from pytest->-r /home/user/requirements-test.txt (line 1)) (21.3)
Collecting tomli>=1.0.0
  Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Installing collected packages: tomli, exceptiongroup, pytest, pytest-metadata, pytest-html
  Attempting uninstall: pytest
    Found existing installation: pytest 6.2.5
    Not uninstalling pytest at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'pytest'. No files were found to uninstall.
Successfully installed exceptiongroup-1.1.1 pytest-7.3.1 pytest-html-3.2.0 pytest-metadata-3.0.0 tomli-2.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

TESTING ROOTFS

Traceback (most recent call last):
  File "/usr/bin/pytest-3", line 33, in <module>
    sys.exit(load_entry_point('pytest==6.2.5', 'console_scripts', 'pytest')())
  File "/usr/local/lib/python3.10/dist-packages/_pytest/config/__init__.py", line 189, in console_main
    code = main()
  File "/usr/local/lib/python3.10/dist-packages/_pytest/config/__init__.py", line 147, in main
    config = _prepareconfig(args, plugins)
  File "/usr/local/lib/python3.10/dist-packages/_pytest/config/__init__.py", line 328, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/usr/local/lib/python3.10/dist-packages/_pytest/helpconfig.py", line 103, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.10/dist-packages/_pytest/config/__init__.py", line 1067, in pytest_cmdline_parse
    self.parse(args)
  File "/usr/local/lib/python3.10/dist-packages/_pytest/config/__init__.py", line 1354, in parse
    self._preparse(args, addopts=addopts)
  File "/usr/local/lib/python3.10/dist-packages/_pytest/config/__init__.py", line 1237, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 297, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/usr/local/lib/python3.10/dist-packages/_pytest/assertion/rewrite.py", line 172, in exec_module
    exec(co, module.__dict__)
  File "/usr/local/lib/python3.10/dist-packages/pytest_html/plugin.py", line 9, in <module>
    from .html_report import HTMLReport
  File "/usr/local/lib/python3.10/dist-packages/_pytest/assertion/rewrite.py", line 172, in exec_module
    exec(co, module.__dict__)
  File "/usr/local/lib/python3.10/dist-packages/pytest_html/html_report.py", line 11, in <module>
    from py.xml import html
ModuleNotFoundError: No module named 'py.xml'; 'py' is not a package

@BeyondEvil
Copy link
Contributor

@BrianOpteran You’ll either have to install py explicitly or start using 4.0.0rc4

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

Successfully merging this pull request may close these issues.

None yet

7 participants