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

Disabling pip for root? (was: PEP 453 affects Debian packaging of Python packages)



On 2013-09-18 09:36, Paul Tagliamonte wrote:
>   1) pip isn't for global package management, for this is stupid. If we
>      disabled root use of pip, I think we'd all be a bit happier.

Very quick and very dirty patch attached.

>   4) Python modules from dpkg are borderline useless for developers. We
>      package modules so that apps can use them, not so that people can
>      develop with them.

That is maybe my problem with pip: Developers tend to use every Python
library in every version they like from PyPI. As a project leader I
generally have to think about deployment and this means: Use Debian
stable and backports! Only for long-term projects the next Debian
stable release might be relevant. But if you have a dozen or so
libraries installed by pip, there are libraries that will not be
packaged for Debian and the deployment is wrecked.
--- /usr/bin/pip	2013-08-20 00:37:24.000000000 +0200
+++ pip	2013-09-19 11:11:04.567271401 +0200
@@ -2,6 +2,13 @@
 # EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.4.1','console_scripts','pip'
 __requires__ = 'pip==1.4.1'
 import sys
+
+import os
+
+if os.getuid() <= 100:
+    print >> sys.stderr, "a nice insult from the sudo insults list?"
+    sys.exit(-1)
+
 from pkg_resources import load_entry_point
 
 if __name__ == '__main__':

Reply to: