Refactor/Move qt_plotting to pyvista_qt#719
Conversation
|
In terms of licensing this does not help: Just as currently importing pyqt5 means the whole of pyvista needs to conform with gpl, so does importing pyvista_qt, which in turn imports pyqt5. This problem can only be solved by not importing pyqt5 at all in the codebase. |
It's a reasonable point. Do you propose we move out the entire import? As it stands it's a conditional import that only runs if you have |
|
I am not the right person to ask this, I am neither an expert on licensing nor affected by the licensing choice of pyvista. From what I read my (!) conclusion is that importing a python module is considered linking, and linking GPL code makes the whole thing subject to GPL terms. So the question here is: Is conditional importing still importing? I'd guess yes. However I'd expect not even experts could be entirely sure, because these cases usually only become clear after litigation. Legal advice will probably stay on the save side usually. The actual judgement would have to be done by downstreams in violation of GPL (e.g. any closed-source downstreams distributing the code), i.e. whether to use pyvista or not and accept any risk, or pyqt5, i.e. whether or not to litigate. Pyvista itself as far as I understand is not in violation of GPL (unless stating the license to be MIT is already considered a violation - it's probably not correct, but by making the pyvista source open it still complies with GPL as far as I understand). So my personal opinion is: Do not import pyqt5 in any way if you want to license pyvista as MIT. However my opinion is not what counts. I seem to remember that closed-source downstreams have been mentioned at some point. If that's correct whoever knows them should ask them, because their opinion matters. |
|
Removing the |
Codecov Report
@@ Coverage Diff @@
## master #719 +/- ##
==========================================
- Coverage 84.73% 83.48% -1.26%
==========================================
Files 35 34 -1
Lines 9266 8841 -425
==========================================
- Hits 7852 7381 -471
- Misses 1414 1460 +46 |
|
I vote for taking all traces of PyQt out of I've majorly ranted about GPL on many other issues and how we can't even import GPL software without violating the license - so in brief, let's get PyQt out of here and stop worrying about it. Also, having it here is just getting messy. In practice, we'll need to keep an empty |
Were you thinking of a depreciation warning? We can do that for a minor release, but I'd honestly prefer just forcing people off rather than taking the bandaid off slowly. I've got a closed source project that uses I'd say throwing a depreciation error would be best, but I'll settle with a warning if @GuillaumeFavelier and @larsoner think it's best. |
|
@banesullivan, I'm going to need you to go into add qtdocs.pyvista.org to pyvista_qt-docs. GitHub pages is already enabled, but I need you to setup the domain (or give me access to it). |
|
This is a big change, this plotter is here since I learned about I thought the plan was to move towards pyvista-gui though. Is it for even more modularity? Also, I understand it's called
I'm in favour of the deprecation error. If it's not there anymore, people should not expect it to work. And we can inform the users about the move. Then this can be removed at the next big release cycle. But if we go for a warning, we should redirect to
Regarding You might be interested @larsoner, @agramfort :) |
|
I'd definitely consider this a minor bump, it's not just a bugfix. Also this seems like a good time to introduce RCs, given there seems to be quite a few affected downstreams that would benefit from early testing. The underscore vs hyphen thing is a typical problem: Module names must not use hyphens but underscores (if at all), package names should avoid underscores. I.e. the package would usually be pyvista-qt, the module pyvista_qt. Or just make both pyvistaqt to remove any possible confusion: https://www.python.org/dev/peps/pep-0008/#package-and-module-names |
Indeed I don't foresee any big issues for MNE, we'll just need to implement some |
I think that sounds like the best solution. It's not the nicest looking name, but it will lead to the least confusion between
That's my fault. Provided no one has an objection with the name |
I think we can slowly add features from |
banesullivan
left a comment
There was a problem hiding this comment.
A few minor suggestions I would like to resolve. Otherwise, LGTM!! 🎉
These changes warrant a MINOR version bump and details should be the top point in the release notes.
This is really exciting - I think will significantly improve PyVista's code quality, decrease barriers to entry for new devs, and streamline testing 🚀
Agreed. I've added it to the milestone. We've been due for a minor release anyway. |
Move qt_plotting to pyvista_qt
This PR moves
qt_plotting.pyout ofpyvista.plottingand into pyvistaqt. Reasoning for this:Licensing
GPL scares me a little, and I want to make certain that we've removed all traces of
pyqtfrom our module over the concern of licensing.Agile Development
Testing is really bogging down agile development. It's difficult to get core tests/doc building/ and qt tests to consistently run each time. It's usually a flaky test in Mac or some similar timeout in Windows due to server load.
With split modules, we can add a ton of features like better icons,
pyqt5version control, feature tree, etc. all within the setup.py.Better testing control
Changes to
BackgroundPlotterdo not affect any upstream core functionality and as such we should not need to test the core functionality again with each minor change. The opposite doesn't hold true, (i.e. changes to thepyvistacore can affectpyvistaqt) so we simply pull from master and check if we're valid.Pyside
We can support pyside in the same manner; by providing a submodule that builds upon
BasePlotter. Includingpysidesupport withinpyvistawill further bloat the module and we need to move the opposite direction.Summary
This is a significant but necessary change to make
pyvistaeasier to develop in an agile manner. It will also lead to improvements inBackgroundPlotteras changes there will be easier to test and develop.