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

pytest installation is broken #131

Closed
csadorf opened this issue Oct 12, 2020 · 7 comments · Fixed by #132
Closed

pytest installation is broken #131

csadorf opened this issue Oct 12, 2020 · 7 comments · Fixed by #132
Assignees
Labels

Comments

@csadorf
Copy link
Member

csadorf commented Oct 12, 2020

As of 20.10.0b0 the installation of pytest is broken. Trying to execute pytest (even without any arguments) leads to the following traceback:

$ pytest -v
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 689, in import_plugin
    __import__(importspec)
ModuleNotFoundError: No module named 'pytest_tornasync'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/aiida/.local/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 180, in console_main
    code = main()
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 136, in main
    config = _prepareconfig(args, plugins)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 314, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/opt/conda/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/opt/conda/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/opt/conda/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/opt/conda/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/helpconfig.py", line 99, in pytest_cmdline_parse
    config = outcome.get_result()  # type: Config
  File "/opt/conda/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/conda/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 932, in pytest_cmdline_parse
    self.parse(args)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1204, in parse
    self._preparse(args, addopts=addopts)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1097, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/opt/conda/lib/python3.7/site-packages/pluggy/manager.py", line 300, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 431, in register
    self.consider_module(plugin)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 656, in consider_module
    self._import_plugin_specs(getattr(mod, "pytest_plugins", []))
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 663, in _import_plugin_specs
    self.import_plugin(import_spec)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 693, in import_plugin
    ).with_traceback(e.__traceback__) from e
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 689, in import_plugin
    __import__(importspec)
ImportError: Error importing plugin "pytest_tornasync": No module named 'pytest_tornasync'
@csadorf csadorf self-assigned this Oct 12, 2020
@csadorf csadorf changed the title pytest installation is broken on pytest installation is broken Oct 12, 2020
@csadorf
Copy link
Member Author

csadorf commented Oct 12, 2020

As an immediate work-around it is possible to simply execute pip install pytest-tornasync --no-deps and pytest should function as expected in most scenarios.

@csadorf
Copy link
Member Author

csadorf commented Oct 12, 2020

The bug was introduced with 3f4f4ff .

@yakutovicha
Copy link
Member

The bug was introduced with aiidalab/aiidalab@3f4f4ff .

@csadorf do you have an idea of what exactly caused this bug?

@yakutovicha
Copy link
Member

pytest-tornasync wasn't installed before this PR.

@csadorf
Copy link
Member Author

csadorf commented Oct 12, 2020

@yakutovicha I'm still investigating, however the problem is not that we changed our requirements with respect to pytest-tornasync, the problem is that it is somehow registered as a pytest plugin, but not actually installed. And we can't properly install it due to our tornado restriction.

@csadorf
Copy link
Member Author

csadorf commented Oct 12, 2020

The issue can be resolved by reverting the change to the jupyter_server requirement:

diff --git a/requirements.txt b/requirements.txt
index e12e513..1498fba 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -103,7 +103,7 @@ jsonextended==0.7.11
 jsonschema==3.2.0
 jupyter-client==6.1.7
 jupyter-core==4.6.3
-jupyter-server==1.0.4
+jupyter-server==0.1.1
 jupyterlab-pygments==0.1.2
 jupyterlab-server==1.3.0rc0
 jupyterlab==2.3.0a0

The issue is likely caused by the following commit on the jupyter_server repository: jupyter-server/jupyter_server@45742d9
I assume that jupyter_server version 0.2.1 is probably safe.

@yakutovicha yakutovicha transferred this issue from aiidalab/aiidalab-docker-stack Oct 12, 2020
@yakutovicha
Copy link
Member

Adress when the CasperWA/voila-optimade-client#183 issue is fixed.

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

Successfully merging a pull request may close this issue.

2 participants