-
-
Notifications
You must be signed in to change notification settings - Fork 789
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 build dependencies to meta.yaml #2132
Conversation
Also removes the circular dependency issue manual workaround. Do we really need "run" dependencies at all, though? Once the wheel is built, can't it just You'd still need a few pure python packages needed for building, like |
Yeah @henryiii that is the direction I was thinking of going as well. If a package is pure Python and we don't have to patch it we shouldn't have to build it. Ideally we could still do "static" ahead of time dependency resolution, but I was thinking we should just add something like |
To get the dependencies you need to download the wheel, so it's less efficient than having a separate metadata file since then you cannot download the dependencies in parallel. Also,
I see what you mean. We could also indeed indicate in some way in meta.yaml that the dependency should to be fetched from PyPi directly, say,
as long as there is an entry in
+1 but I also also a slightly different use case of packaging apps, as opposed to using the default distribution say in a REPL. |
If implemented, please use conda's syntax for that! requirements:
run:
- numpy
- matplotlib
- sympy
- pip:
- another_package (This is mostly from environment.yml's syntax, but we could use it here). Though I think it would be better to use |
This does still add a lot of maintenance work. Probably what we should do is only list dependencies as an override for what's in install_requires. Perhaps we could have a key to add extra stuff like distlib and another key to replace the install_requires entirely?
Well aside from test unvendoring I'm not clear it makes a huge difference at runtime whether the package is downloaded from our cdn or from pypi. The main issue is just that the dependencies need to be recorded ahead of time so that they can all be downloaded at the same time. |
Another reason why this wouldn't work is that for partial builds. When the user asks to build a single package, we need to know if any of its dependencies also need to be built, even if the package doesn't depend on them on build time. For instance there are a number of packages that have As far as I understand, with respect to build isolation added by @hoodmane,
|
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.
Thanks for working on this @rth.
As I said I think the correct setup would be:
- libraries should only be
host
dependencies, neverrun
orbuild
dependencies - shared libraries should always be both
host
andrun
dependencies but neverbuild
dependencies - Python packages can be
run
dependencies. If they are needed at build time, they should behost
dependencies ifcross-build-env: true
, in other cases they should bebuild
dependencies.
I think one conclusion from this is that it is possible to programmatically determine whether a package should be a host
or a build
dependency, though it's probably better to separate them since they are conceptually and practically distinct.
Then probably we should also raise error when a Python package is specified as a |
Yes. I think a subsequent PR should add |
I am a little bit confused. What do we specify for |
That's a fair point. Usually but not always. Some packages conditionally recythonize only if Cython is already available. Sometimes setuptools releases a regression that breaks matplotlib builds. Also, there is something weird with |
@rth Can we merge this? It seems like a nice improvement and CI passes. |
Thanks for the review! I'll try to get this done this week.
I realized there is still some issue with |
I think it works correctly. It is expected behavior that |
@rth It would be great if we can merge this before we get more packages. I think this worked correctly before and it will unless I broke anything during fixing merge conflicts. |
Thanks for continuing it @ryanking13 ! Agreed, the reason it was still not merged is that I was not 100% confident it would work as expected in all edge cases, the test suite on dependency resolution doesn't really cover all the cases in the real dependency tree (it's hard to do so) and rebuilding the full tree to test this was a bit frustrating. But overall yes, let's merge, it's rather low risk. If there are any issues with partial builds we discover later, we still have plenty of time to fix those before the next release. |
Yes, probably there can be some packages that we didn't correctly checked host dependencies, but we can discover it later. |
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.
The remaining test error comes from #2975
This adds build dependencies to
meta.yaml
(or host dependencies in conda vocabulary). The end goal is faster parallel builds as there would be fewer dependency tree bottlenecks and sometimes fewer runtime dependencies overall (since we are currently mixing both).Closes #1476
TODO: