Thanks doadin, and sorry for missing that doh
That, or something of that sorts is great idea. Anyway, just wanted to quickly say thanks for your post, and reply.
Edit: The failing checking-required-distributions problem, needing delete/rename requires.txt, can be overcome in spec by additionally importing 'copy_metadata' and a couple extra 'datas':
Code: Select all
from PyInstaller.utils.hooks import collect_all, copy_metadata
datas += copy_metadata('deluge', recursive=True)
datas += copy_metadata('service-identity', recursive=True)
Still need copy deluge into deluge-2.0.5.py3.7.egg though.
Edit2: I'll leave this windows stuff now again, but last thing i'll add, is that in addition to above, then you don't have to do any extra stuff anymore, like moving deluge dir, delete requires.txt + deluge-console.exe works now, by adding additionally to above in spec, under the other 'datas += ...' at top:
Code: Select all
datas += [ ('deluge', 'deluge-2.0.5-py3.7.egg/deluge') ]
That section supports globs, atleast for files, so could probably use a glob instead of fixed version for dest-dir - Note I still was using the stable deluge as used your little older build-scripts for initial installing/download, and I ran from the deluge source folder and used your code for analyzing scripts from scripts dir, and works good, thanks. Anyway, i'm sure there are better ways doing this, e.g. adding deluge dir to PYTHONPATH instead of copying over, maybe through runtime hook, and also currently uses extra space for an extra deluge dir copy - You could save space by deleting the deluge dir, but then deluge-console.exe however breaks again. As said you can probably find better solution, but untill then, then this works, and for all exe's, and I didn't wanna spend more time than already, coming up with better solution, when having a working one already. Thanks again mate. (btw, didn't need any extendpathdeluge/pathex, and did need 'import sys' for your analyze code to find scripts, when being in deluge-source dir)
Edit3: just noticed your draft PR, awesome work
Edit4: Sorry, nagged me that my previous posted solution, upped install size with 22mb or something, and didn't realize that initially, so as last thing wanted better way, and I think this is pretty OK: Official deluge instructions states to install from source through 'pip install .' When doing such, then there's only a deluge folder under site-packages(and it's dist folder) and not that stupid deluge-2.0.5.py3.7.egg dir which 'python setup.py install' makes. However, the scripts under python's Scripts dir is in exe, so cannot add to pyinstaller easilly, but after not finding a way to mod this in a nice way, then I'd suggest installing with as said first 'pip install .' and then afterwards run 'python setup.py install_scripts', which copies those to python's Scripts dir, and then when using above added spec lines, then works without needing do anything, and deluge-console.exe works, and install size not gone up, plus not two deluge package folders anymore, but only one as normally should. I just repost spec file ammends/additions here also, so everything in one place(note, only new lines, or changed lines, posted here) :
Code: Select all
from PyInstaller.utils.hooks import collect_all, copy_metadata
datas += copy_metadata('deluge', recursive=True)
datas += copy_metadata('service-identity', recursive=True)
import sys
(Edit: Complete spec:
https://paste.c-net.org/MoralsPleasing. All 8 exe's tested working - from deluge source dir ran 'pip install .', 'python setup.py install_scripts' and finally 'pyinstaller deluge.spec'')
Sorry for long posting, but just wanted to get that final thing out of my head lol