From be0678e863da870cdd4ff69210ad621d1831c704 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sat, 7 Dec 2024 15:56:42 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Don=E2=80=99t=20manually=20add=20fonttools?= =?UTF-8?q?=20import=20for=20pyinstaller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s been fixed upstream, see fonttools/fonttools#3531. --- .github/workflows/exe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exe.yml b/.github/workflows/exe.yml index 40b167633..bf39eab8b 100644 --- a/.github/workflows/exe.yml +++ b/.github/workflows/exe.yml @@ -20,7 +20,7 @@ jobs: - name: Install requirements run: python -m pip install . pyinstaller - name: Generate executable - run: python -m PyInstaller weasyprint/__main__.py -n weasyprint -F --hidden-import "fontTools.ttLib.tables.V_A_R_C_" + run: python -m PyInstaller weasyprint/__main__.py -n weasyprint -F - name: Test executable run: dist/weasyprint --info - name: Store executable From df39db30e4cd3576ba962e5d59d1637f9d7f0fb4 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sat, 7 Dec 2024 16:06:23 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Don=E2=80=99t=20add=20DLL=20directories=20w?= =?UTF-8?q?hen=20using=20Windows=20executable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related to #2289. --- weasyprint/text/ffi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weasyprint/text/ffi.py b/weasyprint/text/ffi.py index 341014b32..b5a9cf231 100644 --- a/weasyprint/text/ffi.py +++ b/weasyprint/text/ffi.py @@ -1,6 +1,7 @@ """Imports of dynamic libraries used for text layout.""" import os +import sys from contextlib import suppress import cffi @@ -434,7 +435,7 @@ def _dlopen(ffi, *names, allow_fail=False): return ffi.dlopen(names[0], flags) # pragma: no cover -if hasattr(os, 'add_dll_directory'): # pragma: no cover +if hasattr(os, 'add_dll_directory') and not hasattr(sys, 'frozen'): # pragma: no cover dll_directories = os.getenv( 'WEASYPRINT_DLL_DIRECTORIES', 'C:\\msys64\\mingw64\\bin;'