Skip to content

Require numpy for more than tests, libary doesn't work without it#146

Merged
kyamagu merged 1 commit into
skia-python:masterfrom
alerque:deps
Aug 10, 2021
Merged

Require numpy for more than tests, libary doesn't work without it#146
kyamagu merged 1 commit into
skia-python:masterfrom
alerque:deps

Conversation

@alerque

@alerque alerque commented Aug 7, 2021

Copy link
Copy Markdown
Contributor

The C++ code includes pybind11 bindings that assume numpy is loaded in the Python environment. It is listed as a dependency to run tests already, but the library is essentially useless without it (Canvas, Image, Matrix, Pixmap, Surface, and utils all use it).

See for example what happens if you don't have it:

>>> import skia
>>> skia.Surface(100, 100)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

Rather than expect downstream projects to compensate I think the right fix is to call it out here.

@kyamagu

kyamagu commented Aug 10, 2021

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

@kyamagu kyamagu merged commit 41b600b into skia-python:master Aug 10, 2021
@alerque alerque deleted the deps branch August 10, 2021 08:12
@kyamagu kyamagu mentioned this pull request Sep 6, 2021
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

Successfully merging this pull request may close these issues.

2 participants