openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

E ModuleNotFoundError: No module named 'six' #176

Closed malaterre closed 2 years ago

malaterre commented 2 years ago

For some reason jpylyzer does not build anymore on Debian:

> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> dh_auto_build
> dh_auto_build: warning: Compatibility levels before 10 are deprecated (level 9 in use)
> I: pybuild base:237: /usr/bin/python3 setup.py build 
> running build
> running build_py
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/byteconv.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/__main__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/shared.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/jpylyzer.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/mix.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/boxvalidator.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/config.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> copying jpylyzer/etpatch.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/jpylyzer
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests
> copying tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/unit
> copying tests/unit/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/unit
> copying tests/unit/test_jpylyzer.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/unit
> (cd doc && pandoc -s --toc --toc-depth=2 -N --top-level-division=chapter --pdf-engine=xelatex -o jpylyzerUserManual.pdf jpylyzerUserManual.md)
> [WARNING] Note with key '2' defined at line 2280 column 1 but not used.
> [WARNING] Missing character: There is no ∑ (U+2211) (U+2211) in font [lmroman10-regular]:mapping=t
> [WARNING] Missing character: There is no ≤ (U+2264) (U+2264) in font [lmroman10-regular]:mapping=t
> [WARNING] Missing character: There is no ≥ (U+2265) (U+2265) in font [lmroman10-regular]:mapping=t
> [WARNING] Missing character: There is no ≥ (U+2265) (U+2265) in font [lmroman10-regular]:mapping=t
> [WARNING] Missing character: There is no ≤ (U+2264) (U+2264) in font [lmroman10-regular]:mapping=t
> [WARNING] Missing character: There is no ≥ (U+2265) (U+2265) in font [lmroman10-regular]:mapping=t
> [WARNING] Missing character: There is no ≥ (U+2265) (U+2265) in font [lmroman10-regular]:mapping=t
> (cd doc && pandoc -o jpylyzerUserManual.txt jpylyzerUserManual.md)
> [WARNING] Note with key '2' defined at line 2280 column 1 but not used.
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
>    dh_auto_test -O--buildsystem=pybuild
> dh_auto_test: warning: Compatibility levels before 10 are deprecated (level 9 in use)
> I: pybuild base:237: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest tests
> ============================= test session starts ==============================
> platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
> rootdir: /<<PKGBUILDDIR>>
> collected 0 items / 1 error
> 
> ==================================== ERRORS ====================================
> ___ ERROR collecting .pybuild/cpython3_3.9/build/tests/unit/test_jpylyzer.py ___
> ImportError while importing test module '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/unit/test_jpylyzer.py'.
> Hint: make sure your test modules/packages have valid Python names.
> Traceback:
> /usr/lib/python3.9/importlib/__init__.py:127: in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
> tests/unit/test_jpylyzer.py:5: in <module>
>     from jpylyzer.jpylyzer import __version__, checkNullArgs, checkNoInput, \
> jpylyzer/jpylyzer.py:45: in <module>
>     from six import u
> E   ModuleNotFoundError: No module named 'six'
> =========================== short test summary info ============================
> ERROR tests/unit/test_jpylyzer.py
> !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
> =============================== 1 error in 0.06s ===============================
> E: pybuild pybuild:355: test: plugin distutils failed with: exit code=2: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest tests
> dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.9 returned exit code 13
bitsgalore commented 2 years ago

Very odd. I can't reproduce the error as I don't have Python 3.9 installed, but as the offending six module is only used/needed under Python 2.x, I made the import conditional on the Python version, see:

https://github.com/openpreserve/jpylyzer/commit/4e3cd5cc20a462f3cb9da832ae6c2b19c8218379

I just created a 2.0.1 bugfix release for this:

https://github.com/openpreserve/jpylyzer/releases/tag/2.0.1

Let me know if this fixes the issue! If so, I'll also merge these changes into the development branch of the upcoming 2.1 release.

malaterre commented 2 years ago

That worked !

[WARNING] Note with key '2' defined at line 2280 column 1 but not used.
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_auto_test -i -O--buildsystem=pybuild
I: pybuild base:237: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /<<PKGBUILDDIR>>
collected 8 items

tests/unit/test_jpylyzer.py ........                                     [100%]

============================== 8 passed in 0.07s ===============================
   create-stamp debian/debhelper-build-stamp
 fakeroot debian/rules binary-indep
dh binary-indep --with python3 --buildsystem=pybuild
   dh_testroot -i -O--buildsystem=pybuild
   dh_prep -i -O--buildsystem=pybuild
   dh_auto_install -i -O--buildsystem=pybuild
I: pybuild base:237: /usr/bin/python3 setup.py install --root /<<PKGBUILDDIR>>/debian/tmp 
running install

thanks !

bitsgalore commented 2 years ago

Perfect, thanks for confirming this!

bitsgalore commented 2 years ago

Fix for 2.1 dev:

https://github.com/openpreserve/jpylyzer/commit/0b39a2493ac68ee0dd0daabef33d4423c9e198c9