setup.py

changeset 7804
1cbc27e34ec6
parent 7800
96fae5353698
child 7807
5514ca6a62ca
--- a/setup.py	Sun Oct 18 12:42:37 2020 +0200
+++ b/setup.py	Sun Oct 18 18:51:45 2020 +0200
@@ -14,9 +14,12 @@
 import shutil
 import fnmatch
 import datetime
+import json
 
 from setuptools import setup, find_packages
 
+installInfoName = "eric6installpip.json"
+
 ######################################################################
 ## some helper functions below
 ######################################################################
@@ -241,6 +244,32 @@
     from PyQt5.uic import compileUiDir
     compileUiDir(dirName, True, __pyName)
 
+
+def createInstallInfoFile(dirName):
+    """
+    Create a file containing some rudimentary install information.
+    
+    @param dirName name of the directory to compile UI files for
+    @type str
+    """
+    global installInfoName
+    
+    installInfo = {
+        "sudo": False,
+        "user": "",
+        "exe": "",
+        "argv": "",
+        "eric": "",
+        "virtualenv": False,
+        "installed": False,
+        "guessed": False,
+        "edited": False,
+        "pip": True,
+        "remarks": "",
+    }
+    with open(os.path.join(dirName, installInfoName), "w") as infoFile:
+        json.dump(installInfo, infoFile, indent=2)
+
 ######################################################################
 ## setup() below
 ######################################################################
@@ -257,6 +286,7 @@
     compileUiFiles(sourceDir)
     prepareInfoFile(infoFileName, Version)
     prepareAppdataFile(appdataFileName, Version)
+    createInstallInfoFile(sourceDir)
     print("Preparation finished")           # __IGNORE_WARNING_M801__
 
 setup(
@@ -323,6 +353,7 @@
              ".bas", ".dat", ".xbel", ".xml", ".js"]
         ) + ["i18n/eric6_de.qm", "i18n/eric6_en.qm", "i18n/eric6_es.qm",
              "i18n/eric6_ru.qm",
+             installInfoName,
              ]
     },
     entry_points={

eric ide

mercurial