Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8929 closed defect (fixed)

admin/plugins shows wrong information for plugin distribution

Reported by: anatoly techtonik <techtonik@…> Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: admin/web Version: 0.11.6
Severity: normal Keywords: patch
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Attached screenshot shows that Trac fails to load correct information about AccountManager plugin that is installed outside of environment plugin directory (see DebianBug #562963).

The reason is here: http://trac.edgewall.org/browser/branches/0.11-stable/trac/admin/web_ui.py?rev=8424#L597

If plugin module is installed globally, get_module_path() returns path to shared /site-packages/ instead to plugin .egg directory, so to find the exact distribution - we need to find root package for the module and request Distribution for that package explicitly.

I'll attach patch for in for 0.11-stable

Attachments (2)

wrong_plugin.png (15.2 KB ) - added by anatoly techtonik <techtonik@…> 15 years ago.
wrong information about AccountManager
correct_plugin_info.diff (5.4 KB ) - added by anatoly techtonik <techtonik@…> 15 years ago.
patch for 0.11-stable

Download all attachments as: .zip

Change History (11)

by anatoly techtonik <techtonik@…>, 15 years ago

Attachment: wrong_plugin.png added

wrong information about AccountManager

comment:1 by anatoly techtonik <techtonik@…>, 15 years ago

by anatoly techtonik <techtonik@…>, 15 years ago

Attachment: correct_plugin_info.diff added

patch for 0.11-stable

comment:2 by Remy Blank, 15 years ago

Milestone: 0.11.70.12
Owner: set to Remy Blank

I'll test your patch. However, as I mentioned in comment:7:ticket:8916, this is not a critical issue and will therefore not be included in 0.11.7.

comment:3 by anatoly techtonik <techtonik@…>, 15 years ago

No problem. Too bad we can't get 0.12 into next Debian.

comment:4 by Remy Blank, 15 years ago

Ok, this only happens when plugins are installed "flat", i.e. with the --single-version-externally-managed install option. Checking your patch…

in reply to:  4 comment:5 by anatoly techtonik <techtonik@…>, 15 years ago

Replying to rblank:

Ok, this only happens when plugins are installed "flat", i.e. with the --single-version-externally-managed install option.

Exactly. In Debian they are installed globally in some kind of site-packages/.

comment:6 by Remy Blank, 15 years ago

Resolution: fixed
Status: newclosed

Unfortunately, the trac.plugins extension points are not a reliable way to assign files to plugins, as it is not necessary that all modules containing components be listed there. Trac itself doesn't list all modules either.

However, the SOURCES.txt file contains all source files, and can be used reliably. This was implemented in [9034] and seems to work for all types of installs (zipped egg, unzipped egg, "flat", single-file).

comment:7 by anatoly techtonik <techtonik@…>, 15 years ago

Are you sure that SOURCES.txt for "flat" and single-file imports works reliably? This file is only generated for Python eggs.

Unfortunately I can not test your solution on existing installations where I experience the problem unless it is ported to Trac 0.11, but I'll try to review as far as possible.

comment:8 by Remy Blank, 15 years ago

Resolution: fixed
Status: closedreopened

For some reason, I just got a case where top_level.txt cannot be found, despite its existing in the filesystem:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 495, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 227, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.6/site-packages/trac/about.py", line 66, in process_request
    plugins = get_plugin_info(self.env)
  File "/usr/lib/python2.6/site-packages/trac/loader.py", line 157, in get_plugin_info
    dist = find_distribution(module)
  File "/usr/lib/python2.6/site-packages/trac/loader.py", line 140, in find_distribution
    sources = path_sources[path] = get_sources(path)
  File "/usr/lib/python2.6/site-packages/trac/util/__init__.py", line 473, in get_sources
    toplevels = dist.get_metadata('top_level.txt').splitlines()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1477, in get_metadata
    raise KeyError("No metadata except PKG-INFO is available")
KeyError: No metadata except PKG-INFO is available

To be investigated…

comment:9 by Remy Blank, 15 years ago

Resolution: fixed
Status: reopenedclosed

This was due to some packages in my site-packages having only a single .egg-info file. With [9045], this case doesn't generate an internal server error anymore.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank 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.