BlueBrain / nmodl

Code Generation Framework For NEURON MODeling Language
https://bluebrain.github.io/nmodl/
Apache License 2.0
57 stars 15 forks source link

Don't hide Python failure output when searching for packages #1058

Open matz-e opened 1 year ago

matz-e commented 1 year ago

I had the following error today:

-- Found PythonInterp: /gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_externals/install_gcc-12.2.0-skylake/python-3.10.8-rvn6l5/bin/python3.10 (found suitable version "3.10.8", minimum required is "3.8") 
CMake Error at cmake/hpc-coding-conventions/cpp/cmake/bbp-find-python-module.cmake:64 (message):
  Missing python module "jinja2"
Call Stack (most recent call first):
  CMakeLists.txt:166 (cpp_cc_find_python_module)

-- Configuring incomplete, errors occurred!

but jinja2 was in PYTHONPATH. The real error happened upon import of jinja2:

❯ python -c "import jinja2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/gpfs/bbp.cscs.ch/home/matwolf/work/bsd-343/install/install_gcc-12.2.0-skylake/py-jinja2-35dgcn/lib/python3.10/site-packages/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/gpfs/bbp.cscs.ch/home/matwolf/work/bsd-343/install/install_gcc-12.2.0-skylake/py-jinja2-35dgcn/lib/python3.10/site-packages/jinja2/environment.py", line 15, in <module>
    from jinja2 import nodes
  File "/gpfs/bbp.cscs.ch/home/matwolf/work/bsd-343/install/install_gcc-12.2.0-skylake/py-jinja2-35dgcn/lib/python3.10/site-packages/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "/gpfs/bbp.cscs.ch/home/matwolf/work/bsd-343/install/install_gcc-12.2.0-skylake/py-jinja2-35dgcn/lib/python3.10/site-packages/jinja2/utils.py", line 642, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-markupsafe-2.1.1-d4uhr4/lib/python3.10/site-packages/markupsafe/__init__.py)

It would have been very helpful and saved a bunch of time if nmodl would not hide the errors that occur when looking for Python modules.

pramodk commented 1 year ago

It would have been very helpful and saved a bunch of time if nmodl would not hide the errors that occur when looking for Python modules.

By the way, we just use
https://github.com/BlueBrain/nmodl/blob/a309bc156f5a9232f340cb0d7fa8a1f8ee3e9942/CMakeLists.txt#L166 from hpc-conding-convention https://github.com/BlueBrain/hpc-coding-conventions/blob/a37793313ebd9a69cd96e4cf6d3183fa51b81c33/cpp/cmake/bbp-find-python-module.cmake#L3