[TIP] Coming changes to unittest2 plugins

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Mon Sep 27 17:36:10 PDT 2010


On 27 Sep, 07:42 pm, holger at merlinux.eu wrote:
>On Mon, Sep 27, 2010 at 19:19 -0000, exarkun at twistedmatrix.com wrote:
>>>packaging meta data is for consumption of tools.  For example, i want 
>>>to
>>>write one that converts a newstyle setup.cfg into an oldstyle 
>>>setup.py.
>>
>>What transformation do you need to perform on an arbitrary, 
>>application-
>>specified fully qualified Python name?  In general you can't know
>>anything about it, whether it has a ":" in it or not.
>
>Wrong. The ":" carries information.  For example, if we have:
>
>    [global]
>    script-entry-points =
>        somescript = testpath.to:some.function
>
>we can easily generate an oldstyle setup.py from it:
>
>    setup(entry_points={'somescript': 'testpath.to:some.function'}, ...)
>
>without having to load live objects.  The dotted name does
>not allow that and thus carries less information.

Thanks for explaining that.  This is clearly a case where the ":" helps 
(a sort of self-referential case, where the ":" is only needed because 
it used to be needed).

It's not an important case to me (and I don't think it should be 
important to anyone else).  It's still nice to know *why* the ":" might 
be desired though.

Jean-Paul



More information about the testing-in-python mailing list