#3229 closed enhancement (fixed)
Support for setuptools extras
Reported by: | 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)
Change History (14)
by , 19 years ago
Attachment: | extras.patch added |
---|
comment:1 by , 19 years ago
Milestone: | 0.10 → 0.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:3 by , 19 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 , 19 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 , 19 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 , 19 years ago
Cc: | 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 , 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.
follow-up: 9 comment:8 by , 18 years ago
I just posted a new version, are there any objections to this still?
comment:9 by , 18 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
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 , 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 , 18 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This has been fixed with r4832 which uses new pkg_resources
APIs which take extras into account when loading Trac entry points.
Patch for extras support