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

Defer numpy import on first pass of setup.py #761

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

masalim2
Copy link

@masalim2 masalim2 commented Apr 8, 2022

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.

@masalim2 masalim2 force-pushed the 653-numpy-required-in-setup branch 2 times, most recently from 7473d5b to 8cd539c Compare April 8, 2022 19:25
@masalim2
Copy link
Author

masalim2 commented Apr 8, 2022

Current CI failures are due to flake8 linting of labs/pyradiomics-dcm/pyradiomics-dcm.py -- unrelated to this change

@JoostJM
Copy link
Collaborator

JoostJM commented Sep 20, 2022

Can you rebase on PR #788? This allows me to see if your changes do not break the build process.

@masalim2
Copy link
Author

@JoostJM All set -- this PR is now just one commit ahead of JoostJM/circle-ci-mac-os

@JoostJM
Copy link
Collaborator

JoostJM commented May 17, 2023

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.

@JoostJM
Copy link
Collaborator

JoostJM commented May 17, 2023

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.

@masalim2 masalim2 force-pushed the 653-numpy-required-in-setup branch from f6a7d41 to 00c8ec5 Compare May 22, 2023 14:09
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