POC: Attempt to package jdaviz in cx_Freeze #1936
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR encompasses the learning lessons I've made to package jdaviz in cx_Freeze. Requires #1890
Some background:
cx_Freeze's dependency identification appears to be much more comprehensive, that is, it just bundles all your packages installed in your environment (I was initially confused why I saw pyinstaller packaged 😅). No guessing, no games, it just includes all your environment packages.
cx_Freeze's approach to building is most similar to the, now deprecated, distutils process; that is it embeds itself into a setup.py and is built by invoking
python setup.py build
. cx_Freeze actually compiles all.py
files in all dependencies into python compiled.pyc
files and copies those over to the executable. If packages import modules properly, this is absolutely fine and shouldn't create any issue. But for the packages that directly reference/read the source code and EXPECT the.py
file to exist, it breaks entirely tsk tsk. On top of this, the story is similar with #1923 and #1914, where I've had to copy over repos with assets that are loaded manually and not through proper import channels.Ultimately, I was able to get past these challenges and ALMOST get voila to load, but we run into the issue presented by @bmorris3 in #1729 and the voila templates. Unlike
PyInstaller
, cx_Freeze does not provide a directory formy_venv/share
, where the templates are expected to live. As a result, voila doesn't even know where to search for its templates (returns an empty list in the traceback for expected path locations)Voila Template Traceback
If I hack voila and hardcode the template path, Voila actually successfully loads, but then is missing other templates as well, indicating multiple overrides would be necessary in order to properly masquerade voila's template discovery algorithm.
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.