Open kloczek opened 2 years ago
Here is pytest output:
python3 -sBm build -w --no-isolation
I'm getting python3: No module named build
here. I believe nbconvert >= 7.0.0 is supposed to be built with hatch.
Also, installing from wheel means tests are removed from the installed files (#1822). This causes problems with some tests like test_convert_full_qualified_name
, which tries to import nbconvert.tests.fake_exporters.MyExporter
. That class is not part nbconvert's wheel however, so it raises an error. The solution I got before was installing nbconvert in --editable
mode, which mantains the test files (and MyExporter
).
We should try another solution, maybe moving MyExporter
to another module, outside nbconvert, for example.
I'm getting
python3: No module named build
here. I believe nbconvert >= 7.0.0 is supposed to be built with hatch.
This module is not part of python. It is provided by pypi https://pypi.org/project/build/
Yeah, I feel dumb now... but yeah, the resulting wheel from build
is equivalent to the one from hatch
.
There are two groups of errors here. The ones from nbconvert/tests/test_nbconvertapp.py
don't have enough information, but they seem to be mostly related to the exporters, which are also the root cause for errors in nbconvert/exporters/tests/test_*.py
. The exporters can't find the templates (from share/templates), but these are part the built wheel and should be installed in $VIRTUAL_ENV/share/jupyter/nbconvert/templates
or something like that. How are you installing the package?
Yeah, I feel dumb now... but yeah, the resulting wheel from
build
is equivalent to the one fromhatch
.
This is because build
provides generic methos of calling pep517
.
OK so you been able to reporoduce that issue (which is good).
OK so you been able to reporoduce that issue (which is good).
Oh sorry, I couldn't reproduce these issues. Specifically, I couldn't reproduce an installation without the template files.
Oh sorry, I couldn't reproduce these issues. Specifically, I couldn't reproduce an installation without the template files.
Did you just install modulu in python tree (from root account) or did you try to install it in </install/refix and than alter PYTHONPATH as I did? Sorry for asking but you are giving me kind of contradicting signals ..
Sorry, I got confused there. But nbconvert search for templates in JUPYTER_PATH, not in PYTHONPATH. Have you tried setting that?
`PYTHONPATH' it is env variable used by python. https://www.tutorialspoint.com/What-is-PYTHONPATH-environment-variable-in-Python
Oh sure, but PYTHONPATH is for libraries. Templates are not really libraries, so they use a different variable, JUPYTER_PATH.
Just back to this ticket. Issue is that there is no any templates in source tree.
Yes, the templates are installed in </install/prefix>
, but since you calling /usr/bin/python
(from /usr/bin/pytest
) they cannot be found. The ideal solution here is to use a pytest version installed in </install/prefix>
.
That said, you can try to manually set JUPYTER_PATH to </install/prefix>/share/jupyter/
. Considering your output, the command should be something like:
PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-nbconvert-7.0.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-nbconvert-7.0.0-2.fc35.x86_64/usr/lib/python3.8/site-packages JUPYTER_PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-nbconvert-7.0.0-2.fc35.x86_64/usr/share/jupyter/:/home/tkloczko/rpmbuild/BUILDROOT/python-nbconvert-7.0.0-2.fc35.x86_64/usr/share/jupyter/ /usr/bin/pytest -ra
That said, you can try to manually set JUPYTER_PATH to
</install/prefix>/share/jupyter/
. Considering your output, the command should be something like:
It does not work. I've added in my spec file
%check
export JUPYTER_PATH=%{buildroot}%{_datadir}/jupyter/nbconvert
%pytest
and result is
Sorry, the path should end in share/jupyter/
, without nbconvert
. So, JUPYTER_PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-nbconvert-7.2.1-2.fc35.x86_64/usr/share/jupyter/
.
Updated list of failing units with $JUPYTER_PATH env variable for 7.2.5
FYI: I've added list of currently failing units to --deselect list to have wortking baseline and assuming that it is still some set of test suite issues.
Updated list of failing units with $JUPYTER_PATH env variable for 7.2.5
I back again nbconvert
trying updated to 7.3.1.
It was my failt in $JUPYTER_PATH. After add proper value of that env variable I have now only 4 units failing
Here is list of installed modules in build env
Looking on pytest output I thin ktaht it woild be good to move nbconvert/tests/ content to tests/ an remove all relative imports beczause seems like thi is now disturbin "test as installed" procedure.
Once #2108 lands, I believe the remaining errors here will be taken care of, is that right?
I'm packaging 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.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesLooks like in such scenatio test suite is checking only in exact paths templates files and by this many units are failing IMO it would be good to add some env variable over which would be possible to access to installed in </install/prefix> templates.