From 556fe0734f2287f2160727ebd2a91c81dd3b8cfa Mon Sep 17 00:00:00 2001 From: DivingDuck <DivingDuck@users.noreply.github.com> Date: Tue, 21 Nov 2023 21:34:26 +0100 Subject: [PATCH] Remove cairosvg from windows build. Since #1387 we use wxPython.svg. cairosvg, cffi and cairocffi not longer needed for projectlayer.py and became obsolete. --- .github/workflows/buildpackage-win.yml | 63 ++++++++++---------------- VERSION | 6 ++- buildinstructions.txt | 7 +-- release_windows.bat | 46 ++++++++++++------- requirements.txt | 7 +-- 5 files changed, 65 insertions(+), 64 deletions(-) diff --git a/.github/workflows/buildpackage-win.yml b/.github/workflows/buildpackage-win.yml index 8ca8f8b2c..0696b4cfb 100644 --- a/.github/workflows/buildpackage-win.yml +++ b/.github/workflows/buildpackage-win.yml @@ -14,20 +14,19 @@ jobs: strategy: matrix: os: [windows-latest] - # remove x86 builds for now as there are no snapshot builds of wxPython available - #architecture: [x64, x86] + # supported architecture: [x64, x86] architecture: [x64] - # add python '3.10' because wxPython 4.2 is now available (2022-08-21) # supported versions: ['3.7', '3.8', '3.9','3.10'] python-version: ['3.10'] steps: - name: Checkout uses: actions/checkout@v4 - # Import submodule PrintrunGTK3 - with: - submodules: recursive - + # # Import submodule PrintrunGTK3 + # with #1387 no longer needed 2023-11-20 + # with: + # submodules: recursive + # - name: Set up Python uses: actions/setup-python@v4 with: @@ -35,50 +34,34 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip pyinstaller setuptools wheel simplejson polygon3 cython cffi -r requirements.txt + # remove cffi too + #python -m pip install --upgrade pip pyinstaller setuptools wheel simplejson polygon3 cython cffi -r requirements.txt + python -m pip install --upgrade pip pyinstaller setuptools wheel simplejson polygon3 cython -r requirements.txt - # - name: Update to wxPython Version for x86 and py 3.8 - # # Latest development version for x86 and Python 3.6 is for now (2021-12-18) 4.1.2a1.dev5226+a843ed14 - # # Latest development version for x86 and Python 3.8+3.9 is for now (2022-03-17) 4.1.2a1.dev5226+a843ed14 - # # Remove Python 3.6 - # if: ${{ matrix.architecture == 'x86' && matrix.python-version == '3.8' }} - # run: | - # python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython==4.1.2a1.dev5226+a843ed14 - # - name: Update to wxPython Version for x86 and py 3.9 - # # Latest development version for x86 and Python 3.6 is for now (2021-12-18) 4.1.2a1.dev5226+a843ed14 - # # Latest development version for x86 and Python 3.8+3.9 is for now (2022-03-17) 4.1.2a1.dev5226+a843ed14 - # # Remove Python 3.6 - # if: ${{ matrix.architecture == 'x86' && matrix.python-version == '3.9' }} - # run: | - # python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython==4.1.2a1.dev5226+a843ed14 - # - # + - name: Update to wxPython latest Version for x86 + # Latest development version for x32 and Python 3.7 to 3.10, can be removed if requirements.txt is fixed + # minimum version for x86 needs to be wxPython >= 4.2.1 (2023-11-20) + if: ${{ matrix.architecture == 'x86' && matrix.python-version >= '3.7' }} + run: | + #python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython==4.2.2a1.dev5626+a1184286 + #python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython + python -m pip install -U wxPython - name: Update to wxPython latest Version for x64 # Latest development version for x64 and Python 3.7 to 3.10, can be removed if requirements.txt is fixed if: ${{ matrix.architecture == 'x64' && matrix.python-version >= '3.7' }} run: | - # python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython + #python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython==4.2.2a1.dev5626+a1184286 + #python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython python -m pip install -U wxPython - name: Build Cython ext run: | python setup.py build_ext --inplace - # Build pyinstaller spec depending on GTK3 x32/x64 binaries or w/o GTK3 bundle - # for running Projector. The user can install the GTK3 libraries external and - # set the environment path to the installation manually if the bundle is not - # included or found (last option) via submodules - - name: Make pyinstaller spec with GTK3 x64 bundle - if: ${{ matrix.architecture == 'x64' && hashFiles('PrintrunGTK3/GTK3Windows10-64') != '' }} - run: | - pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-binary "PrintrunGTK3/GTK3Windows10-64/*.dll;." --add-data "VERSION;cairocffi" --add-data "VERSION;cairosvg" --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -w -i pronterface.ico pronterface.py - - name: Make pyinstaller spec with GTK3 x32 bundle - if: ${{ matrix.architecture == 'x86' && hashFiles('PrintrunGTK3/GTK3Windows10-32') != '' }} - run: | - pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-binary "PrintrunGTK3/GTK3Windows10-32/*.dll;." --add-data "VERSION;cairocffi" --add-data "VERSION;cairosvg" --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -w -i pronterface.ico pronterface.py - - name: Make pyinstaller spec without GTK3 bundle - if: ${{ hashFiles('PrintrunGTK3') == '' }} + + - name: Make pyinstaller spec run: | - pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-data "VERSION;cairocffi" --add-data "VERSION;cairosvg" --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -w -i pronterface.ico pronterface.py + #pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-data "VERSION;cairocffi" --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -w -i pronterface.ico pronterface.py + pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -w -i pronterface.ico pronterface.py - name: Make pyinstaller build run: | pyinstaller --clean pronterface.spec -y diff --git a/VERSION b/VERSION index 3bde0d44e..a55ebd1fa 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,7 @@ -This is a dummy file for pyinstaller to compile Pronterface.Cairocffi and cairosvg won't find -the GTK3 runtime libraries needed for running Projector under Windows w / o this file. +This is a dummy file for pyinstaller to compile Pronterface. Cairocffi and cairosvg won't find +the GTK3 runtime libraries needed for running Projector under Windows w/o this file. +Update 2023-11-13: With introducing merge #1387 https ://github.com/kliment/Printrun/pull/1387 + cairosvg is no loger needed. We use wx.svg instead. You can find a suitable version of GTK3 for Windows 10 here : https://github.com/DivingDuck/PrintrunGTK3. For further information please follow the links.PrintrunGTK3 is a submodule of Printrun. diff --git a/buildinstructions.txt b/buildinstructions.txt index 79f3fba71..f31f67ac8 100644 --- a/buildinstructions.txt +++ b/buildinstructions.txt @@ -1,6 +1,6 @@ setup on osx: -(install python 3.6) -(install python extension compile environment, this is automagically done if you have xcode) +(install python 3.10) +(install python extension compile environment, this is automatically done if you have xcode) (install git) git clone http://github.com/kliment/Printrun.git cd Printrun @@ -35,11 +35,12 @@ pyinstaller --clean pronterface.spec -y (optional) codesign -s identityname dist/pronterface.app --deep setup on windows: -(install python 3.6) +(install python 3.10) (install python extension compile environment, see https://wiki.python.org/moin/WindowsCompilers ) (install git) git clone http://github.com/kliment/Printrun.git cd Printrun +git submodule update --init --recursive git pull \path\to\python3\python -m venv v3 v3\Scripts\activate diff --git a/release_windows.bat b/release_windows.bat index 4707f4839..ca4c90fab 100644 --- a/release_windows.bat +++ b/release_windows.bat @@ -28,7 +28,7 @@ rem ** rem ** 1. Install python 64-bit (3.10.x is actually preferred and standard version ** rem ** for Windows 10) ** rem ** https://www.python.org/downloads/release ** -rem ** In case you use an other Python version, check line 91 and adjust ** +rem ** In case you use an other Python version, check line 88 to 92 and adjust ** rem ** the parameter accordingly to build your virtual environment. ** rem ** 2. Install C-compiler environment ** rem ** https://wiki.python.org/moin/WindowsCompilers ** @@ -56,7 +56,7 @@ rem ** rem ** https://github.com/wxWidgets/Phoenix/commit/d3bdb14365ca754e83732cccd04e94a2ded5029f rem ** ** rem ** ** -rem ** Author: DivingDuck, 2023-02-02, Status: working ** +rem ** Author: DivingDuck, 2023-11-13, Status: working ** rem ** ** rem ************************************************************************************ rem ************************************************************************************ @@ -89,6 +89,7 @@ if exist v3 ( rem py -3.8 -m venv v3 rem py -3.9 -m venv v3 py -3.10 -m venv v3 + rem py -3.11 -m venv v3 echo ********************************************* echo ****** Activate virtual environment v3 ****** @@ -134,18 +135,19 @@ pip uninstall pyglet -y pip install pyglet==1.5.27 -echo ***************************************************************************** -echo ****** cairosvg workaround, needs to be below 2.6.0 (isn't compatible) ****** -echo ***************************************************************************** +rem echo ***************************************************************************** +rem echo ****** cairosvg workaround, needs to be below 2.6.0 (isn't compatible) ****** +rem echo ***************************************************************************** rem # 2023-01-30 rem cairosvg >=2.6.0 generate a crash problem with locale in module projectlayer.py (Projector), rem so we will stay to 2.5.2 as workaround for now -pip uninstall cairosvg -y -pip install cairosvg==2.5.2 +rem # 2023-11-13 cairosvg is no longer needed. We now use wx.svg. +rem pip uninstall cairosvg -y +rem pip install cairosvg==2.5.2 echo ****************************************************************** -echo ****** Compile G-Code parser gcoder_line.cp??-win_amd64.pyd ****** +echo ****** Compile G-Code parser gcoder_line.cp??-win_amd??.pyd ****** echo ****************************************************************** rem For safety reasons delete existing version first to prevent errors if exist printrun\gcoder_line.cp??-win_amd??.pyd ( @@ -165,7 +167,7 @@ rem The Projector feature of Pronterface need some external DLL binaries from th rem You can build Pronterface with or w/o these binaries. In addition you need rem different binaries depending if you build a Windows 10 x32 or x64 version. rem Remove 'rem' before pyi-makespec for the build of your choice and add 'rem' -rem for all other versions. You can't bundle x32 and x46 into the same Pronterface binary file. +rem for all other versions. You can't bundle x32 and x64 into the same Pronterface binary file. rem Only one active version is allowed. rem **** Default setup: Version 3, GTK3 bundle included for Windows 10 x64 bit. **** @@ -175,21 +177,33 @@ rem Choose this pyi-makespec in case you don't have the GTK3 Toolkit files, or w rem or don't want to bundle these within Pronterface.exe. You can install them separately and rem set the path location via Windows system environment variable (like Path=c:\GTK3\bin). -rem pyi-makespec -F --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py -rem pyi-makespec -F --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +rem pyi-makespec -F --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py +rem pyi-makespec -F --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +rem pyi-makespec -F --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i plater.ico plater.py rem Version 2: GTK3 included in Pronterface (Windows10 x32 only) NOT Supported for now (see wxPython remark line 51): rem Choose this pyi-makespec in case you want to include the GTK3 Toolkit files for Windows10 x32 only -rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-32/*.dll;. --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py -rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-32/*.dll;. --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-32/*.dll;. --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py +rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-32/*.dll;. --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-32/*.dll;. --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i plater.ico plater.py rem Version 3: GTK3 included in Pronterface (Windows10 x64 only): rem Choose this pyi-makespec in case you want to include the GTK3 Toolkit files for Windows10 x64 only -pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-64/*.dll;. --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py -pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-64/*.dll;. --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py -pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-64/*.dll;. --add-data VERSION;cairocffi --add-data VERSION;cairosvg --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i plater.ico plater.py +rem do we need GTK any longer? +rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-64/*.dll;. --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py +rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-64/*.dll;. --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +rem pyi-makespec -F --add-binary PrintrunGTK3/GTK3Windows10-64/*.dll;. --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i plater.ico plater.py +rem test w/o GTK +rem do we need cairocffi any longer? +rem pyi-makespec -F --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py +rem pyi-makespec -F --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +rem pyi-makespec -F --add-data VERSION;cairocffi --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i plater.ico plater.py +rem test w/o GTK and cairocffi +pyi-makespec -F --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i pronterface.ico pronterface.py +pyi-makespec -F --add-data images/*;images --add-data *.png;. --add-data *.ico;. -c -i pronsole.ico pronsole.py +pyi-makespec -F --add-data images/*;images --add-data *.png;. --add-data *.ico;. -w -i plater.ico plater.py echo *************************************************************** echo ****** Build Pronterface, Pronsole and Plater executables ***** diff --git a/requirements.txt b/requirements.txt index d57e6f424..53f08eadc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,9 +2,10 @@ pyserial (>= 3.0) wxPython >= 4.2.0 numpy (>= 1.8.2) pyglet >= 1.1, < 2.0 -cffi -cairocffi -cairosvg >= 1.0.9, < 2.6.0 +# remove because of #1387 +#cffi +#cairocffi +#cairosvg >= 1.0.9, < 2.6.0 psutil (>= 2.1) lxml (>= 2.9.1) appdirs (>= 1.4.0)