From avanderneut at pinnaclesys.com Sun Mar 5 17:40:31 2006 From: avanderneut at pinnaclesys.com (Anthon van der Neut) Date: Sun, 05 Mar 2006 17:40:31 +0100 Subject: [py-dev] changed 1 minute ago Message-ID: <440B147F.60507@pinnaclesys.com> Looking through the pypy documentation this morning I noticed that Armin Rigo had committed a file 2 minutes ago. As this was sunday morning, I was happy to notice I am not the only one who cannot sleep in. However 10 minutes later this was still 2 minutes ago, and a minor typo correction I committed got marked as modified 1 minute ago and stayed that way. I traced the thing down to the www/pypywww/render/doc.py -> worded_diff_time function. Which would work nice if the pages were not generated staticly, or at least regenerated every night, which they are not. The function seems to be in there since the first revision of the file. Any objections to me changing the call to this function to something more useful on staticly generated pages like 5th March, 2006? Anthon From avanderneut at pinnaclesys.com Sun Mar 5 17:42:15 2006 From: avanderneut at pinnaclesys.com (Anthon van der Neut) Date: Sun, 05 Mar 2006 17:42:15 +0100 Subject: [py-dev] unmae to real name mapping Message-ID: <440B14E7.90900@pinnaclesys.com> The other thing that bothered me today was not being able to find who hpk is. Holger P. Krekel? The doc.py reads the usernames from uconf.system (whatever that might be). A page with login/commit names -> real name mapping would be nice for newbies (like me), automatically generated once a day would be realy nice. I know how to write such a thing, but not how to get that running on codespeak. Anthon From hpk at trillke.net Sun Mar 5 18:33:22 2006 From: hpk at trillke.net (holger krekel) Date: Sun, 5 Mar 2006 18:33:22 +0100 Subject: [py-dev] changed 1 minute ago In-Reply-To: <440B147F.60507@pinnaclesys.com> References: <440B147F.60507@pinnaclesys.com> Message-ID: <20060305173322.GA4255@solar.trillke> Hi Anthon, On Sun, Mar 05, 2006 at 17:40 +0100, Anthon van der Neut wrote: > Looking through the pypy documentation this morning I noticed that Armin > Rigo had committed a file 2 minutes ago. As this was sunday morning, I > was happy to notice I am not the only one who cannot sleep in. > > However 10 minutes later this was still 2 minutes ago, and a minor typo > correction I committed got marked as modified 1 minute ago and stayed > that way. note that this is the development list for the py library and the one for pypy development. That being said ... > I traced the thing down to the www/pypywww/render/doc.py -> > worded_diff_time function. Which would work nice if the pages were not > generated staticly, or at least regenerated every night, which they are > not. The function seems to be in there since the first revision of the file. > > Any objections to me changing the call to this function to something > more useful on staticly generated pages like 5th March, 2006? hum, this is a possibility. The other one is to indeed generate the docs daily so that this misleading information goes away. But push ahead in changing the function for the moment. cheers & thanks, holger From hpk at trillke.net Sat Mar 11 17:16:26 2006 From: hpk at trillke.net (holger krekel) Date: Sat, 11 Mar 2006 08:16:26 -0800 Subject: [py-dev] Re: Bug in execnet documentation example In-Reply-To: <8393fff0603100741o7ef69d19y5fba07dad21c4c05@mail.gmail.com> References: <8393fff0603100741o7ef69d19y5fba07dad21c4c05@mail.gmail.com> Message-ID: <20060311161626.GB746@hpk.local> Hi Martin, [Martin Blais Fri, Mar 10, 2006 at 10:41 -0500] > Hi Holder also a nice "art" name :) > The execnet documentation example at the end fails, the one in section 2.2.1 > (Note: I already fixed the missing parenthesis and changed f to fn in the svn). > > The problem is that "for fn in channel.receive()" will iterate over > the characters of every filename string sent from the client. > Replacing by "while 1: fn = channel.receive()" will work properly > instead. > > I was tempted in checking-in the change myself, but since this is your > baby I thought I'd send email instead and let you do it. hey, i am fine with checking it in ... so feel free to do it :) cheers & thanks, holger From arigo at tunes.org Sun Mar 12 14:58:08 2006 From: arigo at tunes.org (Armin Rigo) Date: Sun, 12 Mar 2006 14:58:08 +0100 Subject: [py-dev] Re: [pypy-dev] New code-templating system for py.lib In-Reply-To: References: <20060301220040.GE28930@solar.trillke> Message-ID: <20060312135808.GB16110@code0.codespeak.net> Hi Patrick, On Wed, Mar 01, 2006 at 04:35:44PM -0600, Patrick Maupin wrote: > I would be interested in seeing what templating ideas you are > currently using in pypy. They certainly are not being used > consistently. Indeed, consistency is definitely what we don't have. It would be very interesting, though, if you could survey the various ways we have to build *Python* functions from strings -- your current docs show examples producing C, LLVM or Makefile code. Producing Python comes with its own problems. Basically, grep for "exec" in the PyPy sources, for example in: http://codespeak.net/svn/pypy/dist/pypy/objspace/std/multimethod.py http://codespeak.net/svn/pypy/dist/pypy/rpython/rtuple.py as well as (I almost don't dare pointing you there :-) http://codespeak.net/svn/pypy/dist/pypy/interpreter/gateway.py A bientot, Armin From brian at dorseys.org Sat Mar 25 19:03:15 2006 From: brian at dorseys.org (Brian Dorsey) Date: Sat, 25 Mar 2006 10:03:15 -0800 Subject: [py-dev] Re: [py-svn] r24998 - py/dist/py/test In-Reply-To: <20060325153459.B0BE11005A@code0.codespeak.net> References: <20060325153459.B0BE11005A@code0.codespeak.net> Message-ID: <66e877b70603251003w5c2c366cu@mail.gmail.com> On 25/03/06, cfbolz at codespeak.net wrote: > Author: cfbolz > Date: Sat Mar 25 16:34:53 2006 > New Revision: 24998 > > Modified: > py/dist/py/test/cmdline.py > Log: > make driving py.test programmatically easier, by allowing to not use sys.argv. > User feature request. I like this idea, but I wonder if it a bit less magic to expect a list of args rather than splitting a string in main()? That way it would be easy to modify an existing copy of sys.argv or use the args from another option parsing library (like optparse) as well. Take care, -Brian > Modified: py/dist/py/test/cmdline.py > ============================================================================== > --- py/dist/py/test/cmdline.py (original) > +++ py/dist/py/test/cmdline.py Sat Mar 25 16:34:53 2006 > @@ -4,9 +4,13 @@ > # main entry point > # > > -def main(): > +def main(args=None): > warn_about_missing_assertion() > - config, args = py.test.Config.parse(py.std.sys.argv[1:]) > + if args is None: > + args = py.std.sys.argv[1:] > + elif isinstance(args, basestring): > + args = args.split(" ") > + config, args = py.test.Config.parse(args) > sessionclass = config.getsessionclass() > session = sessionclass(config) > try: From jan at balster.info Sat Mar 25 20:13:33 2006 From: jan at balster.info (Jan Balster) Date: Sat, 25 Mar 2006 20:13:33 +0100 Subject: [py-dev] Re: [py-svn] r24998 - py/dist/py/test In-Reply-To: <66e877b70603251003w5c2c366cu@mail.gmail.com> References: <20060325153459.B0BE11005A@code0.codespeak.net> <66e877b70603251003w5c2c366cu@mail.gmail.com> Message-ID: <4425965D.5060401@balster.info> Brian Dorsey wrote: > On 25/03/06, cfbolz at codespeak.net wrote: >> Author: cfbolz >> Date: Sat Mar 25 16:34:53 2006 >> New Revision: 24998 >> >> Modified: >> py/dist/py/test/cmdline.py >> Log: >> make driving py.test programmatically easier, by allowing to not use sys.argv. >> User feature request. > > I like this idea, but I wonder if it a bit less magic to expect a list > of args rather than splitting a string in main()? That way it would be > easy to modify an existing copy of sys.argv or use the args from > another option parsing library (like optparse) as well. A list would be better, how should main() know that 'filename with spaces.py' is one name? The shell would interpret 'filename\ with\ spaces.py' or '"filename with spaces.py"' as one name with spaces (but we do not want to reimplement this). We should let the shell/user(who uses main directly) do the escaping stuff and let main work with a list. cheers, jan > Take care, > -Brian > > >> Modified: py/dist/py/test/cmdline.py >> ============================================================================== >> --- py/dist/py/test/cmdline.py (original) >> +++ py/dist/py/test/cmdline.py Sat Mar 25 16:34:53 2006 >> @@ -4,9 +4,13 @@ >> # main entry point >> # >> >> -def main(): >> +def main(args=None): >> warn_about_missing_assertion() >> - config, args = py.test.Config.parse(py.std.sys.argv[1:]) >> + if args is None: >> + args = py.std.sys.argv[1:] >> + elif isinstance(args, basestring): >> + args = args.split(" ") >> + config, args = py.test.Config.parse(args) >> sessionclass = config.getsessionclass() >> session = sessionclass(config) >> try: > _______________________________________________ > py-dev mailing list > py-dev at codespeak.net > http://codespeak.net/mailman/listinfo/py-dev > From hpk at trillke.net Sat Mar 25 23:24:30 2006 From: hpk at trillke.net (holger krekel) Date: Sat, 25 Mar 2006 23:24:30 +0100 Subject: [py-dev] Re: [py-svn] r24998 - py/dist/py/test In-Reply-To: <4425965D.5060401@balster.info> References: <20060325153459.B0BE11005A@code0.codespeak.net> <66e877b70603251003w5c2c366cu@mail.gmail.com> <4425965D.5060401@balster.info> Message-ID: <20060325222430.GY25586@solar.trillke> On Sat, Mar 25, 2006 at 20:13 +0100, Jan Balster wrote: > Brian Dorsey wrote: > > On 25/03/06, cfbolz at codespeak.net wrote: > >> Author: cfbolz > >> Date: Sat Mar 25 16:34:53 2006 > >> New Revision: 24998 > >> > >> Modified: > >> py/dist/py/test/cmdline.py > >> Log: > >> make driving py.test programmatically easier, by allowing to not use sys.argv. > >> User feature request. > > > > I like this idea, but I wonder if it a bit less magic to expect a list > > of args rather than splitting a string in main()? That way it would be > > easy to modify an existing copy of sys.argv or use the args from > > another option parsing library (like optparse) as well. > > > A list would be better, how should main() know that 'filename with spaces.py' is > one name? The shell would interpret 'filename\ with\ spaces.py' or '"filename > with spaces.py"' as one name with spaces (but we do not want to reimplement > this). We should let the shell/user(who uses main directly) do the escaping > stuff and let main work with a list. We could probably decide on the input type we get, i guess. I don't know if optparse can do the splitting into arguments good enough, though. OTOH, for programmatically invoking the py.test cmdline it is not so bad to push the decision to the caller. holger From cfbolz at gmx.de Sun Mar 26 14:38:52 2006 From: cfbolz at gmx.de (Carl Friedrich Bolz) Date: Sun, 26 Mar 2006 14:38:52 +0200 Subject: [py-dev] Re: [py-svn] r24998 - py/dist/py/test In-Reply-To: <66e877b70603251003w5c2c366cu@mail.gmail.com> References: <20060325153459.B0BE11005A@code0.codespeak.net> <66e877b70603251003w5c2c366cu@mail.gmail.com> Message-ID: <44268B5C.2020203@gmx.de> Hi Brian! Brian Dorsey wrote: > On 25/03/06, cfbolz at codespeak.net wrote: > >>Author: cfbolz >>Date: Sat Mar 25 16:34:53 2006 >>New Revision: 24998 >> >>Modified: >> py/dist/py/test/cmdline.py >>Log: >>make driving py.test programmatically easier, by allowing to not use sys.argv. >>User feature request. > > > I like this idea, but I wonder if it a bit less magic to expect a list > of args rather than splitting a string in main()? That way it would be > easy to modify an existing copy of sys.argv or use the args from > another option parsing library (like optparse) as well. > Huh? But a list or args works too, no? def main(args=None): warn_about_missing_assertion() if args is None: args = py.std.sys.argv[1:] elif isinstance(args, basestring): args = args.split(" ") config, args = py.test.Config.parse(args) ... If args is a list it is passed unchanched to parse. I agree that splitting a string is maybe too magical. Cheers, Carl Friedrich From brian at dorseys.org Sun Mar 26 20:42:13 2006 From: brian at dorseys.org (Brian Dorsey) Date: Sun, 26 Mar 2006 10:42:13 -0800 Subject: [py-dev] Re: [py-svn] r24998 - py/dist/py/test In-Reply-To: <44268B5C.2020203@gmx.de> References: <20060325153459.B0BE11005A@code0.codespeak.net> <66e877b70603251003w5c2c366cu@mail.gmail.com> <44268B5C.2020203@gmx.de> Message-ID: <66e877b70603261042y4c717b68w@mail.gmail.com> On 26/03/06, Carl Friedrich Bolz wrote: > Huh? But a list or args works too, no? > > def main(args=None): > warn_about_missing_assertion() > if args is None: > args = py.std.sys.argv[1:] > elif isinstance(args, basestring): > args = args.split(" ") > config, args = py.test.Config.parse(args) > ... > > If args is a list it is passed unchanched to parse. I agree that > splitting a string is maybe too magical. Thank you Carl. While reading it, I completely missed the fact that if args is a list, it passes through the if/elif unchanged. Apologies for missing that! Back to lurking mode for me... Take care, -Brian From ondrej at certik.cz Mon Mar 27 20:18:21 2006 From: ondrej at certik.cz (Ondrej Certik) Date: Mon, 27 Mar 2006 20:18:21 +0200 Subject: [py-dev] bug in py.test Message-ID: <20060327181820.GA6363@sila> Hello, if I execute: mkdir new touch new/__init__.py py.test ~/pytest/py-dist/py/documentation/example/pytest/failure_demo.py I don't get a nice demo, but this: .... return py.std.new.code( kwargs['co_argcount'], kwargs['co_nlocals'], kwargs['co_stacksize'], kwargs['co_flags'], kwargs['co_code'], kwargs['co_consts'], kwargs['co_names'], kwargs['co_varnames'], kwargs['co_filename'], kwargs['co_name'], kwargs['co_firstlineno'], kwargs['co_lnotab'], kwargs['co_freevars'], kwargs['co_cellvars'], E ) > AttributeError: 'module' object has no attribute 'code' [/home/ondra/pytest/py-dist/py/code/code.py:38] ================== tests finished: 21 failed in 1.42 seconds =================== The new module in the current directory is probably colliding with something in py.test. If I rename new to new2, then everything is fine and I got this result: ... def foo(): E assert 1 == 0 > assert 1 == 0 [/tmp/test/abc-123:2] ================== tests finished: 21 failed in 1.46 seconds =================== One of my modules is called "new", so I have to rename it because if this. Is it a bug? Ondrej From cfbolz at gmx.de Mon Mar 27 20:28:21 2006 From: cfbolz at gmx.de (Carl Friedrich Bolz) Date: Mon, 27 Mar 2006 20:28:21 +0200 Subject: [py-dev] bug in py.test In-Reply-To: <20060327181820.GA6363@sila> References: <20060327181820.GA6363@sila> Message-ID: <44282EC5.7010105@gmx.de> Hi! Ondrej Certik wrote: [snip] > > The new module in the current directory is probably colliding with something in > py.test. If I rename new to new2, then everything is fine and I got this > result: > > ... > > def foo(): > E assert 1 == 0 > >> assert 1 == 0 > > > [/tmp/test/abc-123:2] > ================== tests finished: 21 failed in 1.46 seconds =================== > > One of my modules is called "new", so I have to rename it because if this. > > Is it a bug? Not really, since the "new" module is really part of the standard library (which makes e.g. renaming it a bit hard :-) http://docs.python.org/lib/module-new.html Any library that uses this standard library module would break if you named your module new. Thanks for being interested in py.test! Cheers, Carl Friedrich From pinard at iro.umontreal.ca Tue Mar 28 17:41:51 2006 From: pinard at iro.umontreal.ca (=?iso-8859-1?Q?Fran=E7ois?= Pinard) Date: Tue, 28 Mar 2006 10:41:51 -0500 Subject: [py-dev] Re: [py-svn] r24998 - py/dist/py/test In-Reply-To: <66e877b70603261042y4c717b68w@mail.gmail.com> References: <20060325153459.B0BE11005A@code0.codespeak.net> <66e877b70603251003w5c2c366cu@mail.gmail.com> <44268B5C.2020203@gmx.de> <66e877b70603261042y4c717b68w@mail.gmail.com> Message-ID: <20060328154151.GA24520@alcyon.progiciels-bpi.ca> [Brian Dorsey] >On 26/03/06, Carl Friedrich Bolz wrote: >> Huh? But a list or args works too, no? >> def main(args=None): >> warn_about_missing_assertion() >> if args is None: >> args = py.std.sys.argv[1:] >> elif isinstance(args, basestring): >> args = args.split(" ") >> config, args = py.test.Config.parse(args) >> ... >> If args is a list it is passed unchanched to parse. I agree that >> splitting a string is maybe too magical. >[...] if args is a list, it passes through the if/elif unchanged. >Apologies for missing that! I do not know if the following comments are relevant to this particular patch, or for pylib more generally. For one of my clients (an all-Python shop), and after good thought, we chose a useful convention to be followed by main programs. Programs look like: [...] def main(*arguments): [...] [...] if __name__ == '__main__': main(*sys.argv[1:]) So, a program may always execute another one by doing: import ANOTHER ANOTHER.main(ARG1, ARG2, ...) ARGs are strings in that context, there is no kind of concern about matters of shell splitting or escaping. What is really nice for this client is the site-wide uniformity/ubiquity of this convention. It also helps for interactive usage or debugging, even if compared to the shell, a few extra commas and string delimiters are required. Maybe (or maybe not) pylib could give itself a similar approach, quite systematically whenever or wherever it makes sense. P.S. - I simplified the above convention a bit, as we often have, instead of "def main(*arguments)", a construct similar to this one: class Main: DEFAULT-OPTION-VALUES-AS-CLASS-VARIABLES [...] def main(self, *arguments): [...] [...] run = Main() main = run.main -- Fran?ois Pinard http://pinard.progiciels-bpi.ca