Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 6 years ago

#3229 closed enhancement (fixed)

Support for setuptools extras

Reported by: coderanger@… Owned by: Matthew Good
Priority: normal Milestone: 0.11
Component: general Version: devel
Severity: normal Keywords:
Cc: coderanger@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Attached is a patch for supporting setuptools extras, both for load ordering, and for optional entry points. When using the optional entry points, you need setuptools 0.6b1 or higher, due to a bug in the entry point parser in earlier versions. If you are not using any plugins that require this (which can mark themselves as depending on the needed versions of setuptools), then it should work with any of 0.6alpha versions. The patch is against r3356 of trunk.

Attachments (3)

extras.patch (1.9 KB ) - added by coderanger@… 18 years ago.
Patch for extras support
extras.2.patch (1.9 KB ) - added by coderanger@… 18 years ago.
Files in the correct order this time
extras.3.patch (1.8 KB ) - added by Noah Kantrowitz <coderanger@…> 18 years ago.
Updated version against r4667

Download all attachments as: .zip

Change History (14)

by coderanger@…, 18 years ago

Attachment: extras.patch added

Patch for extras support

by coderanger@…, 18 years ago

Attachment: extras.2.patch added

Files in the correct order this time

comment:1 by Christian Boos, 18 years ago

Milestone: 0.100.11

Probably a better fit for this ticket would be 0.11 (or 0.10.1?), along with the source:sandbox/setuptools branch integration.

comment:2 by coderanger, 18 years ago

This isn't much more dependent on setuptools than the current system.

comment:3 by Christopher Lenz, 18 years ago

Can you elaborate on why this is actually required? We're using extras in the SpamFilter plugin, and that has been working okay AFAICT.

comment:4 by coderanger, 18 years ago

Currently extras will not be considered when doing the dependency ordering. Using a simpler solution has the problem that if an extra isn't loadable, it will cause the entire plugin to not load.

comment:5 by Christopher Lenz, 18 years ago

Hmm, the SpamFilter plugin works when e.g. dnsresolver isn't installed, only the tracspamfilter.filters.dnsblacklist module isn't loaded. I'm still not sure I really understand the problem :-P

comment:6 by coderanger, 18 years ago

Cc: coderanger@… added

If you had another plugin with an optional depenency on something like WebAdmin, if you list "admin" as an depending on TracWebAdmin, the current code will not try to make sure the TracWebAdmin distribution is loaded before that plugin. If you list the dep in install_requires, the loader will try to do the right thing when it can. For something like dnspython, which is installed centrally, this isn't a problem, but if WebAdmin is installed as a local egg, it needs to be loaded before anything can import from it. This patch examines all extras, and trys to make sure they are loaded in order.

comment:7 by coderanger, 18 years ago

Its worth noting that using extras at all requires setuptools 0.6b2 (or maybe 0.6b1, I forget), and given the slugish pace that most distros have with respect to getting new setuptools packages available, targetting this for 0.11 is probably about right.

by Noah Kantrowitz <coderanger@…>, 18 years ago

Attachment: extras.3.patch added

Updated version against r4667

comment:8 by Noah Kantrowitz <coderanger@…>, 18 years ago

I just posted a new version, are there any objections to this still?

in reply to:  8 comment:9 by Matthew Good, 18 years ago

Owner: changed from Jonas Borgström to Matthew Good
Status: newassigned

Replying to Noah Kantrowitz <coderanger@yahoo.com>:

I just posted a new version, are there any objections to this still?

No, we should definitely support this.

comment:10 by Christian Boos, 18 years ago

Noah, you should really read TracDev/CodingStyle once, in particular about our obsessive adherence to the 80-characters wide lines rule ;)

comment:11 by Matthew Good, 18 years ago

Resolution: fixed
Status: assignedclosed

This has been fixed with r4832 which uses new pkg_resources APIs which take extras into account when loading Trac entry points.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Matthew Good to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.