-
Notifications
You must be signed in to change notification settings - Fork 423
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
Be more explicit when numpy version is included in dependency specs in metadata #573
Conversation
|
@pelson I know you had some thoughts on this. |
|
There are some tests that need to be fixed. |
|
Looks like these were broken when we removed np from the build string. #576. The tests just need to be modified. |
Be more explicit when numpy version is included in dependency specs in metadata
|
Perfect. This was one of the hard parts of me trying to remove the bit of conda-build which knows about python, numpy etc. Next steps for me would be to try to have some form of automatic build string extension which does https://github.com/conda/conda-build/blob/master/conda_build/metadata.py#L431. Incidentally, you might both be interested in my hacky way of defining a |
| else: # regular version | ||
| return ms | ||
|
|
||
| if ver is None or (ms.strictness == 1 and ms.name == '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.
Any clue what the special case is for?
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.
What special case? The new function handle_config_version() is full of special cases, which is why add separated it out, in order to write extensive tests for it: https://github.com/conda/conda-build/blob/master/tests/test_metadata.py#L34
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.
...ms.name == 'numpy'):
The numpy part. It is the only place where a package name is important in the function.
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.
Incidentally, I noticed there isn't a test for the '<name> x.x' with version as None case in those tests. Can that ever occur?
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.
I agree it shouldn't be special-cased.
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.
Well if we don't special case numpy, i.e. make requiring the x.x when the version is important, then every time you have a python dependency, you have to say python x.x, which would break almost all existing recipes.
|
Can you give any guidance on how to reformat recipes that build against the numpy C API to work as they did before (that is, being built against particular versions of numpy, and having that numpy version reflected in the build string like to but this doesn't appear to set the build string -- for example |
|
I use the following workaround (needs the CONDA_NPY to be set, I've not tested it with the --numpy flag): It's the only way I've found to bind the environment variable with the specified version. With that solution the build string also works as expected including the NumPy tag. |
Currently, it is only possible to create a conda package, that just depends on
numpy, by unsettingCONDA_NPY(and not using the--numpyoption). One can build two different packages depending on this setting (outside the recipe), which is undesirable.This PR makes the numpy version being included in dependency specs in metadata much more explicit. Listing just
numpyas the runtime dependency, will always result in just that (settingCONDA_NPYwon't change that. In order to make a recipe independent of the numpy version actually set, one listsnumpy x.xas a dependency, which will require usingCONDA_NPYor--numpy.Also, we add a new function,
handle_config_version()to handle the confusing logic, as well as tests for this new function.