-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve PyVista Dependency: Use vtk-base instead of full VTK #76
base: main
Are you sure you want to change the base?
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
I want to let this sit for a while before we merge. During this time, I'd like to reflect on:
|
I simply want to give this some time for the dust to settle -- otherwise, I'm +1 for this |
It should since the PyPI wheel has FFMPEG disabled |
I can only speak for my situation. I work at Microsoft and our systems are automatically flagging anything that depends on VTK (so PyVista too) because FFMPEG contains the AV1 and VP9 codecs which we cannot install.
There are no ways to ignore hard dependencies. I now realize that because of There are two options:
I think the latter implementation is preferred and I can do the work. This should not affect the users in any way, except they can decide to install |
@basnijholt, thanks for clarifying that.
If it's just If this is a barrier to adoption, I'm all for making Opened pyvista/pyvista#4302 to consider this. |
I agree; we should be able to make imageio a soft dependency in PyVista directly and not need to split this feedstock at all |
Actually, this statement is not correct. ImageIO has two base dependencies: pillow and numpy. Everything else is optional and shouldn't be installed unless you explicitly request it. @basnijholt Could you share how you determined the dependencies? Maybe there is a bug in ImageIO, in which case I would like to fix it sooner rather than later :) On the note of FFMPEG, ImageIO has two plugins that use it as a backend: (1) pyav and (2) imageio-ffmpeg. PyAV is a set of Cython bindings into FFMPEGs C-API and imageio-ffmpeg uses a dedicated binary which is called via subprocesses. Both have a hard dependency on FFMPEG to function correctly, but I know that "how the binary is accessed" is sometimes important in these discussions so highlighting this difference may be useful here. At the same time, both are optional dependencies of ImageIO itself, so unless pyvista has a hard requirement to process video (which I don't think it does) it should be possible to avoid FFMPEG while installing ImageIO as usual. Also, fun fact, the only hard dependency of ImageIO is numpy. ImageIO will be happy as long as there is numpy and at least one backend available. Unfortunately, pip (and I think conda, too) doesn't allow a "default optional dependency", i.e., we can't depend on "at least one dependency from the following list of optional dependencies with some default should a user select none". If we could, we would drop the hard dependency on pillow and make it semi-optional. Since we can't we keep it around to have some means of reading images after installation. To work around this, I have seen people install numpy, perform a bare installation of ImageIO, and then just install the backends they want/need (although this is very rare). To qualify the above statements: I am the primary maintainer of ImageIO :) |
@FirefoxMetzger, after looking at this again, I must have misread this in the My apologies for spreading misinformation 😅 |
@conda-forge-admin, please rerender |
Hi! This is the friendly automated conda-forge-webservice. I tried to rerender for you, but it looks like there was nothing to do. This message was generated by GitHub actions workflow run https://github.com/conda-forge/pyvista-feedstock/actions/runs/4805286039. |
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.
+1 for this! I haven't tested the vtk-base
package myself, so trusting @basnijholt that this is fully compatible
Awesome! So can we merge then? :-) |
I'll merge today! Wanted to give folks time to chime in and I want to triple check the vtk-base package |
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've verified vtk-base
generally works with PyVista (didn't run test suite though due to pyvista/pyvista#3474)
However, I have given this more thought, and I am now concerned that merging this will effectively limit VTK to >=9.2.6, which may be too inflexible for most users and will create conflicts if other packages also depend on vtk
or pin vtk
. This will likely introduce major problems for users with non-trivial environments, and conda will not be able to resolve the dependencies.
With this in mind, I'd like to make sure recipes that use PyVista have a chance to chime in here. Those that come to mind are:
- @conda-forge/mne, @conda-forge/mne-connectivity, etc (cc @larsoner)
- @conda-forge/pyvistaqt
- @conda-forge/pyaedt
- @conda-forge/gempy
- @conda-forge/gemgis
- @conda-forge/puma (this will majorly conflict since they also have
vtk
in their recipe) - @conda-forge/ansys-mapdl-reader, etc (cc @akaszynski)
- @conda-forge/geovista (pins
vtk
) - ... the list goes on
This makes me think that vtk-base
needs to be "opt-in" rather than "opt-out" by default. Or perhaps this justifies a separate pyvista-base
recipe indeed
Yes, in our MNE installers we currently have to pin to 9.2.5 for some unknown reason on macOS (I still need to investigate why). So pinning to 9.2.6 for
From what (admittedly little) I've seen and would expect, typically having a |
I'd like to second this. |
@banesullivan Thanks for the heads up. I'll check whether the issues we were experiencing that cause us to pin to |
Hi @basnijholt , in light of the issues with requiring The VTK feedstock currently produces the following packages:
Right now the build string is used to choose between Suppose the build string was actually produced as the product of (
The recipe itself would just modify the - name: vtk
build:
string: {{ build_string }}
run_exports:
- {{ pin_subpackage('vtk', max_pin='x.x.x') }}
requirements:
build: []
run:
- {{ pin_subpackage("vtk-base", exact=True) }}
- {{ pin_subpackage("vtk-io-ffmpeg", exact=True) }} # [not win] <-- skip this line if ffmpeg option is False Then e.g.,
|
@whophil, that is actually precisely what I had done originally in conda-forge/vtk-feedstock#282, however, @hmaarrfk convinced me that this wasn't a good solution in conda-forge/vtk-feedstock#282 (comment). |
Thanks for the background @basnijholt It seems that updates to build strings could be combined with the split package approach that has now been merged. This would circumvent the "doubling the number of builds" penalty that @hmaarrfk mentioned in that thread, as the build strings would only create more variants of the The concerns about adding too many globs to the build strings are certainly valid, but using the standard prefix for FFMPEG and |
Generally speaking, dependencies are quite aggressive in conda-forge. If people want the older version of PyVista, i think it is ok for them to get an older version of vtk. If you want to retroactively build specific versions of VTK backporting might be ok. But for now, i feel like forcing this update for new installations is ok. I typically think that failing up is ok, rather than building too many unmaintainable hacks. Is there a specific older version of VTK that you are interested in so that we can likely try to backport some patches for it? This kind of package transition is somewhat tricky. I opened an issue conda-forge/conda-forge.github.io#1894 An idea if you absolutely need older version of VTK to be compatible, you can have one build starting at build number 200, that depends on vtk-base, the other build, starting at 0, that depends on vtk. I think that build strings are REALLY overloaded and the requirements on generating them correctly are very loose, and hard to find (in my mind). I'm mostly trying to propose other alternatives that i believe are more maintainable. |
@banesullivan Apologies for the delay in getting back. Good news! Basically I'm unpinning I tested with the latest HTH 😄 |
Maybe GitHub is reporting the diff wrong, but on my side this looks like it still requires vtk in addition to vtk-base ? |
You are right, thanks for paying attention. I think I incorrectly solved the merge conflict. I'll fix it 👌 |
Is there any thing I can do to get this moving? 😄 |
I'm feeling a bit lost in the sauce on this one, but I have concerns about it constraining which version of VTK PyVista users can use, considering PyVista targets back to VTK 9.0 |
Due to patenting concerns related to FFmpeg, it is not feasible for me or others in a similar situation to install the full VTK package for work-related purposes. It is likely that many others face this issue, though they may not be aware of it.
To address this problem, we have separated VTK into two packages:
vtk-base
andvtk-io-ffmpeg
. This allows users to install only the components they require without potential legal complications.In light of this, I propose that
pyvista
should depend onvtk-base
instead of the full VTK package. Users who require FFmpeg functionality can simply installvtk-io-ffmpeg
separately. This change would makepyvista
more accessible to those facing similar patent constraints.Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)