[meld/flatpak-ci] Update win32 build for conf.py change



commit 6b868b22d59cd50806a14728008e394ab0f03abb
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Dec 1 07:15:26 2019 +1000

    Update win32 build for conf.py change

 setup.cfg      |  2 +-
 setup_win32.py | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/setup.cfg b/setup.cfg
index bbe7f57d..2ee4f566 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -26,4 +26,4 @@ order_by_type = True
 use_parentheses = True
 indent = 4
 include_trailing_comma = True
-skip = bin/meld
+skip = bin/meld, setup_win32.py
diff --git a/setup_win32.py b/setup_win32.py
index e8461cd0..7d7a0cfd 100755
--- a/setup_win32.py
+++ b/setup_win32.py
@@ -2,15 +2,13 @@
 
 import glob
 import os.path
+import pathlib
 import platform
 import sys
 import sysconfig
 
 from cx_Freeze import Executable, setup
 
-import meld.build_helpers
-import meld.conf
-
 
 def get_non_python_libs():
     """Returns list of tuples containing extra dependencies required to run
@@ -125,6 +123,18 @@ if 'mingw' in sysconfig.get_platform():
          "shortcutDir": "ProgramMenuFolder",
     })
 
+# Copy conf.py in place if necessary
+base_path = pathlib.Path(__file__).parent
+conf_path = base_path / 'meld' / 'conf.py'
+
+if not conf_path.exists():
+    import shutil
+    shutil.copyfile(conf_path.with_suffix('.py.in'), conf_path)
+
+import meld.build_helpers  # noqa: E402
+import meld.conf  # noqa: E402
+
+
 setup(
     name="Meld",
     version=meld.conf.__version__,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]