Re: [Distutils] Setuptools should not depend on setuptools.
On Thu, Mar 12, 2009 at 03:38, P.J. Eby p...@telecommunity.com wrote: That's not a catch 22. You simply run a 2.x setup.py with options that cause the conversion to take place before running 3.x over the converted result. Now you have a 3.x version. How do you run this? What is the command you would use? -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
On Thu, Mar 12, 2009 at 08:35, Lennart Regebro rege...@gmail.com wrote: On Thu, Mar 12, 2009 at 03:38, P.J. Eby p...@telecommunity.com wrote: That's not a catch 22. You simply run a 2.x setup.py with options that cause the conversion to take place before running 3.x over the converted result. Now you have a 3.x version. How do you run this? What is the command you would use? Eh, whatever, ignore the question. I'm tired of arguing. I obviously can't make myself understood, and I'm not going to do anything about this before PyCon anyway, and I'm of the opinion that setuptools should be merged into disutils anyway. maybe people like that suggestion better, and then this argument becomes moot. :) -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
At 08:38 AM 3/12/2009 +0100, Lennart Regebro wrote: On Thu, Mar 12, 2009 at 08:35, Lennart Regebro rege...@gmail.com wrote: On Thu, Mar 12, 2009 at 03:38, P.J. Eby p...@telecommunity.com wrote: That's not a catch 22. You simply run a 2.x setup.py with options that cause the conversion to take place before running 3.x over the converted result. Now you have a 3.x version. How do you run this? What is the command you would use? Eh, whatever, ignore the question. I'm tired of arguing. I'm not aware anyone was arguing. I'm simply trying to understand what the problem is. There appears to be some unstated assumptions that we don't share, and I've been trying to find out what they are. I've suggested that perhaps my assumption that both the 2.x and 3.x interpreters are available was the one we don't share, but you didn't comment on that. Another possible assumption we don't share might be that a single source distribution with a single, bilingual (biversional?) setup.py is required. (I assume this is not required... but then again, it could perhaps be worked around by having a version-detecting setup.py that then invokes a setup2.py or setup3.py, accordingly.) So I still don't know what the problem is, because you've not exposed all of your assumptions (as far as I can tell), nor corrected any of mine. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
On Thu, Mar 12, 2009 at 17:51, P.J. Eby p...@telecommunity.com wrote: I'm not aware anyone was arguing. OK, wrong word explaining then. :) I've suggested that perhaps my assumption that both the 2.x and 3.x interpreters are available was the one we don't share, but you didn't comment on that. I though I did comment on the question about only Python 3 being available. And easy_install -U will not work for python 3 if you need to use Python 2 for the first step of the installation. And buildout sometimes requires updates to distutils, which currently is done automatically, that won't work. And installation on Python 3 will be a complicated multi-step affair. Another possible assumption we don't share might be that a single source distribution with a single, bilingual (biversional?) setup.py is required. Well, no, but that is a relatively minor problem. Unless you suggest that we have complety separate setups, with one python 2.x install and setup command, and one python 3 install and setup command. That seems kinda silly, IMO. So I still don't know what the problem is, because you've not exposed all of your assumptions (as far as I can tell), nor corrected any of mine. I don't have many assumptions. I just want the setuptools install and tests to work as expected under both python2 and python3. And that means that python3.0 setup.py install should work. And python3.0 setup.py test would be nice too, although it's less important. -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
At 06:20 PM 3/12/2009 +0100, Lennart Regebro wrote: I don't have many assumptions. I just want the setuptools install and tests to work as expected under both python2 and python3. And that means that python3.0 setup.py install should work. And python3.0 setup.py test would be nice too, although it's less important. In which case, either separate source distros are required, or 2to3 will need to be present, and the main setup.py will need to detect python3 and run 2to3 on itself, then execfile the setup script of the newly-generated, python3 version of the same package. Please note that even if you make setuptools not depend on itself, all you are really doing is *moving* this problem to a different level. Whatever it is that it depends on, will still need to be duplicated for python2 and python3... and what's more, having a way worked out to do this will be of benefit to other packages besides setuptools, especially if setuptools provides some native support for the feature. (Like a standardized setup.py and setup3.py that delegate to the user's original 'setup2.py'.) ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
On Thu, Mar 12, 2009 at 19:02, P.J. Eby p...@telecommunity.com wrote: In which case, either separate source distros are required Which I would like to avoid. or 2to3 will need to be present It is, as it's included with Python. and the main setup.py will need to detect python3 and run 2to3 on itself, then execfile the setup script of the newly-generated, python3 version of the same package. Yup, that's the idea. Please note that even if you make setuptools not depend on itself, all you are really doing is *moving* this problem to a different level. Whatever it is that it depends on, will still need to be duplicated for python2 and python3... Well, the build_py, for python 2 and the build_py_2to3 commands are already in distutils, so I'm not sure exactly what would need to be duplicated. and what's more, having a way worked out to do this will be of benefit to other packages besides setuptools Well, that's what I'm trying to do. ;) -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
At 04:50 PM 3/11/2009 +0100, Lennart Regebro wrote: When porting setuptools to Python 3, I recently looked into doing the 3.0 development a bit nicer, by being able to run 2to3 as a part of the installation or test commands. However, this turns out to be impossible, because every part of setuptools assumes that setuptools is available and working. This also means, even under Python 2.x development, that should you break for example the dist module a bit too much, setuptools stops working, and you can't even run the tests. Therefore, one thing that should be done is to make setuptools not depend on setuptools. Building, installoing, testing, should require disutils only. Distutils doesn't have a test command... let alone an egg_info command. It might be easier to have a build_py option to run 2to3 on stuff in the build directory, and a test variant that runs against the build tree instead of the source tree... and runs under Python 3 instead of 2. It's easier to see (at least for me) how something like that could potentially work, than how to make setuptools not depend on itself. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
On Wed, Mar 11, 2009 at 19:07, P.J. Eby p...@telecommunity.com wrote: Distutils doesn't have a test command... let alone an egg_info command. Well does setuptools? It's all command extensions, isn't it? It might be easier to have a build_py option to run 2to3 on stuff in the build directory, and a test variant that runs against the build tree instead of the source tree... and runs under Python 3 instead of 2. Yes, that's the idea, but I can't do that as long as the test option depends on setuptools, as it will fail to import, since it's 2.x code. -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
At 07:16 PM 3/11/2009 +0100, Lennart Regebro wrote: On Wed, Mar 11, 2009 at 19:07, P.J. Eby p...@telecommunity.com wrote: Distutils doesn't have a test command... let alone an egg_info command. Well does setuptools? It's all command extensions, isn't it? It might be easier to have a build_py option to run 2to3 on stuff in the build directory, and a test variant that runs against the build tree instead of the source tree... and runs under Python 3 instead of 2. Yes, that's the idea, but I can't do that as long as the test option depends on setuptools, as it will fail to import, since it's 2.x code. Why not just invoke: python3 -m unittest somemodule.somesuite Then there are no dependencies on distutils or setuptools. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
On Wed, Mar 11, 2009 at 21:47, P.J. Eby p...@telecommunity.com wrote: Why not just invoke: python3 -m unittest somemodule.somesuite Then there are no dependencies on distutils or setuptools. Because it needs to run 2to3 on the code first. Also, python3 setup.py install will fail, becuase the installation depends on setuptools, and then I need to do build_py_2to3 on the code, which isn't going to work if the install program depends on setuptools, as it hasn't been converted to Python3 yet. The alternative, which seems less likely, is to rewrite setuptools to run under Python 2.3, 2.4, 2.5, 2.6 and 3.0 without using 2to3. :-D Or of course, continue having a separate source distribution for Python 3 and a bit complicated development process, which is survivable, but I don't think it's a good long term strategy. -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
At 10:14 PM 3/11/2009 +0100, Lennart Regebro wrote: On Wed, Mar 11, 2009 at 21:47, P.J. Eby p...@telecommunity.com wrote: Why not just invoke: python3 -m unittest somemodule.somesuite Then there are no dependencies on distutils or setuptools. Because it needs to run 2to3 on the code first. That's what the build_py option (to run 2to3 on the copied .py files) would be for. Also, python3 setup.py install will fail, becuase the installation depends on setuptools, and then I need to do build_py_2to3 on the code, which isn't going to work if the install program depends on setuptools, as it hasn't been converted to Python3 yet. I think we must be entirely misunderstanding each other here. I don't see where the problem is, exactly. Assuming that 2to3 can convert some version of 2.x-compatible setuptools to a valid 3.x-compatible version, self-dependency would not be an issue. Likewise, using 2.x to manage the process of converting and then invoking tests in 3.x on the converted version, doesn't seem like a problem to me either. You just run separate interpreters for anything that needs 3.x to run, while leaving the primary build operations in 2.x. If you're trying to say that you want a build process that can run without there being a 2.x interpreter present, but starts with the same source code base, I don't see how that's possible without having some sort of alternative setup3.py or other .py scripts present, to do the conversion. The alternative, which seems less likely, is to rewrite setuptools to run under Python 2.3, 2.4, 2.5, 2.6 and 3.0 without using 2to3. :-D Or of course, continue having a separate source distribution for Python 3 and a bit complicated development process, which is survivable, but I don't think it's a good long term strategy. You can have a single source distribution, you'll just need a different way to access the 3.x stuff from the 2.x stuff, like a 'setup3.py' or something. (This might be a useful idea in general, not just for setuptools.) ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
On Wed, Mar 11, 2009 at 22:56, P.J. Eby p...@telecommunity.com wrote: If you're trying to say that you want a build process that can run without there being a 2.x interpreter present, but starts with the same source code base, I don't see how that's possible without having some sort of alternative setup3.py or other .py scripts present, to do the conversion. It's not a problem in general, the probleme here is that setuptools setup.py depends on setuptools, causing a catch22 situation, where you need to convert setuptools to Python3, before you can run the installer install it, and therefore you can't run the installer to convert to Python 3. -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Setuptools should not depend on setuptools.
At 11:04 PM 3/11/2009 +0100, Lennart Regebro wrote: On Wed, Mar 11, 2009 at 22:56, P.J. Eby p...@telecommunity.com wrote: If you're trying to say that you want a build process that can run without there being a 2.x interpreter present, but starts with the same source code base, I don't see how that's possible without having some sort of alternative setup3.py or other .py scripts present, to do the conversion. It's not a problem in general, the probleme here is that setuptools setup.py depends on setuptools, causing a catch22 situation, where you need to convert setuptools to Python3, before you can run the installer install it, and therefore you can't run the installer to convert to Python 3. That's not a catch 22. You simply run a 2.x setup.py with options that cause the conversion to take place before running 3.x over the converted result. Now you have a 3.x version. Heck, you could probably just make a '2to3' command plugin, that converts the program and then runs python3 on the converted setup.py, passing in its remaining arguments, such that e.g.: python setup.py 2to3 [options] test ... Would be the equivalent of running 2to3 with the specified options, then running python3 setup.py test ... in the target directory. Again, I'm not seeing where any problem exists here. ___ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig