You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyMuPDF/setup.py: PYMUPDF_SETUP_MUPDF_BUILD="", using system mupdf
PyMuPDF/setup.py: mupdf_local=None
PyMuPDF/setup.py: Using system mupdf.
PyMuPDF/setup.py: sys.platform='linux'
Traceback (most recent call last):
File "/usr/src/pymupdf-1.21.0rc2/setup.py", line 724, in
if unix_build_type == 'memento':
NameError: name 'unix_build_type' is not defined. Did you mean: 'unix_build_dir'?
How To Reproduce
Extract PyMuPDF-1.21.0rc2.tar.gz to pymupdf-1.21.0rc2/.
cd pymupdf-1.21.0rc2/
PYMUPDF_SETUP_MUPDF_BUILD='' python setup.py install
I get the error shown above.
Expected behavior
A smooth installation (obvious).
Configuration
Operating system: Gentoo
Python version: 3.10
PyMuPDF version, installation method (wheel or generated from source): source, as shown above. Version: 1.21.0rc2.
Additional context
Looking at the output of setup.py just before the error (see above), we see that it got the PYMUPDF_SETUP_MUPDF_BUILD environment variable:
...using system mupdf
and also that
mupdf_local=None
Looking at the code of setup.py, we see that unix_build_type is computed as
only inside a "if mupdf_local" block - but mupdf_local is None, so the error says the truth, unix_build_type is not defined in that case (i.e. when the user wants to use an already installed mupdf). :-)
Description
PYMUPDF_SETUP_MUPDF_BUILD='' python setup.py install
breaks with the error:
PyMuPDF/setup.py: PYMUPDF_SETUP_MUPDF_BUILD="", using system mupdf
PyMuPDF/setup.py: mupdf_local=None
PyMuPDF/setup.py: Using system mupdf.
PyMuPDF/setup.py: sys.platform='linux'
Traceback (most recent call last):
File "/usr/src/pymupdf-1.21.0rc2/setup.py", line 724, in
if unix_build_type == 'memento':
NameError: name 'unix_build_type' is not defined. Did you mean: 'unix_build_dir'?
How To Reproduce
Extract PyMuPDF-1.21.0rc2.tar.gz to pymupdf-1.21.0rc2/.
cd pymupdf-1.21.0rc2/
PYMUPDF_SETUP_MUPDF_BUILD='' python setup.py install
I get the error shown above.
Expected behavior
A smooth installation (obvious).
Configuration
Additional context
Looking at the output of setup.py just before the error (see above), we see that it got the PYMUPDF_SETUP_MUPDF_BUILD environment variable:
...using system mupdf
and also that
mupdf_local=None
Looking at the code of setup.py, we see that unix_build_type is computed as
only inside a "if mupdf_local" block - but mupdf_local is None, so the error says the truth, unix_build_type is not defined in that case (i.e. when the user wants to use an already installed mupdf). :-)
Solution
Add
unix_build_type = os.environ.get( 'PYMUPDF_SETUP_MUPDF_BUILD_TYPE', 'release')
to the "else" part of that "if", or put it before the "if" block, since it is used in both blocks. Didn't try it (yet), but looks pure logic to me...
The text was updated successfully, but these errors were encountered: