KhronosGroup / NNEF-Tools

The NNEF Tools repository contains tools to generate and consume NNEF documents
https://www.khronos.org/nnef
222 stars 57 forks source link

Fix numpy dependency #164

Closed mt-krainski closed 1 year ago

mt-krainski commented 1 year ago

Taking over https://github.com/KhronosGroup/NNEF-Tools/pull/158.

This fixes the installation process so that installing nnef-tools will now also install numpy as it is a build and runtime dependency. This can now be installed in virtual environments without manually specifying the dependency on numpy as well as with other package managers e.g. poetry.

I locked the numpy version to be above 1.13 because that's when __NUMPY_SETUP__ became deprecated. If this was to support older versions of numpy, we'd have to add a try-except block to check for __NUMPY_SETUP__ in finalize_options. We can also lock the version higher.

setup_requires is required, without it the build doesn't work - I think with setup_required, numpy is installed before building nnef-tools. Without it it might be installed after.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

gyenesvi commented 1 year ago

@mt-krainski, so this is to replace #158 right? I like this solution, it looks cleaner to me. So if we merge this one, we can drop the other one, right?

mt-krainski commented 1 year ago

That is correct!