Skip to content

Commit

Permalink
fix setup and wheel build, changes to lyricsfinder, smaller test files
Browse files Browse the repository at this point in the history
  • Loading branch information
marian-code committed Oct 24, 2019
1 parent 957981a commit 6645496
Show file tree
Hide file tree
Showing 19 changed files with 124 additions and 213 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include README.md
include wiki_music/ui/*
include wiki_music/data/*
include wiki_music/files/*
global-exclude wiki_music/files/google_api_key.txt
global-exclude wiki_music/files/MP3_TAG_PATH.txt
global-exclude wiki_music/data/*
9 changes: 7 additions & 2 deletions code_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- 0.6a0
- delete do not bother setting when api key or nltk data are manually
downloaded
- fix manual google api search key running even if NO selcted
- fix manual google api search key running even if NO selected
- fix extraction for endless forms most beautiful
- fix as many bugs as possible
- make parallel freezing, and package for release
Expand Down Expand Up @@ -64,7 +64,12 @@

# Change Log

### 21.10.2019 - 0.5a0
### 24.10.2019 - 0.5a0
- some changes to lyricsfinder to speed things up
- made test music files a lot smaller, for git push and pull to be faster
- last opened file is now not included in dist wheel

### 21.10.2019
- finnished and tested new implementation of parser - GUI comunication, it is
a lot cleaner and less error prone
- SharedVars class ha been simplified a lot
Expand Down
17 changes: 9 additions & 8 deletions docs/instalation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ for your python version, install it by:
pip install <package-name>.whl
Other than that you can use `UPX <https://upx.github.io>`_ to compress the app
to a smaller size. It prooves to be quite effective reducing app size..
to a smaller size. It proves to be quite effective reducing app size.
If you want to use it go to the provided link and download apropriate
version for your system. Then unpack it in upx folder under wiki_music/freeze.

.. warning::
This is not recomended in debugging stage as it adds another layer of
complexity.
complexity. UPX compression is still under development, for instance it
messes some GUI elements!

Now you are ready to go:

Expand All @@ -143,19 +144,19 @@ To build the CLI app:
python freeze.py cli
When building in virtual env the frozen app should have ~75MB.
With UPX compression and vanilla Numpy ~56MB
With OPENBLAS numpy and UPX compression ~105MB.
When building in virtual env the frozen app should have ~65MB.
With UPX compression and vanilla Numpy ~??MB
With OPENBLAS numpy and UPX compression ~95MB.

To build the GUI app:

.. code-block:: bash
python freeze.py gui
When building in virtual env the frozen app should have ~120MB.
With UPX compression and vanilla Numpy ~75MB
With OPENBLAS numpy and UPX compression ~150MB.
When building in virtual env the frozen app should have ~110MB.
With UPX compression and vanilla Numpy ~??MB
With OPENBLAS numpy and UPX compression ~140MB.

This will generate list three directories under setup/ folder: gdist/ cdist/
and build/. Build contains just pyinstaller help files and **(g/c)dist/wiki_music**
Expand Down
59 changes: 33 additions & 26 deletions freeze/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,29 @@ def set_loggers():
log.addHandler(fh)


def clear_path():
if input_parser() == "GUI":

try:
shutil.rmtree("gdist")
except FileNotFoundError:
pass
except OSError as e:
print(e)
sys.exit()
else:
try:
shutil.rmtree("cdist")
except FileNotFoundError:
pass
except OSError as e:
print(e)
sys.exit()


# clear build paths
clear_path()

# setup loggers
set_loggers()

Expand Down Expand Up @@ -101,33 +124,33 @@ def set_loggers():

# common installer options
installer_opt = [
# constnts build options
# ? constnts build options
"--clean",
"--noconfirm",
# "--version-file=<FILE>",

# debbugging options
"--debug=bootloader",
"--debug=all",
"--debug=noarchive",
# ? debbugging options
# "--debug=bootloader",
# "--debug=all",
#"--debug=noarchive",

# upx options
#"--noupx",
# ? upx options
"--noupx",
"--upx-exclude=vcruntime140.dll",
"--upx-exclude=msvcp140.dll",
"--upx-exclude=qwindows.dll",
"--upx-exclude=qwindowsvistastyle.dll",
f"--upx-dir={path.join(WORK_DIR, 'upx')}",

# pyinstaller data paths and hooks
# ? pyinstaller data paths and hooks
f"--paths={PACKAGE_PATH}",
f"--add-data={path.join(PACKAGE_PATH, 'wiki_music', 'files')};files",
f"--icon={path.join(PACKAGE_PATH, 'wiki_music', 'files', 'icon.ico')}",
f"--specpath={WORK_DIR}",
"--additional-hooks-dir=hooks",
f"--runtime-hook={path.join(WORK_DIR, 'rhooks', 'pyi_rth_nltk.py')}",

# what to build
# ? what to build
"--onedir",
# "--onefile",
"--name=wiki_music",
Expand All @@ -136,31 +159,15 @@ def set_loggers():
# installer options specific to gui or cli
if input_parser() == "GUI":

try:
shutil.rmtree("gdist")
except FileNotFoundError:
pass
except OSError as e:
print(e)
sys.exit()

installer_opt.extend([
"--distpath=gdist",
#"--windowed",
"--windowed",
f"--add-data={path.join(PACKAGE_PATH, 'wiki_music', 'data')};data",
f"--add-data={path.join(PACKAGE_PATH, 'wiki_music', 'ui')};ui",
f"{path.join(PACKAGE_PATH, 'wiki_music', 'app_gui.py')}"
])
else:

try:
shutil.rmtree("cdist")
except FileNotFoundError:
pass
except OSError as e:
print(e)
sys.exit()

installer_opt.extend([
"--distpath=cdist",
"--console",
Expand Down
Loading

0 comments on commit 6645496

Please sign in to comment.