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..91f4f8f4 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.8' + maxParallel: 4 variables: {'PYTHONUNBUFFERED': '1'} diff --git a/.azure/ci-windows-job.yml b/.azure/ci-windows-job.yml index 1d1edc0a..72053dfd 100644 --- a/.azure/ci-windows-job.yml +++ b/.azure/ci-windows-job.yml @@ -24,6 +24,15 @@ jobs: 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'} 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/etg/app.py b/etg/app.py index ba26f6c7..4ad6f47a 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,32 @@ 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="""\ + self.ResetLocale() + import locale + 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 + if info: + self._initial_locale = wx.Locale(info.Language) + else: + # otherwise fall back to the system default + 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. @@ -512,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=[ 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("""\ #---------------------------------------------------------------------------- diff --git a/requirements/install.txt b/requirements/install.txt index eeb7cd86..159b7094 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 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