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

Pin numpy version at build to handle Numpy's API change in v1.20 #474

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

jpauwels
Copy link
Contributor

@jpauwels jpauwels commented May 6, 2021

Changes proposed in this pull request

The C-API change in Numpy v1.20 has the potential to cause incompatibility issues, as seen in #469 (comment).

This happens when a user hasn't upgraded yet to Numpy 1.20 (or can't upgrade, e.g. because of apt-get availability or pinned due to Tensorflow requirements). Because the build requirement in pyproject.toml is an unversioned numpy, it will pull in the latest >=1.20 version and build madmom against it, which gives problems when running with the <1.20 version because the latter is not forward compatible.

Numpy's C-API is forward compatible though, so the solution is to pin the build version at a low enough version, it doesn't matter if this version is lower than the version used at runtime. You could do this per Python version, as is currently done in pyproject.toml, but there even is a meta-package for this since it's a common problem. Using the meta-package also makes the solution robust against future Python versions, so that's what I did for this PR.

I also snuck in an unrelated warning fix that will become an error in Python 3.10 (due in October).

@superbock
Copy link
Collaborator

Thanks for the fix! I was not aware of this rather elegant fix :)

@superbock superbock added this to the 0.17 milestone Jun 12, 2021
@mohkoma
Copy link

mohkoma commented Jul 23, 2021

Is there any update yet? as you said Tensorflow require < 1.20 version.
Thanks!

@faroit
Copy link

faroit commented Aug 23, 2021

@superbock this issue is blocking a JOSS review in progress openjournals/joss-reviews#3391 and prevents one of the reviewers (@keunwoochoi) to evaluate the performance of the software. It would be great if a new madmom release can be put out soon! Thanks for your great work

@keunwoochoi
Copy link

Thank you all!

@jpauwels jpauwels deleted the pin-numpy branch August 23, 2021 17:42
@faroit
Copy link

faroit commented Dec 7, 2021

@superbock could you issue a new madmom pypi release with this change included to help dependencies resolving? 🙏

@samuelbradshaw
Copy link

Hi! It looks like this was merged a couple of years ago, but there hasn't been a release since. Is there a madmom release planned soon?

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.

6 participants