pyradiomics
pyradiomics copied to clipboard
Defer numpy import on first pass of setup.py
This PR addresses #653 by ensuring that numpy
is not required on the first pass of setup.py
. This makes pyradiomics
easy to install into new virtual environments without having an a priori installation of numpy.
The update is based on the fact that setuptools invokes setup.py
multiple times, and on the first pass, you must guard import statements of modules in the setup_requires
section. We can therefore mock out the numpy
module on the first pass, which should not affect the subsequent installation steps after the build system has fetched numpy and installed it.
Current CI failures are due to flake8 linting of labs/pyradiomics-dcm/pyradiomics-dcm.py -- unrelated to this change
Can you rebase on PR #788? This allows me to see if your changes do not break the build process.
@JoostJM All set -- this PR is now just one commit ahead of JoostJM/circle-ci-mac-os
I have only recently finished the updates to get CI working again. Involved not only a transition to different CI servers, but also a transition of testing package...
I'm about to make a new release (3.1.0). If you can rebase one more time on the new release (should not break much), then I'll create release 3.1.1 once this PR is merged. I don´t want to wait with release 3.1.0, as it is already long overdue.
In addition, as you can see in #807, adding the pyproject.toml also fixes this particular error. I think your issue will therefore be resolved upon the 3.1.0 release. In any case, I'm still planning to include this PR in a 3.1.1 release.