#12708 closed defect (fixed)
Traceback when single file plugin raises VersionConflict
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2.1 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
|
||
API Changes: | |||
Internal Changes: |
Description
A packaged plugin that fails a version requirement such as pkg_resources.require('Trac >= 1.4')
results in a log message at ERROR
level:
13:40:08 Trac[loader] ERROR: Skipping "tractags = tractags": (version conflict "VersionConflict: (Trac 1.3.2.dev0 (/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git), Requirement.parse('Trac>=1.4'))")
A single file plugin with the same statement results in a traceback:
13:31:06 Trac[loader] ERROR: Failed to load plugin from /Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.3/plugins/upcomingmilestoneschartmacro.py: Traceback (most recent call last): File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/loader.py", line 92, in _load_py_files module = imp.load_source(plugin_name, plugin_file) File "/Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.3/plugins/upcomingmilestoneschartmacro.py", line 22, in <module> pkg_resources.require('Trac >= 1.4') File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require needed = self.resolve(parse_requirements(requirements)) File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve raise VersionConflict(dist, req).with_context(dependent_req) VersionConflict: (Trac 1.3.2.dev0 (/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git), Requirement.parse('Trac>=1.4'))
The proposed changes result in:
13:56:26 Trac[loader] ERROR: Skipping "upcomingmilestoneschartmacro": (version conflict "VersionConflict: (Trac 1.3.2.dev0 (/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git), Requirement.parse('Trac>=1.4'))")
Maybe there are other exceptions that are handled for eggs which should be handled for single file plugins?: tags/trac-1.2/trac/loader.py@:48#L36.
Attachments (0)
Change History (6)
comment:1 by , 8 years ago
Release Notes: | modified (diff) |
---|
comment:2 by , 8 years ago
Milestone: | next-stable-1.2.x → 1.2.1 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:3 by , 8 years ago
Proposed changes in log:rjollos.git:t12708_versionconflict_singlefile_plugin.2.
Simplified error messages to eliminate excess parenthesis and error messages that are redundant with the exception name, like version conflict "VersionConflict: ...
.
Example from before changes:
18:06:02 Trac[loader] ERROR: Skipping "RaiseErrorPlugin": (version conflict "VersionConflict: (Trac 1.2.1.dev0 (/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git), Requirement.parse('Trac>=1.4'))")
comment:4 by , 8 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:5 by , 8 years ago
Sorry for delay response. I don't consider we should use Loading plugin … for it about the following change in [15616].
- env.log.debug("Adding plugin %s from %s", dist, dist.location) + env.log.debug('Loading plugin "%s" from "%s"', + dist, dist.location)
working_set.add()
just adds plugin to load and the plugin isn't loaded yet.
Lightly tested changes: log:rjollos.git:t12708_versionconflict_singlefile_plugin. I'll do more investigation before committing, and perhaps also trap
ImportError
s.