Re: [Distutils] how to easily consume just the parts of eggs that are good for you
On Sat, 12 Apr 2008, Greg Ewing wrote: John J Lee wrote: I keep hoping that someday Linux will support something like MacOSX application bundles and frameworks, Not the same, but something like: http://0install.net/ That looks interesting, but I'm not sure I'd quite call it something like. It looks like another case of adding more complexity to fight existing complexity, rather than removing the original complexity. In other words, it seems to be just another package manager, albeit a particulary nice-sounding one. It allows you to think about uninstallation as delete the app == delete the file (the file might be different in different systems -- e.g. with ROX, it seems very similar to how I imagine Mac OS applications look, and certainly very similar to how RISC OS apps used to look). But it also (plausibly) claims to allow sharing of the data that comprises an application and its dependencies between users who don't trust each other (while preserving other desirable properties like the one in the previous paragraph, such as avoidance of version conflicts, etc.). I think that property probably justifies the added implementation complexity over unshared directories of files. And the desire for that property isn't a consequence of fighting existing complexity, right? John ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
On Sat, 2008-04-12 at 12:19 -0400, Phillip J. Eby wrote: At 09:07 PM 4/11/2008 -0700, Cliff Wells wrote: It seems the correct solution to this is to use #!/usr/bin/env python (or rather, evaluate `which env` to account for some systems which have /bin/env rather that /usr/bin/env) which allows the sys admin to override the Python binary much more easily. No, it isn't the correct solution. The correct solution is to re-run easy_install on the target -- it will leave the existing installed code in place, but regenerate the scripts with headers pointing to the currently-in-use Python. This is good to know, but still not as good as using env and the reason is simple: every Unix user on the planet knows the env solution and what it means if they see it in a script (they can override using PATH). The same cannot be said for the above. Unless I'm missing something, I can't see the advantage your way has over the traditional way. I'll be glad to hear how I'm wrong. Even that is often not as good an idea as reinstalling for a new version of Python; some packages (notably, setuptools itself, but I have others) include different code and data depending on the Python version they are built for. For example, a package built for Python 2.5 might not include dependency specs for ctypes, sqlite, or wsgiref, but the same package might need to specify those dependencies on earlier versions of Python. Absolutely. Except I was specifically *not* upgrading many applications. Rather I wanted them to remain at 2.4. These are the ones I had to change the shebang line for. Now I know I could have run easy_install instead, but that information wasn't easily located at the time. By the way, please don't send me unsolicited private emails about setuptools unless you're a client or potential client. There's a reason that every single official web page about setuptools directs you to email the distutils-sig. I don't do private email for ANY of my open source projects, unless you're a client or looking to be one. Mailing lists have searchable archives, meaning that my time answering a question is being offset by its potential utility to a much larger audience. Thanks. My apologies. The link for the mailing list on the page that covers this on the peak site is quite small and follows a lot of text. Regards, Cliff Wells ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
At 09:58 AM 4/12/2008 -0700, Cliff Wells wrote: Unless I'm missing something, I can't see the advantage your way has over the traditional way. Well for one, it isn't affected by changes in PATH. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
On Sat, 2008-04-12 at 13:49 -0400, Phillip J. Eby wrote: At 09:58 AM 4/12/2008 -0700, Cliff Wells wrote: Unless I'm missing something, I can't see the advantage your way has over the traditional way. Well for one, it isn't affected by changes in PATH. I'd call this a distinct disadvantage: the shebang line is a Unixism, not a Pythonism. Python applications shouldn't be an aberation on a Unix platform. PATH is *supposed* to affect applications. Trying to break this isn't helping anyone. It's also worth noting that this a deployment-specific consideration. Many deployers are not Python experts (or at least, we shouldn't expect them to be), but they ought to be fairly expert in their deployment platform. I would not expect a sysadmin to know where to start looking to know that they should re-run easy_install, but I would certainly expect them to know how to fix a PATH variable for an account. Regards, Cliff Wells ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
At 12:30 PM 4/12/2008 -0700, Cliff Wells wrote: PATH is *supposed* to affect applications. It affects which application you should run, not which interpreter you run the application with. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
On Sat, 2008-04-12 at 17:53 -0400, Phillip J. Eby wrote: At 12:30 PM 4/12/2008 -0700, Cliff Wells wrote: PATH is *supposed* to affect applications. It affects which application you should run, not which interpreter you run the application with. I think that's splitting hairs and pretty much just made up to defend your position. Regardless, ultimately it's dead wrong. Of *course* it should affect which interpreter you run. If I install a patched version of Python (or Perl, or PHP, or whatever), into /usr/local/bin and put that before /usr/bin in the PATH, I most absolutely expect that to be the interpreter that is used, regardless of what was used at the time the app was installed. If this breaks the application, it's fairly straightforward to adjust the PATH to fix it. Most importantly, it's something that a Unix admin (vs a Python programmer) can be expected to know. Anyway, regardless of who's correct concerning this issue (we can agree to disagree), I'm cannot understand why you'd want Python to behave differently (from a deployment standpoint) than other languages. If you want sysadmins to hate deploying Python apps, you are on the right road (make it unusual and require special Python knowledge to do right). In fact, rightness has little to do with it. Many conventions and standards aren't right, but they continue to exist because that's what is understood. Being right at the expense of being non-standard isn't necessarily a good choice. Regards, Cliff ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Apr 12, 2008, at 6:26 PM, Cliff Wells wrote: On Sat, 2008-04-12 at 17:53 -0400, Phillip J. Eby wrote: At 12:30 PM 4/12/2008 -0700, Cliff Wells wrote: PATH is *supposed* to affect applications. It affects which application you should run, not which interpreter you run the application with. I think that's splitting hairs and pretty much just made up to defend your position. Regardless, ultimately it's dead wrong. Of *course* it should affect which interpreter you run. If I install a patched version of Python (or Perl, or PHP, or whatever), into /usr/local/bin and put that before /usr/bin in the PATH, I most absolutely expect that to be the interpreter that is used, regardless of what was used at the time the app was installed. If this breaks the application, it's fairly straightforward to adjust the PATH to fix it. Most importantly, it's something that a Unix admin (vs a Python programmer) can be expected to know. Many operating systems and distributions now use Python extensively. Those should absolutely hardcode the #! line to use the system Python and should not in any way be affected by my $PATH. I've seen too many situations where changing $PATH breaks some aspect of the OS. I happen to think that setuptools is doing the right thing here, but it would be nice to have an override. - -Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (Darwin) iQCVAwUBSAE6AXEjvBPtnXfVAQJKuQP+JfqPDweFzQ1hN50XFQbi6InQEqL+b+dY M4UIdl5aS48ozoYIKGgM1aItgt/dfe0imCQkl2/cY9vzjmRRVVzK0RurPHjxyAWT CSFi+FuG54rJV4M0xwnoAZaEHQqo65g35iGz+mMe68ytKaSEt1TgukRzyF6RudBf 3Up+IgC8Kqc= =7t0k -END PGP SIGNATURE- ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
On Sat, Apr 12, 2008 at 03:26:52PM -0700, Cliff Wells wrote: Anyway, regardless of who's correct concerning this issue (we can agree to disagree), I'm cannot understand why you'd want Python to behave differently (from a deployment standpoint) than other languages. Numbers ! Only numbers can speak. On my Ubuntu box (standard, nothing special done to it): [EMAIL PROTECTED]:~$ grep '#!/usr/bin/env python' /usr/bin/* 2/dev/null wc -l 33 [EMAIL PROTECTED]:~$ grep '#!/usr/bin/python' /usr/bin/* 2/dev/null | wc -l 113 And if we don't look at the language type: [EMAIL PROTECTED]:~$ grep '#!/usr/bin/env' /usr/bin/* 2/dev/null | wc -l 39 (the rest is pretty much perl, by the way). On a server I have an account on (Debian, I don't administer it): [EMAIL PROTECTED]:~$ grep '#!/usr/bin/env' /usr/bin/* 2/dev/null | wc -l 52 (this one has a much higher ratio of perl to python). On my mailhost: [EMAIL PROTECTED]:~$ grep '#!/usr/bin/python' /usr/bin/* 2/dev/null | wc -l 10 [EMAIL PROTECTED]:~$ grep '#!/usr/bin/env' /usr/bin/* 2/dev/null /usr/bin/raggle:#!/usr/bin/env ruby /usr/bin/web2png:#!/usr/bin/env python On my hosted and managed webserver (these guys seem to like ruby): (uiserver):u39018796:~ grep '#!/usr/bin/python' /usr/bin/* 2/dev/null | wc -l 0 (uiserver):u39018796:~ grep '#!/usr/bin/env' /usr/bin/* 2/dev/null /usr/bin/gem:#!/usr/bin/env ruby /usr/bin/gem_mirror:#!/usr/bin/env ruby /usr/bin/gem_server:#!/usr/bin/env ruby /usr/bin/gemlock:#!/usr/bin/env ruby /usr/bin/gemri:#!/usr/bin/env ruby /usr/bin/gemwhich:#!/usr/bin/env ruby /usr/bin/index_gem_repository:#!/usr/bin/env ruby (uiserver):u39018796:~ grep '#!/usr/bin/ruby' /usr/bin/* 2/dev/null /usr/bin/erb1.8:#!/usr/bin/ruby1.8 /usr/bin/irb1.8:#!/usr/bin/ruby1.8 /usr/bin/rdoc1.8:#!/usr/bin/ruby1.8 /usr/bin/testrb1.8:#!/usr/bin/ruby1.8 (uiserver):u39018796:~ In conclusion, I think there is no real rule. It is more on a case by case basis. I prefer the env. I could yell to the top of my voice on this mailing list to back my opinion. But the numbers are there, and they don't help me make my point :-). Gaƫl ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
At 03:26 PM 4/12/2008 -0700, Cliff Wells wrote: On Sat, 2008-04-12 at 17:53 -0400, Phillip J. Eby wrote: At 12:30 PM 4/12/2008 -0700, Cliff Wells wrote: PATH is *supposed* to affect applications. It affects which application you should run, not which interpreter you run the application with. I think that's splitting hairs and pretty much just made up to defend your position. Anybody who thinks they can globally change which Python interpreter they're running their scripts with is cruising for a serious bruising. Better they discover their error sooner than later. Have you ever wondered why Red Hat has that stupid 'python2' executable? It's because they used #! lines pointing to 'python' rather than referencing a specific *version* of Python... and had to pay for it for years thereafter. (That's also, by the way, why easy_install also always installs a versioned executable name for itself.) ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Apr 12, 2008, at 6:50 PM, Gael Varoquaux wrote: On Sat, Apr 12, 2008 at 03:26:52PM -0700, Cliff Wells wrote: Anyway, regardless of who's correct concerning this issue (we can agree to disagree), I'm cannot understand why you'd want Python to behave differently (from a deployment standpoint) than other languages. Numbers ! Only numbers can speak. On my Ubuntu box (standard, nothing special done to it): [EMAIL PROTECTED]:~$ grep '#!/usr/bin/env python' /usr/bin/* 2/dev/ null wc -l 33 And if we don't look at the language type: [EMAIL PROTECTED]:~$ grep '#!/usr/bin/env' /usr/bin/* 2/dev/null | wc -l 39 These are all broken and you should report bugs on them. I have reported many for Ubuntu. A system application should only ever depend on the system Python (or interpreter), never on the whims of your $PATH. If you want an application to depend on $PATH, grab a development release and install that in your favorite location. That's when /usr/bin/env is appropriate. Cheers, - -Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (Darwin) iQCVAwUBSAFMoXEjvBPtnXfVAQKC2gQAgiFFH9KGinw3yy9wyAI6p1Hn2Sy+Sb6e x5z3B9kkT99zOl5AxdsaCEPWEIB+/Q2tRJypZXPVe9o7GPMIZETF9RzGIFV/tsmh LQF+lIPbdvXHsK1f1CibuRt3P+ij+EuSWH81FI7uE3SLXine51WRW+Pp+m3+74Xp kEP1dWn1GvE= =NFBv -END PGP SIGNATURE- ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
On Sat, 2008-04-12 at 19:54 -0400, Phillip J. Eby wrote: At 03:26 PM 4/12/2008 -0700, Cliff Wells wrote: On Sat, 2008-04-12 at 17:53 -0400, Phillip J. Eby wrote: At 12:30 PM 4/12/2008 -0700, Cliff Wells wrote: PATH is *supposed* to affect applications. It affects which application you should run, not which interpreter you run the application with. I think that's splitting hairs and pretty much just made up to defend your position. Anybody who thinks they can globally change which Python interpreter they're running their scripts with is cruising for a serious bruising. Better they discover their error sooner than later. If you are on RedHat, yes. On Gentoo, SourceMage, Foresight, etc the system is expected to do a rolling upgrade. So what you call an error is what is thought of as a superior method by many others. Have you ever wondered why Red Hat has that stupid 'python2' executable? It's because they used #! lines pointing to 'python' rather than referencing a specific *version* of Python... and had to pay for it for years thereafter. But these are system apps we are discussing, not user apps. System apps are not managed by setuptools, rather they are managed by the system's package manager. I agree they should point to the system python, whatever the system decides that should be, and the system should be responsible any upgrading to be done. In fact, it's specifically *because* of many distros depending so heavily on a particular version of Python that userspace Python apps need more flexibility in this area. /usr/bin/python is quite likely going to be out-of-date before the system as a whole is (or in my case, the other way around, as Gentoo moved to 2.5 before all my applications had). Either way, if they system Python and the userspace Python requirements get out of sync, it's clearly the userspace that's going to have to be flexible. (That's also, by the way, why easy_install also always installs a versioned executable name for itself.) Actually, if easy_install did something like #!/usr/bin/python2.4 I think I'd have less of an issue. It would allow me to upgrade the system Python (which on Gentoo, for instance, you can safely do) while allowing legacy apps to continue to function until they can be upgraded. In fact, this would almost incidentally lead people down the right road to fixing it the way you suggest since they will certainly have to easy_install their required libraries under the new interpreter. Regards, Cliff ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] how to easily consume just the parts of eggs that are good for you
John J Lee wrote: It allows you to think about uninstallation as delete the app == delete the file But 0install doesn't do that, as far as I can tell -- it still keeps the data in some mysterious form and location known only to itself, and requires you to use special tools to install/remove apps. with ROX, it seems very similar to how I imagine Mac OS applications look Yes, ROX is very MacOSX-like, but I don't think it has anything to do with 0install. But it also (plausibly) claims to allow sharing of the data that comprises an application and its dependencies between users who don't trust each other If ROX apps included a checksum, and the system verified it before running the app, that would give you the same thing trust-wise, I think. Dependency management is the part I agree is lacking in a MacOSX-like approach. Some tool for helping with that would be good to have. But I don't think it's necessary to make the components whose dependencies are being managed into anything complicated or mysterious in order to get that. They should just be files or directories that I can put into place myself, and look at to find out what I have. -- Greg ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] shebang line modified by setuptools
On Sat, 2008-04-12 at 19:54 -0400, Phillip J. Eby wrote: (That's also, by the way, why easy_install also always installs a versioned executable name for itself.) So if setuptools can rely on this name, why doesn't it use it in the shebang line? Regards, Cliff ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig