[meld/flatpak-ci] setup.py: Pull meld.conf import hack from setup_win32.py



commit 150697581fa4e1bfd63445a0dd429cdbc7bc2722
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Dec 21 06:48:46 2019 +1000

    setup.py: Pull meld.conf import hack from setup_win32.py

 setup.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755
index 14e3ee75..a14b66ac
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,19 @@
 #!/usr/bin/env python3
 
 import glob
+import pathlib
 from distutils.core import setup
 
-import meld.build_helpers
-import meld.conf
+# 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 isort:skip
+import meld.conf  # noqa:E402 isort:skip
 
 setup(
     name=meld.conf.__package__,


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