[Python-Dev] what to do if you don't want your module in Debian
Hi, Many Python module developers do not want their work to be distributed by Debian (and probably by other Linux distributions), here's a list of hints that will help you accomplish that goal: * depend on unstable or unreleased software (even if you use it only to generate docs or do unit tests), * bundle local copies of 3rd party modules and do not send your changes upstream, never document your changes in upstream code, * break API in every release, * break ABI in every second release, * do not ship all files needed to build the extension/docs/etc. in the source tarball, * do not list required dependencies in install_requires or INSTALL/README files, * if you list them, make sure you set the minimum required version to the one released yesterday, even if module works fine with version released 2 years ago, * create your own versioning schema (do not follow PEP-0386!), change it from time to time, * hardcode paths in the code and do it in as many places as you can (add new ones every few releases, that will teach them to not patch your code), * ignore FHS (you're using Windows after all); use __file__ whenever you can, * make sure there's nothing about license in LICENSE file or in file headers, * if you have some free time, create your own license, avoid BSD/MIT/(L)GPL, * if you use GPL, do not include full content of the license in the tarball, * release different tarballs with the same version number, * use waf as build-system, * release a new version without testing it with your own unit tests first to ensure that it will fail when your favourite Debian Developer tries to build it ;-) [debian-pyt...@l.d.o BCCed] -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 signature.asc Description: Digital signature ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] what to do if you don't want your module in Debian
[Tarek Ziadé, 2010-04-26] > Great hints, I'll try to follow them... and they could make a good > section in the Hitchhiker's guide to packaging ;) How about these two: http://us.pycon.org/media/2010/talkdata/PyCon2010/038/paper.html http://wiki.debian.org/GettingPackaged > [...] > > * ignore FHS (you're using Windows after all); use __file__ whenever > > you can, > > You should be permissive on that one. Until we know how to describe > resource files properly, > __file__ is what developer use when they need their projects to be portable.. > > Notice that we have started to work on fixing this - > http://hg.python.org/distutils2/file/tip/docs/design/wiki.rst if there's no other way (--install-data is ignored right now, and I know you're doing a great work to change that, thanks BTW), one could always use it in *one* place and later import the result in other parts of the code (instead of using __file__ again) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 signature.asc Description: Digital signature ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] PEP 3149 thoughts
[Georg Brandl, 2010-09-05] > Am 05.09.2010 19:22, schrieb "Martin v. Löwis": > > 2. Why does the PEP recommend installing stuff into /usr/share/pyshared? > >According to the Linux FHS, /usr/share is for Architecture- > >independent data, see > > > > http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA > >In particular, it's objective is that you can NFS-share it across, > >say, both SPARC Linux and x86 Linux. I believe the PEP would break > >this, as SPARC and x86 executables would override each other. > > Indeed. I think this is probably just an oversight and should be corrected > in the PEP. However, it's the distributions' call anyway. FYI: in Debian we will use /usr/lib/python3/ or even /usr/lib/python3/dist-packages/, as there are many modules with things like: os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', 'share', 'foo') -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] r84775 - peps/trunk/pep-3149.txt
[Antoine Pitrou, 2010-09-13] > > > >I meant how these decisions are implemented. Is there a configure > > >switch (there doesn't seem to be)? Does it require patching Python? > > > > Ah, no. Standard configure switches are used. Debian (inherited by Ubuntu) > > has a post-installation script for Python packages which create the .py > > symlinks and do the byte-compilation. The big win here is that much of this > > can go away now (and in fact there are modifications to this > > post-installation > > script already). > > Ok, so can you explain how the new thing will work (on Debian)? :) we have /usr/lib/python3/dist-packages in sys.path (via patched Lib/site.py). Our python3.1 will use the same directory as well (version in experimental is modified to use tagged extensions). distutils has additional --install-layout command which when set to "deb" uses Debian's locations, if distutils is not used (or --install-layout=deb not set), dh_python3 will move files to the right location at (package's) build time (and rename .so files) > Does it mean that e.g. /usr/lib/python3.2/site-packages will get > symlinked to /usr/lib/python? no, /usr/lib/python3.2/site-packages is not used at all (we don't use "site-packages" anymore to avoid conflicts with local installations of Python. /usr/lib/python3.2/dist-packages on the other hand is still in sys.path, but I'm not sure what we'll do with it (we still have to figure out what to do with modules that work with 3.2 only and cannot be patched due to f.e. from __future__ imports) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
["Martin v. Löwis", 2011-03-02] > > I think a PEP would help, but in this case I would request that before > > the PEP gets written (it can be a really short one!) somebody actually > > go out and get consensus from a number of important distros. Besides > > Barry, do we have any representatives of distros here? > > Matthias Klose represents Debian, Dave Malcolm represents Redhat, > and Dirkjan Ochtman represents Gentoo. I co-maintain with Matthias a package that provides /usr/bin/python symlink in Debian and I can confirm that it will always point to Python 2.X. We also do not plan to add /usr/bin/python2 symlink (and I guess only accepted PEP can change that) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
[Sandro Tosi, 2011-03-02] > On Wed, Mar 2, 2011 at 10:01, Piotr Ożarowski wrote: > > I co-maintain with Matthias a package that provides /usr/bin/python > > symlink in Debian and I can confirm that it will always point to Python > > 2.X. We also do not plan to add /usr/bin/python2 symlink (and I guess > > only accepted PEP can change that) > > Can you please explain why you NACK this proposed change? it encourages people to change /usr/bin/python symlink to point to python3.X which I'm strongly against (how can I tell that upstream author meant python3.X and not python2.X without checking the code?) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
[Sandro Tosi, 2011-03-02] > On Wed, Mar 2, 2011 at 13:56, Piotr Ożarowski wrote: > > [Sandro Tosi, 2011-03-02] > >> On Wed, Mar 2, 2011 at 10:01, Piotr Ożarowski wrote: > >> > I co-maintain with Matthias a package that provides /usr/bin/python > >> > symlink in Debian and I can confirm that it will always point to Python > >> > 2.X. We also do not plan to add /usr/bin/python2 symlink (and I guess > >> > only accepted PEP can change that) > >> > >> Can you please explain why you NACK this proposed change? > > > > it encourages people to change /usr/bin/python symlink to point to > > python3.X which I'm strongly against (how can I tell that upstream > > author meant python3.X and not python2.X without checking the code?) > > with 'people' do you mean 'users'? if so, isn't this risk already present? users already break their systems via "sudo ez_install ..." (note the "sudo" part!), I meant developers (distro and upstream authors). If a programmer develops a script in Python 3 on Arch and later ships his file with /usr/bin/python in shebang, it's very likely that this script will not work on all distributions that didn't (yet?) change the symlink. > If you, user, change the python symlink (provided by python-minimal in > Debian) to something else than what's shipped, it's still a local > change, and will never be supported; but with python2 *Debian is free* > to decide if python can be pointed to python3, if the time will come. ... and make other distributions developers' life miserable? -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
[Allan McRae, 2011-03-02] > But is that not the whole point of adding the /usr/bin/python2 symlink. > That way a developer can explicitly use a /usr/bin/python2 or > /usr/bin/python3 shebang and have it portable everywhere. At the moment, > Debian seems to be the major hold-up on that actually being a reality > being the only major distro I could find that does not provide such a > symlink. Do you realize how many (still perfectly usable) scripts written in Python 2.x few years ago (and not modified since then) are out there? Do you realize how much work would it require to fix every single one of them to point to /usr/bin/python2 instead? Even if we'd start checking mdate and change it at build time automatically, there still will be way too many false positives... for no clear gain. -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
[Allan McRae, 2011-03-02] > Having made the packages using python-2.x code from an entire > distribution point at /usr/bin/python2, I have a fair idea of how much > work is involved... * is every Arch package that uses Python 2.X already working with /usr/bin/python and why not? ;-) * how many Python packages do Arch have in the first place and why so little? ;-) * how does Arch deal with scripts that are not packaged, what do you say to users who report bugs against your packages because their local scripts do not work anymore? :-| -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
[Guido van Rossum, 2011-03-02] > On Wed, Mar 2, 2011 at 4:56 AM, Piotr Ożarowski wrote: > > [Sandro Tosi, 2011-03-02] > >> On Wed, Mar 2, 2011 at 10:01, Piotr Ożarowski wrote: > >> > I co-maintain with Matthias a package that provides /usr/bin/python > >> > symlink in Debian and I can confirm that it will always point to Python > >> > 2.X. We also do not plan to add /usr/bin/python2 symlink (and I guess > >> > only accepted PEP can change that) > >> > >> Can you please explain why you NACK this proposed change? > > > > it encourages people to change /usr/bin/python symlink to point to > > python3.X which I'm strongly against (how can I tell that upstream > > author meant python3.X and not python2.X without checking the code?) > > But the same is already true for python2.X vs. python2.Y. Explicit is > better than implicit etc. Plus, 5 years from now everybody is going to > be annoyed that "python" still refers to some ancient unused version > of Python. I don't really mind adding /usr/bin/python2 symlink just to clean Arch mess, but I do mind changing /usr/bin/python to point to python3 (and I can use the same argument - "Explicit is better than implicit" - if you need Python 3, say so in the shebang, right?). What I'm afraid of is when we'll add /usr/bin/python2, we'll start getting a lot of scripts that will have to be checked manually every time new upstream version is released because we cannot assume what upstream author is using at given point. If /usr/bin/python will be disallowed in shebangs on the other hand (and all scripts will use /usr/bin/python2, /usr/bin/python3, /usr/bin/python4 or /usr/bin/python2.6 etc.) I don't see a problem with letting administrators choose /usr/bin/python (right now not only changing it from python2.X to python3.X will break the system but also changing it from /usr/bin/pytohn2.X to /usr/bin/python2.Y will break it, and believe me, I know what I'm talking about (one of the guys at work did something like this once)) [all IMHO, dunno if other Debian's python-defaults maintainers agree with me] -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Support the /usr/bin/python2 symlink upstream
[Toshio Kuratomi, 2011-03-03] > On Thu, Mar 03, 2011 at 09:55:25AM +0100, Piotr Ożarowski wrote: > > If /usr/bin/python will be disallowed in shebangs on the other hand > > (and all scripts will use /usr/bin/python2, /usr/bin/python3, > > /usr/bin/python4 or /usr/bin/python2.6 etc.) I don't see a problem with > > letting administrators choose /usr/bin/python (right now not only > > changing it from python2.X to python3.X will break the system but also > > changing it from /usr/bin/python2.X to /usr/bin/python2.Y will break it, > > and believe me, I know what I'm talking about (one of the guys at work > > did something like this once)) > > > > [all IMHO, dunno if other Debian's python-defaults maintainers agree > > with me] > > > Thinking outside of the box, I can think of something that would satisfy > your requirements but I don't know how appropriate it is for upstream python > to ship with. Stop shipping /usr/bin/python. Ship "python" in an alternate > location to be honest, I didn't want to be so radical, a clear policy (PEP?) would be enough for me - we'd then replace all /usr/bin/python shebangs with /usr/bin/python2 at build time (with a warning to report bug upstream) and forward all complainers to this PEP) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Draft PEP: "Simplified Package Layout and Partitioning"
+1 (and yay!) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com