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

Continuous integration build fails because numpy is missing. #65

Closed
lorenzocestaro opened this issue Dec 18, 2018 · 10 comments
Closed

Continuous integration build fails because numpy is missing. #65

lorenzocestaro opened this issue Dec 18, 2018 · 10 comments

Comments

@lorenzocestaro
Copy link

lorenzocestaro commented Dec 18, 2018

Hi @r9y9,

I am building building a project which has pysptk as a dependency and my builds are failing because the setup.py script requires numpy as a dependency.

For my CI, I can use an easy workaround and install numpy previous to running my project's pip install. Anyway this could create problems for production builds (e.g. docker) and usability problems in general.

I think this could be easily fixed using the setup_requires in your setup.py. Search for setup_requires here.

I am willing to look into this and eventually submit a PR if you want.

@r9y9
Copy link
Owner

r9y9 commented Dec 18, 2018

Hi, thank you for the suggestion. That sounds good to me. Could you send a PR for it?

@lorenzocestaro
Copy link
Author

Sure, I'll get to work

@lorenzocestaro
Copy link
Author

lorenzocestaro commented Dec 18, 2018

Ok, so I looked into this and it appears that setup_requires is incompatible with pip right now and the problem of the missing numpy installation is unavoidable when building from source.
See also this discussion for the exact same issue on scikit-learn.

What is avoidable, though, is having end users being unable to install the package if they do not have numpy in their environment. This can be fixed by publishing a wheel instead of a source bundle (or both) when releasing new versions:

  • python setup.py sdist forces end users to build from source and raises an error if numpy is missing.
  • python setup.py bdist_wheel will produce a pip wheel that takes care of installing all dependencies under install_requires and wil not produce errors for end users when pip install pysptk is run.

You can build and upload to pypi both of them with python setup.py sdist bdist_wheel.

Hope I've been clear.

@r9y9
Copy link
Owner

r9y9 commented Jan 3, 2019

I used to provide wheels for earlier releases (e.g., see https://pypi.org/project/pysptk/0.1.3/#files), but as far as I remember correctly there's a binary compatibility issue(s) for linux and also I didn't want to create wheels for each python/os environments, so I end up with the source distribution. I hope there's a clean and simple solution to this.

@lorenzocestaro
Copy link
Author

If that's the case then I am afraid there is no seamless solution. Everyone who needs to install the package will need to have numpy already installed in their environment.

Thanks @r9y9

@r9y9
Copy link
Owner

r9y9 commented Jan 3, 2019

I know pyworld (https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder/blob/823e9bda5f2b5bc4e10e2ff44534aa87073250cb/setup.py#L25-L31) avoids the numpy build-time dependency in a tricky way. I'm not sure if it really works or not, but I will look into it.

EDIT: Sorry for the late reply.

r9y9 added a commit that referenced this issue Jan 8, 2019
@r9y9 r9y9 closed this as completed in #67 Jan 8, 2019
r9y9 added a commit that referenced this issue Jan 8, 2019
Fix #65 avoid build-time numpy dependency
@r9y9 r9y9 reopened this Jan 8, 2019
@r9y9
Copy link
Owner

r9y9 commented Jan 8, 2019

I've tagged a new release v0.1.15. I believe this should fix the issue. For double-check, @lorenzocestaro Could you please confirm if it works?

@lorenzocestaro
Copy link
Author

@r9y9 installation work seamlessly now. Thank you very much!

Unfortunately this new version breaks my tests, I will look into that to see if it is a problem on my side.

@r9y9
Copy link
Owner

r9y9 commented Jan 9, 2019

Thanks! If you provide me code to reproduce the test failures, I can take a look. Let me know if you need a help.

@r9y9
Copy link
Owner

r9y9 commented Mar 30, 2019

I'm closing this out. Feel free to reopen if the problem persists.

@r9y9 r9y9 closed this as completed Mar 30, 2019
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

No branches or pull requests

2 participants