From b0dffdefbabf104d6d23f5f2eecaa478971d3eef Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 27 Mar 2021 19:05:53 -0700 Subject: [PATCH 1/9] Add install instructions --- .gitignore | 6 ++++- README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 4 ++-- 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 68b179e..7effb2a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,8 @@ Icon .AppleDesktop Network Trash Folder Temporary Items -.apdisk \ No newline at end of file +.apdisk + +venv +mangle.spec +PyQt4-4.11.4-cp27-cp27m-win32.whl diff --git a/README.md b/README.md index ad8ee0e..2787fd9 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,72 @@ from source. * [mangle\_win.zip](https://foosoft.net/projects/mangle/dl/mangle_win.zip) * [mangle\_osx.zip](https://foosoft.net/projects/mangle/dl/mangle_osx.zip) (quite old) + +### Windows + +You need Python +[2.7 32 bit](https://www.python.org/downloads/release/python-2718/). +Download the `Windows x86 MSI installer` +and be sure to add `python` to `PATH` during installation. + +You can run `mangle` using 64 bit Python 2.7, +but won't be able to build a binary with `py2exe`, +and any performance difference is negligible. + +Install virtualenv globally, if you don't already have it. + +``` +> pip install virtualenv +``` + +and install all dependencies in a venv in the mangle directory, e.g. + +``` +...\mangle> virtualenv venv +> venv\Scripts\activate +(venv) > pip install Pillow +(venv) > pip install reportlab +``` + +It can be pretty difficult to install PyQT4 from source, +so prebuilt binaries are available at +http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4 + +You need +`PyQt4-4.11.4-cp27-cp27m-win32.whl` + +which you can install after placing the file +in the `mangle` folder via + +``` +(venv) > pip install PyQt4-4.11.4-cp27-cp27m-win32.whl +``` + +So your final `pip freeze` can look like: + +``` +(venv) > pip freeze +Pillow==6.2.2 +PyQt4 @ file:///.../mangle/PyQt4-4.11.4-cp27-cp27m-win32.whl +reportlab==3.5.59 +``` + +#### Optional + +To actually build a stand-alone `.exe`, install + +``` +(venv) > pip install py2exe_py2 +``` + +and install +[Microsoft Visual C++ Compiler for Python 2.7](https://www.microsoft.com/en-us/download/details.aspx?id=44266) + +A standalone binary can be created in the `dist` folder via + +``` +(venv) > python setup.py install +``` + +You may get an error which can be solved by looking at +https://stackoverflow.com/questions/38444230/error-converting-gui-to-standalone-executable-using-py2exe diff --git a/setup.py b/setup.py index 1f774fc..b74142d 100644 --- a/setup.py +++ b/setup.py @@ -43,8 +43,8 @@ setup( options={'py2exe': { 'bundle_files': 1, 'includes': ['sip'], - 'packages': ['reportlab.pdfbase'], - 'dll_excludes': ['w9xpopen.exe'] + 'packages': ['reportlab.pdfbase', 'reportlab.rl_settings'], + 'dll_excludes': ['MSVCP90.dll', 'w9xpopen.exe'] }}, zipfile=None ) From 5731ffdb01477d5c96ddcf89956c07e139737973 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 27 Mar 2021 19:20:12 -0700 Subject: [PATCH 2/9] Add run instructions. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 2787fd9..8e769cb 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,15 @@ PyQt4 @ file:///.../mangle/PyQt4-4.11.4-cp27-cp27m-win32.whl reportlab==3.5.59 ``` +You can run the GUI via + +``` +(venv) > python mangle.pyw +``` + +Optionally, you can install all the dependencies globally +so you can simply click on the `mangle.pyw` file to run it. + #### Optional To actually build a stand-alone `.exe`, install From 319e2816c160dc0e315b0f53de21fad2ee44951f Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 27 Mar 2021 19:52:02 -0700 Subject: [PATCH 3/9] Move install instructions to own file --- INSTALL.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 78 +--------------------------------------------------- 2 files changed, 82 insertions(+), 77 deletions(-) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..fb74c2d --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,81 @@ +# Install Instructions + +For local development / building stand-alone binaries + +## Windows + +You need Python +[2.7 32 bit](https://www.python.org/downloads/release/python-2718/). +Download the `Windows x86 MSI installer` +and be sure to add `python` to `PATH` during installation. + +You can run `mangle` using 64 bit Python 2.7, +but won't be able to build a binary with `py2exe`, +and any performance difference is negligible. + +Install virtualenv globally, if you don't already have it. + +``` +> pip install virtualenv +``` + +and install all dependencies in a venv in the mangle directory, e.g. + +``` +...\mangle> virtualenv venv +> venv\Scripts\activate +(venv) > pip install Pillow +(venv) > pip install reportlab +``` + +It can be pretty difficult to install PyQT4 from source, +so prebuilt binaries are available at +http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4 + +You need +`PyQt4-4.11.4-cp27-cp27m-win32.whl` + +which you can install after placing the file +in the `mangle` folder via + +``` +(venv) > pip install PyQt4-4.11.4-cp27-cp27m-win32.whl +``` + +So your final `pip freeze` can look like: + +``` +(venv) > pip freeze +Pillow==6.2.2 +PyQt4 @ file:///.../mangle/PyQt4-4.11.4-cp27-cp27m-win32.whl +reportlab==3.5.59 +``` + +You can run the GUI via + +``` +(venv) > python mangle.pyw +``` + +Optionally, you can install all the dependencies globally +so you can simply click on the `mangle.pyw` file to run it. + +### Optional + +To actually build a stand-alone `.exe`, install + +``` +(venv) > pip install py2exe_py2 +``` + +and install +[Microsoft Visual C++ Compiler for Python 2.7](https://www.microsoft.com/en-us/download/details.aspx?id=44266) + +A standalone binary can be created in the `dist` folder via + +``` +(venv) > python setup.py install +``` + +You may get an error which can be solved by looking at +https://stackoverflow.com/questions/38444230/error-converting-gui-to-standalone-executable-using-py2exe diff --git a/README.md b/README.md index 8e769cb..05029ec 100644 --- a/README.md +++ b/README.md @@ -79,80 +79,4 @@ from source. * [mangle\_win.zip](https://foosoft.net/projects/mangle/dl/mangle_win.zip) * [mangle\_osx.zip](https://foosoft.net/projects/mangle/dl/mangle_osx.zip) (quite old) -### Windows - -You need Python -[2.7 32 bit](https://www.python.org/downloads/release/python-2718/). -Download the `Windows x86 MSI installer` -and be sure to add `python` to `PATH` during installation. - -You can run `mangle` using 64 bit Python 2.7, -but won't be able to build a binary with `py2exe`, -and any performance difference is negligible. - -Install virtualenv globally, if you don't already have it. - -``` -> pip install virtualenv -``` - -and install all dependencies in a venv in the mangle directory, e.g. - -``` -...\mangle> virtualenv venv -> venv\Scripts\activate -(venv) > pip install Pillow -(venv) > pip install reportlab -``` - -It can be pretty difficult to install PyQT4 from source, -so prebuilt binaries are available at -http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4 - -You need -`PyQt4-4.11.4-cp27-cp27m-win32.whl` - -which you can install after placing the file -in the `mangle` folder via - -``` -(venv) > pip install PyQt4-4.11.4-cp27-cp27m-win32.whl -``` - -So your final `pip freeze` can look like: - -``` -(venv) > pip freeze -Pillow==6.2.2 -PyQt4 @ file:///.../mangle/PyQt4-4.11.4-cp27-cp27m-win32.whl -reportlab==3.5.59 -``` - -You can run the GUI via - -``` -(venv) > python mangle.pyw -``` - -Optionally, you can install all the dependencies globally -so you can simply click on the `mangle.pyw` file to run it. - -#### Optional - -To actually build a stand-alone `.exe`, install - -``` -(venv) > pip install py2exe_py2 -``` - -and install -[Microsoft Visual C++ Compiler for Python 2.7](https://www.microsoft.com/en-us/download/details.aspx?id=44266) - -A standalone binary can be created in the `dist` folder via - -``` -(venv) > python setup.py install -``` - -You may get an error which can be solved by looking at -https://stackoverflow.com/questions/38444230/error-converting-gui-to-standalone-executable-using-py2exe +Check [INSTALL.md](INSTALL.md) for build instructions. From 563564ea53937f1b404f7b23c970101bce5f7a5b Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 28 Mar 2021 09:28:05 -0700 Subject: [PATCH 4/9] Create requirements.txt --- INSTALL.md | 36 ++++-------------------------------- requirements.txt | 4 ++++ 2 files changed, 8 insertions(+), 32 deletions(-) create mode 100644 requirements.txt diff --git a/INSTALL.md b/INSTALL.md index fb74c2d..3fe4eed 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -13,7 +13,8 @@ You can run `mangle` using 64 bit Python 2.7, but won't be able to build a binary with `py2exe`, and any performance difference is negligible. -Install virtualenv globally, if you don't already have it. +Install [virtualenv](https://virtualenv.pypa.io/en/stable/) +globally, if you don't already have it. ``` > pip install virtualenv @@ -24,31 +25,7 @@ and install all dependencies in a venv in the mangle directory, e.g. ``` ...\mangle> virtualenv venv > venv\Scripts\activate -(venv) > pip install Pillow -(venv) > pip install reportlab -``` - -It can be pretty difficult to install PyQT4 from source, -so prebuilt binaries are available at -http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4 - -You need -`PyQt4-4.11.4-cp27-cp27m-win32.whl` - -which you can install after placing the file -in the `mangle` folder via - -``` -(venv) > pip install PyQt4-4.11.4-cp27-cp27m-win32.whl -``` - -So your final `pip freeze` can look like: - -``` -(venv) > pip freeze -Pillow==6.2.2 -PyQt4 @ file:///.../mangle/PyQt4-4.11.4-cp27-cp27m-win32.whl -reportlab==3.5.59 +(venv) > pip install requirements.txt ``` You can run the GUI via @@ -63,12 +40,7 @@ so you can simply click on the `mangle.pyw` file to run it. ### Optional To actually build a stand-alone `.exe`, install - -``` -(venv) > pip install py2exe_py2 -``` - -and install + [Microsoft Visual C++ Compiler for Python 2.7](https://www.microsoft.com/en-us/download/details.aspx?id=44266) A standalone binary can be created in the `dist` folder via diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0b36984 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Pillow==6.2.2 +py2exe-py2==0.6.9 +PyQt4 @ https://download.lfd.uci.edu/pythonlibs/w4tscw6k/cp27/PyQt4-4.11.4-cp27-cp27m-win32.whl +reportlab==3.5.59 From 4fbfd99299a93924788593aa396ab252a44cb5a4 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 28 Mar 2021 09:29:13 -0700 Subject: [PATCH 5/9] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7effb2a..64de61f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,3 @@ Temporary Items venv mangle.spec -PyQt4-4.11.4-cp27-cp27m-win32.whl From 690d956fbcbc31779b5a3b795fd6d0f47fc34367 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 29 Mar 2021 17:13:07 -0700 Subject: [PATCH 6/9] Update requirements.txt --- INSTALL.md | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 3fe4eed..3e2d626 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -25,7 +25,7 @@ and install all dependencies in a venv in the mangle directory, e.g. ``` ...\mangle> virtualenv venv > venv\Scripts\activate -(venv) > pip install requirements.txt +(venv) > pip install -r requirements.txt ``` You can run the GUI via diff --git a/requirements.txt b/requirements.txt index 0b36984..dac81c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Pillow==6.2.2 py2exe-py2==0.6.9 -PyQt4 @ https://download.lfd.uci.edu/pythonlibs/w4tscw6k/cp27/PyQt4-4.11.4-cp27-cp27m-win32.whl +PyQt4 @ https://download.lfd.uci.edu/pythonlibs/w4tscw6k/cp27/PyQt4-4.11.4-cp27-cp27m-win32.whl; platform_system=='Windows' reportlab==3.5.59 From e0d30662bffeff75378a6e082be693d3dda7c05a Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 29 Mar 2021 17:14:53 -0700 Subject: [PATCH 7/9] Update INSTALL.md --- INSTALL.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 3e2d626..981ca79 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,12 +2,12 @@ For local development / building stand-alone binaries -## Windows - You need Python [2.7 32 bit](https://www.python.org/downloads/release/python-2718/). -Download the `Windows x86 MSI installer` -and be sure to add `python` to `PATH` during installation. + +If you are using Windows download the `Windows x86 MSI installer`. + +Be sure to add `python` to `PATH` during installation. You can run `mangle` using 64 bit Python 2.7, but won't be able to build a binary with `py2exe`, @@ -37,7 +37,7 @@ You can run the GUI via Optionally, you can install all the dependencies globally so you can simply click on the `mangle.pyw` file to run it. -### Optional +### Optional (Windows) To actually build a stand-alone `.exe`, install From bdc5dfc409920a69cb546180d452ade568fb92a8 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 29 Mar 2021 17:55:25 -0700 Subject: [PATCH 8/9] Fix wording --- INSTALL.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 981ca79..1dfc44c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,18 +1,17 @@ # Install Instructions -For local development / building stand-alone binaries +For local development / building stand-alone binaries. -You need Python -[2.7 32 bit](https://www.python.org/downloads/release/python-2718/). +You need [Python 2.7](https://www.python.org/downloads/release/python-2718/). -If you are using Windows download the `Windows x86 MSI installer`. +If you are using Windows download the +`Windows x86 MSI installer` +because 32 bit Python is needed to create +a Windows executable with `py2exe`. +The performance increase from 64 bit is negligible. Be sure to add `python` to `PATH` during installation. -You can run `mangle` using 64 bit Python 2.7, -but won't be able to build a binary with `py2exe`, -and any performance difference is negligible. - Install [virtualenv](https://virtualenv.pypa.io/en/stable/) globally, if you don't already have it. @@ -28,7 +27,7 @@ and install all dependencies in a venv in the mangle directory, e.g. (venv) > pip install -r requirements.txt ``` -You can run the GUI via +You can run the app via ``` (venv) > python mangle.pyw @@ -37,7 +36,7 @@ You can run the GUI via Optionally, you can install all the dependencies globally so you can simply click on the `mangle.pyw` file to run it. -### Optional (Windows) +# Building an Executable (Windows) To actually build a stand-alone `.exe`, install From b30d3ff978340d3be51d7e0c662fa9a64b2ef087 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Wed, 31 Mar 2021 14:39:36 -0700 Subject: [PATCH 9/9] Add platform to py2exe requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index dac81c4..decdd52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Pillow==6.2.2 -py2exe-py2==0.6.9 +py2exe-py2==0.6.9; platform_system=='Windows' PyQt4 @ https://download.lfd.uci.edu/pythonlibs/w4tscw6k/cp27/PyQt4-4.11.4-cp27-cp27m-win32.whl; platform_system=='Windows' reportlab==3.5.59