From 168dc2ad4872d2deadd71ac4d1e0ff9fb7b18239 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Oct 2019 09:50:04 -0700 Subject: [PATCH 01/12] Also include the vcredist DLLs for Python 3.8 --- build.py | 4 ++-- wscript | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 60559b52..1009e079 100755 --- a/build.py +++ b/build.py @@ -1523,9 +1523,9 @@ def copyWxDlls(options): dlls += glob.glob(os.path.join(cairo_root, arch, 'bin', '*.dll')) # For Python 3.5 and 3.6 builds we also need to copy some VC14 redist DLLs. - # NOTE: Do it for 3.7 too for now. But when we fully switch over to VS 2017 + # NOTE: Do it for 3.7+ too for now. But when we fully switch over to VS 2017 # this may need to change. See notes in wscript about it. - if PYVER in ['3.5', '3.6', '3.7']: + if PYVER in ['3.5', '3.6', '3.7', '3.8']: redist_dir = os.path.join( phoenixDir(), 'packaging', 'Py3.5', 'vcredist', arch, 'Microsoft.VC140.CRT', '*.dll') diff --git a/wscript b/wscript index 7bc8d19e..983fcc83 100644 --- a/wscript +++ b/wscript @@ -84,7 +84,7 @@ def configure(conf): # On the other hand, microsoft says that v141 and v140 (Visual # Studio 2015) are binary compatible, so for now let's just drop # it back to "14.0" until I get all the details worked out for - # using VS 2017 everywhere for Python 3.7. + # using VS 2017 everywhere for Python 3.7+. msvc_version = '14.0' # In some cases (Azure DevOps at least) we're getting "14.1" for Python From bd959a83e0d67e45eb9120dfdea6ede557e4ff6e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Oct 2019 13:43:39 -0700 Subject: [PATCH 02/12] Add wx.Setlocale() --- etg/intl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etg/intl.py b/etg/intl.py index 43422e83..f938b2fd 100644 --- a/etg/intl.py +++ b/etg/intl.py @@ -48,6 +48,10 @@ def run(): c.find('WinSublang').ignore() c.find('GetLCID').ignore() + module.addItem(etgtools.WigCode("""\ + char* wxSetlocale(int category, const char *locale); + """)) + module.addPyCode("""\ #---------------------------------------------------------------------------- From 6d77fcf15a4b3f9143356747ba6c06d8122e9ba3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Oct 2019 15:55:43 -0700 Subject: [PATCH 03/12] Create and hold a wx.Locale object when the wx.App is intialized, trying to make it match what is already set for the process. --- etg/app.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/etg/app.py b/etg/app.py index ba26f6c7..7dccf4b8 100644 --- a/etg/app.py +++ b/etg/app.py @@ -438,7 +438,10 @@ def run(): called. This can be overridden in derived classes, but be sure to call this method from there. """, - body="wx.StockGDI._initStockObjects()"), + body="""\ + wx.StockGDI._initStockObjects() + self.InitLocale() + """), PyFunctionDef('__del__', '(self)', doc="", @@ -502,6 +505,23 @@ def run(): self.stdioWin.size = size """), + PyFunctionDef('InitLocale', '(self)', + doc="""\ + Try to ensure that the C and Python locale is in sync with wxWidgets locale. + """, + body="""\ + import locale + self._initial_locale = None + loc, enc = locale.getlocale() + # Try to set it to the same language as what is already set in the C locale + info = wx.Locale.FindLanguageInfo(loc) if loc is not None else None + if info: + self._initial_locale = wx.Locale(info.Language) + else: + # fallback to the system default + self._initial_locale = wx.Locale(wx.LANGUAGE_DEFAULT) + """), + PyFunctionDef('Get', '()', isStatic=True, doc="""\ A staticmethod returning the currently active application object. From 224d62104a09373ea8cf943194bad1a47dfbe4b1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Oct 2019 16:12:06 -0700 Subject: [PATCH 04/12] comment tweaks --- etg/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etg/app.py b/etg/app.py index 7dccf4b8..32276b79 100644 --- a/etg/app.py +++ b/etg/app.py @@ -514,11 +514,11 @@ def run(): self._initial_locale = None loc, enc = locale.getlocale() # Try to set it to the same language as what is already set in the C locale - info = wx.Locale.FindLanguageInfo(loc) if loc is not None else None + info = wx.Locale.FindLanguageInfo(loc) if loc else None if info: self._initial_locale = wx.Locale(info.Language) else: - # fallback to the system default + # otherwise fall back to the system default self._initial_locale = wx.Locale(wx.LANGUAGE_DEFAULT) """), From 382a624aaf683f43537e14b0adcecbacc80e501e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 16 Oct 2019 11:38:49 -0700 Subject: [PATCH 05/12] Add ResetLocale --- etg/app.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etg/app.py b/etg/app.py index 32276b79..4ad6f47a 100644 --- a/etg/app.py +++ b/etg/app.py @@ -510,8 +510,8 @@ def run(): Try to ensure that the C and Python locale is in sync with wxWidgets locale. """, body="""\ + self.ResetLocale() import locale - self._initial_locale = None loc, enc = locale.getlocale() # Try to set it to the same language as what is already set in the C locale info = wx.Locale.FindLanguageInfo(loc) if loc else None @@ -522,6 +522,15 @@ def run(): self._initial_locale = wx.Locale(wx.LANGUAGE_DEFAULT) """), + PyFunctionDef('ResetLocale', '(self)', + doc="""\ + Release the wx.Locale object created in :meth:`InitLocale`. + This will reset the application's locale to the previous settings. + """, + body="""\ + self._initial_locale = None + """), + PyFunctionDef('Get', '()', isStatic=True, doc="""\ A staticmethod returning the currently active application object. @@ -532,7 +541,6 @@ def run(): - module.addPyClass('PySimpleApp', ['App'], deprecated="Use :class:`App` instead.", doc="""This class is deprecated. Please use :class:`App` instead.""", items=[ From 3431b2140ad5d6021aa95a7555f6d6c0772a88e2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2019 14:50:28 -0700 Subject: [PATCH 06/12] Pillow is not yet available for Python3.8 on Windows --- requirements/install.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/install.txt b/requirements/install.txt index eeb7cd86..7762edfe 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -1,5 +1,6 @@ # Runtime dependencies needed when using wxPython Phoenix numpy==1.16.1 ; python_version <= '2.7' numpy ; python_version >= '3.0' -pillow +pillow ; sys_platform == 'win32' and python_version < '3.8' +pillow ; sys_platform != 'win32' six From c14e3c7940b75e7ccb551adcd432c482d628e846 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2019 16:41:58 -0700 Subject: [PATCH 07/12] Add Azure builds for Python 3.8 --- .azure/ci-linux-job.yml | 6 +++++- .azure/ci-macos-job.yml | 6 +++++- .azure/ci-windows-job.yml | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.azure/ci-linux-job.yml b/.azure/ci-linux-job.yml index 08a2d79c..4260ca62 100644 --- a/.azure/ci-linux-job.yml +++ b/.azure/ci-linux-job.yml @@ -17,7 +17,11 @@ jobs: python: 'python3.7' make_venv: 'python3.7 -m venv venv' venv_pkg: 'python3.7-venv' - maxParallel: 3 + Py38: + python: 'python3.8' + make_venv: 'python3.8 -m venv venv' + venv_pkg: 'python3.8-venv' + maxParallel: 4 variables: {'PYTHONUNBUFFERED': '1'} diff --git a/.azure/ci-macos-job.yml b/.azure/ci-macos-job.yml index df4447c3..56bccc19 100644 --- a/.azure/ci-macos-job.yml +++ b/.azure/ci-macos-job.yml @@ -17,7 +17,11 @@ jobs: python_version: '3.7.3' python_pkg: 'python-3.7.3-macosx10.9.pkg' python: 'python3.7' - maxParallel: 3 + Py38: + python_version: '3.8.0' + python_pkg: 'python-3.8.0-macosx10.9.pkg' + python: 'python3.7' + maxParallel: 4 variables: {'PYTHONUNBUFFERED': '1'} diff --git a/.azure/ci-windows-job.yml b/.azure/ci-windows-job.yml index 1d1edc0a..091e2c38 100644 --- a/.azure/ci-windows-job.yml +++ b/.azure/ci-windows-job.yml @@ -14,6 +14,10 @@ jobs: python.version: '3.7' python.arch: x86 addToPath: true + Py38_x86: + python.version: '3.8' + python.arch: x86 + addToPath: true Py36_x64: python.version: '3.6' python.arch: x64 @@ -22,6 +26,10 @@ jobs: python.version: '3.7' python.arch: x64 addToPath: true + Py38_x64: + python.version: '3.8' + python.arch: x64 + addToPath: true maxParallel: 4 From 159a86da2783a981c076a85564f2767af580d4ff Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2019 19:57:25 -0700 Subject: [PATCH 08/12] Just exclude Pillow entirely, for now --- requirements/install.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/install.txt b/requirements/install.txt index 7762edfe..159b7094 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -1,6 +1,6 @@ # Runtime dependencies needed when using wxPython Phoenix numpy==1.16.1 ; python_version <= '2.7' numpy ; python_version >= '3.0' -pillow ; sys_platform == 'win32' and python_version < '3.8' -pillow ; sys_platform != 'win32' +# pillow ; sys_platform == 'win32' and python_version < '3.8' +# pillow ; sys_platform != 'win32' six From c033686fe0ef367cec4daefd11b5829721a23e31 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2019 20:18:19 -0700 Subject: [PATCH 09/12] Azure doesn't have Python 3.8 yet --- .azure/ci-windows-job.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.azure/ci-windows-job.yml b/.azure/ci-windows-job.yml index 091e2c38..a23d7ce6 100644 --- a/.azure/ci-windows-job.yml +++ b/.azure/ci-windows-job.yml @@ -14,10 +14,10 @@ jobs: python.version: '3.7' python.arch: x86 addToPath: true - Py38_x86: - python.version: '3.8' - python.arch: x86 - addToPath: true + # Py38_x86: + # python.version: '3.8' + # python.arch: x86 + # addToPath: true Py36_x64: python.version: '3.6' python.arch: x64 @@ -26,10 +26,10 @@ jobs: python.version: '3.7' python.arch: x64 addToPath: true - Py38_x64: - python.version: '3.8' - python.arch: x64 - addToPath: true + # Py38_x64: + # python.version: '3.8' + # python.arch: x64 + # addToPath: true maxParallel: 4 From b3f0ee10dc81c25bd81bcb363e4ff9a75228ec3c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2019 20:19:12 -0700 Subject: [PATCH 10/12] Oops, use python3.8 for the 3.8 build --- .azure/ci-macos-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/ci-macos-job.yml b/.azure/ci-macos-job.yml index 56bccc19..91f4f8f4 100644 --- a/.azure/ci-macos-job.yml +++ b/.azure/ci-macos-job.yml @@ -20,7 +20,7 @@ jobs: Py38: python_version: '3.8.0' python_pkg: 'python-3.8.0-macosx10.9.pkg' - python: 'python3.7' + python: 'python3.8' maxParallel: 4 From 539c86f519564a6f4b85e22aed2985dcfcdd676c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2019 21:01:09 -0700 Subject: [PATCH 12/12] Move commented-out items outside of the matrix --- .azure/ci-windows-job.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.azure/ci-windows-job.yml b/.azure/ci-windows-job.yml index a23d7ce6..72053dfd 100644 --- a/.azure/ci-windows-job.yml +++ b/.azure/ci-windows-job.yml @@ -14,10 +14,6 @@ jobs: python.version: '3.7' python.arch: x86 addToPath: true - # Py38_x86: - # python.version: '3.8' - # python.arch: x86 - # addToPath: true Py36_x64: python.version: '3.6' python.arch: x64 @@ -26,12 +22,17 @@ jobs: python.version: '3.7' python.arch: x64 addToPath: true - # Py38_x64: - # python.version: '3.8' - # python.arch: x64 - # addToPath: true maxParallel: 4 +# Py38_x86: +# python.version: '3.8' +# python.arch: x86 +# addToPath: true +# Py38_x64: +# python.version: '3.8' +# python.arch: x64 +# addToPath: true + variables: {'PYTHONUNBUFFERED': '1'}