Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purepng 0.2.0 outputs confusing errors #22

Open
brechtm opened this issue Feb 22, 2017 · 0 comments
Open

purepng 0.2.0 outputs confusing errors #22

brechtm opened this issue Feb 22, 2017 · 0 comments

Comments

@brechtm
Copy link

brechtm commented Feb 22, 2017

If Cython is not installed when installing purepng, the Cythonized extension is not installed and the following errors are output:

ERROR:root:Error during import of compiled filters!
ERROR:root:No module named 'png.pngfilters'
ERROR:root:Fallback to pure python mode!

There's no option to suppress these errors. This is very confusing when purepng is being used as a dependency in another application (such as rinoh). "ERROR" makes users think that things are going wrong, where in fact there is not really a problem since rinohtype doesn't even make use of the filters.

If I try to reinstall purepng after installing Cython, the errors will persist. This is because recent pip versions build wheels during installation and cache them, and thus the Cythonized extension will not be installed. This can be sidestepped by passing the --no-cache-dir option to pip install.

You could perhaps not output these error messages and define extras_require in setup.py. This way, projects depending on purepng can ensure that the cythonized extension is installed. For example add to setup.py: extras_require = {'accelerated': ['Cython']}. With this in place, specifying 'purepng>=0.2.0' in another project's install_requires will not install Cython. Specifying 'purepng[accelerated]>=0.2.0' will.

On a sidenote, I realize that packaging extensions is a PITA, so I'm considering shipping a bare-bones version of png.py with rinohtype. That will avoid any problems with purepng installation. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant