Bug in parsing entry points with extras spec?

Hi all, I'm trying to specify an extra for an entry point, as follows: setup( ... extras_require = { 'DNS': ['dnspython>=1.3.5'] }, entry_points = { 'trac.plugins': [ 'spamfilter = tracspamfilter.api', 'spamfilter.adapters = tracspamfilter.adapters', 'spamfilter.filters.akismet = tracspamfilter.filters.akismet', 'spamfilter.filters.ip_blacklist = tracspamfilter.filters.ip_blacklist [DNS]' ] }, ... ) egg_info then fails with the message: ValueError: ('Invalid module name', 'tracspamfilter.filters.ip_blacklist ') Obviously the space between the module and the extras spec is messing up the parsing somehow, so I remove the space. Now, this works *only the first time* (i.e. before the entry_points.txt file) gets written out. Apparently setuptools also puts a space between the module name and the extras :-P Using setuptools 0.6a10... couldn't find anything related in the check-in messages. Am I missing something obvious here? Or isn't anyone actually using that particular feature yet? Anyway, replacing "value.lstrip()" with "value.strip()" in EntryPoint.parse() appears to fix this. Cheers, Chris -- Christopher Lenz cmlenz at gmx.de http://www.cmlenz.net/

Le 27/4/2006, "Christopher Lenz" <cmlenz@gmx.de> a écrit:
Hi all,
I'm trying to specify an extra for an entry point, as follows:
setup( ... extras_require = { 'DNS': ['dnspython>=1.3.5'] }, entry_points = { 'trac.plugins': [ 'spamfilter = tracspamfilter.api', 'spamfilter.adapters = tracspamfilter.adapters', 'spamfilter.filters.akismet = tracspamfilter.filters.akismet', 'spamfilter.filters.ip_blacklist = tracspamfilter.filters.ip_blacklist [DNS]' ] }, ... )
And if you try something like: entry_points=""" # ... spamfilter.filters.ip_blacklist = tracspamfilter.filters.ip_blacklist [DNS] """ ?
egg_info then fails with the message:
ValueError: ('Invalid module name', 'tracspamfilter.filters.ip_blacklist ')
Obviously the space between the module and the extras spec is messing up the parsing somehow, so I remove the space. Now, this works *only the first time* (i.e. before the entry_points.txt file) gets written out. Apparently setuptools also puts a space between the module name and the extras :-P
Using setuptools 0.6a10... couldn't find anything related in the check-in messages.
Am I missing something obvious here? Or isn't anyone actually using that particular feature yet?
I've used that feature, but using the string based syntax instead of the dictionary. And it worked.
Anyway, replacing "value.lstrip()" with "value.strip()" in EntryPoint.parse() appears to fix this.

Am 27.04.2006 um 14:55 schrieb Philippe Normand:
And if you try something like:
entry_points=""" # ... spamfilter.filters.ip_blacklist = tracspamfilter.filters.ip_blacklist [DNS]
"""
?
That works, but again only without a space between the module name and the extras. Which should still be fixed, I suppose. Thanks! Chris -- Christopher Lenz cmlenz at gmx.de http://www.cmlenz.net/

At 02:50 PM 4/27/2006 +0200, Christopher Lenz wrote:
Obviously the space between the module and the extras spec is messing up the parsing somehow, so I remove the space. Now, this works *only the first time* (i.e. before the entry_points.txt file) gets written out. Apparently setuptools also puts a space between the module name and the extras :-P
Using setuptools 0.6a10... couldn't find anything related in the check-in messages.
Am I missing something obvious here? Or isn't anyone actually using that particular feature yet?
The parse tests didn't include the case of "modulename [extras]", only "modulename:attrs [extras]". I've fixed the tests and the code now in both the 0.7 trunk and the 0.6 stable branch. Thanks for the bug report!
participants (3)
-
Christopher Lenz
-
Philippe Normand
-
Phillip J. Eby