MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

0.16.0: pytest is failing

Open kloczek opened this issue 3 years ago • 0 comments

Describe the bug

context I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

expectation pytest should not fail.

bug pytest is failing not able locate myst_parser.config module Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --deselect tests/test_eval.py::test_sphinx --deselect tests/test_execute.py::test_complex_outputs_unrun_auto --deselect tests/test_execute.py::test_complex_outputs_unrun_cache --deselect tests/test_execute.py::test_custom_convert_auto --deselect tests/test_execute.py::test_custom_convert_cache --deselect tests/test_glue.py::test_parser
==================================================================== test session starts =====================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/MyST-NB-0.16.0, configfile: tox.ini
plugins: anyio-3.6.1, datadir-1.3.1, regressions-2.3.1, pytest_param_files-0.3.4
collected 26 items / 4 errors / 2 deselected / 24 selected

=========================================================================== ERRORS ===========================================================================
_____________________________________________________________ ERROR collecting tests/test_cli.py _____________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/MyST-NB-0.16.0/tests/test_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_cli.py:7: in <module>
    from myst_nb.cli import md_to_nb, quickstart
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/cli.py:10: in <module>
    from .core.config import NbParserConfig
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/core/config.py:6: in <module>
    from myst_parser.config.dc_validators import (
E   ModuleNotFoundError: No module named 'myst_parser.config'
__________________________________________________________ ERROR collecting tests/test_docutils.py ___________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/MyST-NB-0.16.0/tests/test_docutils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_docutils.py:11: in <module>
    from myst_nb.docutils_ import Parser
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/docutils_.py:16: in <module>
    from myst_parser.config.main import MdParserConfig, merge_file_level
E   ModuleNotFoundError: No module named 'myst_parser.config'
___________________________________________________________ ERROR collecting tests/test_execute.py ___________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/MyST-NB-0.16.0/tests/test_execute.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_execute.py:8: in <module>
    from myst_nb.core.execute import ExecutionError
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/core/execute/__init__.py:6: in <module>
    from .base import ExecutionError, ExecutionResult, NotebookClientBase  # noqa: F401
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/core/execute/base.py:11: in <module>
    from myst_nb.core.config import NbParserConfig
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/core/config.py:6: in <module>
    from myst_parser.config.dc_validators import (
E   ModuleNotFoundError: No module named 'myst_parser.config'
_______________________________________________________ ERROR collecting tests/test_render_outputs.py ________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/MyST-NB-0.16.0/tests/test_render_outputs.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_render_outputs.py:4: in <module>
    from myst_nb.core.render import EntryPointError, load_renderer
../../BUILDROOT/python-myst-nb-0.16.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/core/render.py:23: in <module>
    from myst_parser.config.main import MdParserConfig
E   ModuleNotFoundError: No module named 'myst_parser.config'
================================================================== short test summary info ===================================================================
ERROR tests/test_cli.py
ERROR tests/test_docutils.py
ERROR tests/test_execute.py
ERROR tests/test_render_outputs.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================== 2 deselected, 4 errors in 0.62s ===============================================================

I don't see 'myst_parser.config' in 0.17.2 which I'm using.

Reproduce the bug

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

List your environment

List of modules installed in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
anyio                         3.6.1
appdirs                       1.4.4
argon2-cffi                   21.1.0
asttokens                     2.0.5
attrs                         21.4.0
Babel                         2.10.1
backcall                      0.2.0
beautifulsoup4                4.10.0
bleach                        5.0.0
Brlapi                        0.8.3
build                         0.8.0
cffi                          1.15.0
charset-normalizer            2.0.12
click                         8.1.2
coconut                       1.6.0
codespell                     2.1.0
colorama                      0.4.4
cPyparsing                    2.4.7.1.1.0
cycler                        0.11.0
debugpy                       1.6.0
decorator                     5.1.1
defusedxml                    0.7.1
distro                        1.7.0
docutils                      0.17.1
entrypoints                   0.4
executing                     0.8.3
extras                        1.0.0
fastjsonschema                2.15.3
fixtures                      4.0.0
flit_core                     3.7.1
fonttools                     4.33.3
gitdb                         4.0.9
GitPython                     3.1.27
gpg                           1.17.1-unknown
greenlet                      1.1.2
html5lib                      1.1
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.11.3
importlib-resources           5.7.1
iniconfig                     1.1.1
ipykernel                     6.13.0
ipython                       8.4.0
ipython-genutils              0.2.0
ipywidgets                    7.7.0
jedi                          0.18.1
Jinja2                        3.1.1
jsonschema                    4.5.1
jupyter-cache                 0.5.0
jupyter-client                7.3.4
jupyter-core                  4.10.0
jupyter-server                1.17.0
jupyter-server-mathjax        0.2.5
jupyter-sphinx                0.3.2
jupyterlab-pygments           0.1.2
jupytext                      1.13.7
kiwisolver                    1.4.3
libcomps                      0.1.18
lit                           14.0.4
louis                         3.21.0
lxml                          4.9.0
markdown-it-py                2.1.0
MarkupSafe                    2.1.1
matplotlib                    3.5.2
matplotlib-inline             0.1.3
mdit-py-plugins               0.3.0
mdurl                         0.1.1
mistune                       2.0.2
mpmath                        1.2.1
myst-parser                   0.17.2
nbclient                      0.6.3
nbconvert                     6.5.0
nbdime                        3.1.1
nbformat                      5.4.0
nest-asyncio                  1.5.5
notebook                      6.4.11
numpy                         1.22.4
olefile                       0.46
packaging                     21.3
pandas                        1.4.2
pandocfilters                 1.5.0
parso                         0.8.3
pbr                           5.8.1
pep517                        0.12.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.1.1
pip                           22.0.4
pluggy                        1.0.0
ply                           3.11
prometheus-client             0.14.1
prompt-toolkit                3.0.29
psutil                        5.9.0
ptyprocess                    0.7.0
pure-eval                     0.2.2
py                            1.11.0
pycparser                     2.21
pydata-sphinx-theme           0.9.0
Pygments                      2.12.0
PyGObject                     3.42.1
pyparsing                     3.0.9
pyrsistent                    0.18.1
pytest                        7.1.2
pytest-datadir                1.3.1
pytest_param_files            0.3.4
pytest-regressions            2.3.1
python-dateutil               2.8.2
pytz                          2022.1
PyYAML                        6.0
pyzmq                         23.1.0
requests                      2.28.0
rpm                           4.17.0
scour                         0.38.2
Send2Trash                    1.8.0
setuptools                    62.3.4
six                           1.16.0
smmap                         5.0.0
sniffio                       1.2.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        5.0.1
sphinx-book-theme             0.3.2
sphinx-copybutton             0.4.0
sphinx_design                 0.1.0
sphinx-togglebutton           0.3.1
sphinxcontrib-applehelp       1.0.2.dev20220410
sphinxcontrib-devhelp         1.0.2.dev20220410
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220410
sphinxcontrib-qthelp          1.0.3.dev20220410
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy                    1.4.37.dev0
stack-data                    0.2.0
sympy                         1.10.1
tabulate                      0.8.9
terminado                     0.13.3
testtools                     2.5.0
tinycss2                      1.1.1
toml                          0.10.2
tomli                         2.0.1
tornado                       6.1
traitlets                     5.2.2
typing_extensions             4.2.0
urllib3                       1.26.9
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.3.2
wheel                         0.37.1
widgetsnbextension            3.6.0
zipp                          3.8.0

kloczek avatar Jun 13 '22 18:06 kloczek