Re: [Python-Dev] Language summit writeup anyone?
On Mon, Jun 20, 2011 at 1:31 PM, Antoine Pitrou wrote: > Maciej Fijalkowski a écrit : >> >> Unfortunately I'm missing Europython (and language summit) this year. >> Did anyone do a writeup on what was discussed? > > Mark Dickinson has been taking notes, but since there only a few of us > (roughly 10 attendants), it was mostly casual and friendly chatting :) Hi guys, I'm working on it. I'm soliciting feedback on a draft from those who were present at the meeting (if you *were* present at the meeting and didn't receive the draft writeup, please shout!). Once I've established that I haven't grossly misrepresented anyone, I'll send the writeup to python-dev. Mark ___ 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
[Python-Dev] packaging backport
Hello I am starting the backport of Packaging into a standalone version named Distutils2 -- this is very important to speed up the development of packaging itself since it'll give of more feedback from 2.x projects To do this I need to create a script that does a mass renaming of 'packaging' into 'distutils2', then I can start to play with 3to2 and ...3.xto3.x :) . I tried to script rope but the py3k version seem not compatible with our current AST -- and it's a bit overkill for this task I guess. Before I start to write my own refactoring tool, I was wondering if anyone here had some experience in this, and could give me some hints. Thanks Tarek -- Tarek Ziadé | http://ziade.org ___ 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] packaging backport
2to3 or Brett's mnfy are likely to be reasonable starting points. ___ 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] packaging backport
On Tue, 21 Jun 2011 13:42:05 +0200, =?ISO-8859-1?Q?Tarek_Ziad=E9?= wrote: > Before I start to write my own refactoring tool, I was wondering if > anyone here had some experience in this, and could give me some hints. Coul you could just write a 3to2 fixer? I don't know how hard it is to run just a selected set of fixers (so that you could use it to generate python3 code), but it seems to me that renaming modules is something that 3to2 (and 2to3, of course) should be good at. -- R. David Murray http://www.bitdance.com ___ 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] packaging backport
On Tue, Jun 21, 2011 at 2:44 PM, Nick Coghlan wrote: > 2to3 or Brett's mnfy are likely to be reasonable starting points. Will look at mnfy, thanks -- Tarek Ziadé | http://ziade.org ___ 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] packaging backport
On Tue, Jun 21, 2011 at 3:12 PM, R. David Murray wrote: > On Tue, 21 Jun 2011 13:42:05 +0200, =?ISO-8859-1?Q?Tarek_Ziad=E9?= > wrote: >> Before I start to write my own refactoring tool, I was wondering if >> anyone here had some experience in this, and could give me some hints. > > Coul you could just write a 3to2 fixer? I don't know how hard it is to > run just a selected set of fixers (so that you could use it to generate > python3 code), but it seems to me that renaming modules is something > that 3to2 (and 2to3, of course) should be good at. The one thing rope is good at is to find where a given variable name is used, and rename all occurrences recursively. So basically, when you rename an import, it renames all the code that uses it. I don't really know how 2to3/3to2 work but I assumed that it does not do this, but simply give you a hook for every visited node. IOW that looking for dependencies is to be done Cheers Tarek > > -- > R. David Murray http://www.bitdance.com > -- Tarek Ziadé | http://ziade.org ___ 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] packaging backport
On Tue, Jun 21, 2011 at 3:37 PM, Joe Amenta wrote: ... > > Yes, 2to3/3to2 does not do anything fancy like that. The tools are purely > concerned with syntax, whereas renaming imports is semantic. The good news > is that this line: > import packaging as _myPackaging > can be replaced by: > import distutils2 as _myPackaging > and code that uses _myPackaging will work. I've attached a fixer that can > go into your lib3to2/fixes folder. You should also edit fix_imports.py and > add the line: > "packaging" : "distutils2", > to the MAPPING dictionary near the top, then you can run 3to2 like this: > 3to2 -fpackaging -fimports files_to_fix.py > (-w option to write changes to the files modified) > Hope this helps, It does, thanks a lot ! Cheers Tarek -- Tarek Ziadé | http://ziade.org ___ 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] packaging backport
On Tue, Jun 21, 2011 at 9:27 AM, Tarek Ziadé wrote: > On Tue, Jun 21, 2011 at 3:12 PM, R. David Murray > wrote: > > On Tue, 21 Jun 2011 13:42:05 +0200, =?ISO-8859-1?Q?Tarek_Ziad=E9?= < > ziade.ta...@gmail.com> wrote: > >> Before I start to write my own refactoring tool, I was wondering if > >> anyone here had some experience in this, and could give me some hints. > > > > Coul you could just write a 3to2 fixer? I don't know how hard it is to > > run just a selected set of fixers (so that you could use it to generate > > python3 code), but it seems to me that renaming modules is something > > that 3to2 (and 2to3, of course) should be good at. > > The one thing rope is good at is to find where a given variable name > is used, and rename all occurrences recursively. So basically, when > you rename an import, it renames all the code that uses it. > > I don't really know how 2to3/3to2 work but I assumed that it does not > do this, but simply give you a hook for every visited node. IOW that > looking for dependencies is to be done > > Cheers > Tarek > > > > > -- > > R. David Murray http://www.bitdance.com > > > > > > -- > Tarek Ziadé | http://ziade.org > Yes, 2to3/3to2 does not do anything fancy like that. The tools are purely concerned with syntax, whereas renaming imports is semantic. The good news is that this line: import packaging as _myPackaging can be replaced by: import distutils2 as _myPackaging and code that uses _myPackaging will work. I've attached a fixer that can go into your lib3to2/fixes folder. You should also edit fix_imports.py and add the line: "packaging" : "distutils2", to the MAPPING dictionary near the top, then you can run 3to2 like this: 3to2 -fpackaging -fimports files_to_fix.py (-w option to write changes to the files modified) Hope this helps, --Joe Amenta fix_packaging.py Description: Binary data ___ 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] In-Python virtualisation and packaging
Nick Coghlan gmail.com> writes: > How well does the regression test suite cope when run inside such a > virtualised environment? I followed this up, and three tests fail: test_lib2to3, test_packaging and test_sysconfig. These are errors which show up on the default branch too [1][2]; full results are at [3]. I've been keeping the pythonv branch synchronised with default - these results appear to be quite stable/repeatable (old versions of the results are available in the gist at [3]). I did another test: in a pythonv-created environment, I tested pythonv/pysetup3 by trying to install all PyPI packages with a Python 3 trove classifier, where a source distribution can be found. This smoke test shows a total of 398 such packages, 310 of which were installed in the environment without errors. That's 78% - not too bad for this early stage in the game. The details of the failing 88 packages are at [4], and some of these are pysetup3 issues but a fair few are bugs in the packages themselves (e.g. SyntaxErrors in setup.py, or missing readme files that setup.py expects to be there) or missing dependencies like boost.python or similar C-level dependencies. These tests were done with a patched version of Distribute which uses sys.site_prefix is available, falling back to sys.prefix when not (so the Distribute change is backward compatible). Regards, Vinay Sajip [1] http://bugs.python.org/issue12331 [2] http://bugs.python.org/issue9100 [3] https://gist.github.com/1022705 [4] http://gist.github.com/1037662 ___ 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