Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done. eric7

Tue, 20 Jun 2023 11:11:35 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 20 Jun 2023 11:11:35 +0200
branch
eric7
changeset 10091
ac6edcfe7831
parent 10090
8be7dd9460c5
child 10092
679df6285434

Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.

scripts/install-debugclients.py file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
scripts/uninstall-debugclients.py file | annotate | diff | comparison | revisions
scripts/uninstall.py file | annotate | diff | comparison | revisions
src/eric7/EricWidgets/EricMessageBox.py file | annotate | diff | comparison | revisions
--- a/scripts/install-debugclients.py	Thu Jun 15 19:13:51 2023 +0200
+++ b/scripts/install-debugclients.py	Tue Jun 20 11:11:35 2023 +0200
@@ -92,6 +92,15 @@
     global modDir, pyModDir
 
     modDir = sysconfig.get_path("platlib")
+    if not os.access(modDir, os.W_OK):
+        # can't write to the standard path, use the 'user' path instead
+        if sys.platform.startswith(("win", "cygwin")):
+            scheme = "nt_user"
+        elif sys.platform == "darwin":
+            scheme = "osx_framework_user"
+        else:
+            scheme = "posix_user"
+        modDir = sysconfig.get_path("platlib", scheme)
     pyModDir = modDir
 
 
--- a/scripts/install.py	Thu Jun 15 19:13:51 2023 +0200
+++ b/scripts/install.py	Tue Jun 20 11:11:35 2023 +0200
@@ -210,6 +210,15 @@
             platBinDir = os.path.expanduser("~/bin")
 
     modDir = sysconfig.get_path("platlib")
+    if not os.access(modDir, os.W_OK):
+        # can't write to the standard path, use the 'user' path instead
+        if sys.platform.startswith(("win", "cygwin")):
+            scheme = "nt_user"
+        elif sys.platform == "darwin":
+            scheme = "osx_framework_user"
+        else:
+            scheme = "posix_user"
+        modDir = sysconfig.get_path("platlib", scheme)
     pyModDir = modDir
 
     pyqtDataDir = os.path.join(modDir, "PyQt6")
--- a/scripts/uninstall-debugclients.py	Thu Jun 15 19:13:51 2023 +0200
+++ b/scripts/uninstall-debugclients.py	Tue Jun 20 11:11:35 2023 +0200
@@ -66,6 +66,15 @@
     global modDir, pyModDir
 
     modDir = sysconfig.get_path("platlib")
+    if not os.access(modDir, os.W_OK):
+        # can't write to the standard path, use the 'user' path instead
+        if sys.platform.startswith(("win", "cygwin")):
+            scheme = "nt_user"
+        elif sys.platform == "darwin":
+            scheme = "osx_framework_user"
+        else:
+            scheme = "posix_user"
+        modDir = sysconfig.get_path("platlib", scheme)
     pyModDir = modDir
 
 
--- a/scripts/uninstall.py	Thu Jun 15 19:13:51 2023 +0200
+++ b/scripts/uninstall.py	Tue Jun 20 11:11:35 2023 +0200
@@ -89,6 +89,15 @@
     global pyModDir
 
     pyModDir = sysconfig.get_path("platlib")
+    if not os.access(pyModDir, os.W_OK):
+        # can't write to the standard path, use the 'user' path instead
+        if sys.platform.startswith(("win", "cygwin")):
+            scheme = "nt_user"
+        elif sys.platform == "darwin":
+            scheme = "osx_framework_user"
+        else:
+            scheme = "posix_user"
+        pyModDir = sysconfig.get_path("platlib", scheme)
 
 
 def wrapperNames(dname, wfile):
--- a/src/eric7/EricWidgets/EricMessageBox.py	Thu Jun 15 19:13:51 2023 +0200
+++ b/src/eric7/EricWidgets/EricMessageBox.py	Tue Jun 20 11:11:35 2023 +0200
@@ -152,7 +152,7 @@
         return messageBox.standardButton(clickedButton)
 
 
-# the about functions are here for consistancy
+# the about functions are here for consistency
 about = QMessageBox.about
 aboutQt = QMessageBox.aboutQt
 

eric ide

mercurial