From 32f1e4219e90a2f38cad8e943f8cfd196e5ea239 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 24 Jul 2019 19:49:02 -0700 Subject: [PATCH] Add build commands and other support for wx.svg --- .gitignore | 4 ++++ build.py | 35 ++++++++++++++++++++++++++++++++++- requirements/devel.txt | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fa15edfc..404b99c1 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,10 @@ mydbstub.py* /wx/locale /wx/*.dll +/wx/svg/*.so +/wx/svg/*.pyd +wx/svg/_version.py + /unittests/lib_pubsub_provider_actual.py ubuntu-xenial-16.04-cloudimg-console.log diff --git a/build.py b/build.py index 50ea3eb0..59b488c3 100755 --- a/build.py +++ b/build.py @@ -1278,7 +1278,7 @@ def cmd_touch(options, args): etg = pathlib.Path('etg') for item in etg.glob('*.py'): item.touch() - + cmd_touch_others(options, args) def cmd_test(options, args, tests=None): @@ -1601,6 +1601,7 @@ def cmd_build_py(options, args): runcmd(cmd) copyWxDlls(options) + cmd_build_others(options, args) cfg = Config() cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale')) @@ -1640,6 +1641,36 @@ def cmd_build_docker(options, args): uploadTree(src, 'linux', options) +def cmd_build_others(options, args): + # Build other stuff that may have their own seprarate build commands instead + # of the (ab)normal etg/tweak/generate/sip/compile sequence that the rest of + # wxPython uses. So far, it's just the wx.svg package + cmdTimer = CommandTimer('build_others') + + cmd = [PYTHON, 'setup-wxsvg.py', 'build_ext', '--inplace'] + if options.verbose: + cmd.append('--verbose') + runcmd(cmd) + + +def cmd_touch_others(options, args): + cmdTimer = CommandTimer('touch_others') + pwd = pushDir(phoenixDir()) + cfg = Config(noWxConfig=True) + pth = pathlib.Path(opj(cfg.PKGDIR, 'svg')) + for item in pth.glob('*.pyx'): + item.touch() + + +def cmd_clean_others(options, args): + cmdTimer = CommandTimer('clean_others') + pwd = pushDir(phoenixDir()) + cfg = Config(noWxConfig=True) + files = [] + for wc in ['*.pyd', '*.so']: + files += glob.glob(opj(cfg.PKGDIR, 'svg', wc)) + delFiles(files) + def cmd_install(options, args): cmdTimer = CommandTimer('install') @@ -1813,6 +1844,8 @@ def cmd_clean_py(options, args): cmd_clean_py(options, args) options.both = True + cmd_clean_others(options, args) + def cmd_clean_sphinx(options, args): cmdTimer = CommandTimer('clean_sphinx') diff --git a/requirements/devel.txt b/requirements/devel.txt index 7233f712..17e72071 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -6,6 +6,7 @@ wheel twine sphinx requests +cython pytest pytest-xdist pytest-forked