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
Add numpy as setup requirement #67
Conversation
It looks like you could use this same technique in |
@vincentsarago suggested a generator instead of a class, and it seems to work fine as well |
setup.py
Outdated
|
||
def __str__(self): | ||
import numpy | ||
return numpy.get_include() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the class
is overpriced!
a simple function should be enough
def get_numpy_include():
import numpy
yield numpy.get_include()
and the in the setup() do
include_dirs=[get_numpy_include()],
setup_requires=["numpy"],
🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:homer:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to make rasterio more like this PR. Instead we want to make this project more like rasterio. See #64 😄
I'm happy to discuss this more but we're not going to merge this PR. The big blocker right now is #65 and my lack of time to review #66. However, I can see the light at the end of the tunnel. |
@vincentsarago @kylebarron since you're writing packages that depend on rio-color and have conda users, it could be good to add rio-color to conda-forge. I think they have good instructions and examples, shouldn't be too hard. |
I see... I personally get very frustrated dealing with Conda packaging. Someone made a Conda release of |
@sgillies I'm not sure to fully understand the |
Correct @vincentsarago . 1.0.0 did not specify build dependencies, but 1.0.1 will. The thing that's blocking me from releasing 1.0.1 is lack of working wheel building infra. If I made a source-only 1.0.1 release, this tracker would fill up with "I can't install 1.0.1" issues. |
🙏 thanks @sgillies |
I'll just ping @jacquestardie so he finds some time for you then! |
@vincentsarago ping him hourly! |
We got a downstream bug report of
rio-color
's install failing because the user didn't havenumpy
installed when he tried to installrio-color
, so the headers couldn't be found.This is a bit of a chicken-and-egg issue, because the numpy headers are needed to build, but you can't find them before installing numpy. This PR uses a technique I learned from
pybind11
(though I can't find now exactly where in the documentation it was referenced), which uses a class to postpone finding numpy's headers until numpy is installed.Tested locally (using conda just to create a virtual env):
Setup:
Before:
After, creating the wheel works.