Modify

Opened 15 years ago

Closed 12 years ago

#6248 closed defect (fixed)

setup.py bdist_egg not adding templates

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: HtGroupEditorPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

It appears the setup.py isn't adding templates to the .egg file, here is the error I get when loading a page in trac with this plugin installed.

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 444, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 226, in dispatch
    data, content_type)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/chrome.py", line 730, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/chrome.py", line 696, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/chrome.py", line 434, in get_all_templates_dirs
    dirs += provider.get_templates_dirs()
  File "build/bdist.linux-x86_64/egg/htgroupeditor/htgroupeditor.py", line 38, in get_templates_dirs
    return [resource_filename(__name__, 'templates')]
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 841, in resource_filename
    self, resource_name
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1311, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1322, in _extract_resource
    zip_stat = self.zipinfo[zip_path]
KeyError: htgroupeditor/templates

To fix it change the package data in the setup.py to

package_data={'htgroupeditor':['templates/*.html',
                                'htdocs/css/*.css']},

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by Ryan J Ollos

Owner: changed from robert_martin to Ryan J Ollos
Status: newassigned

I can't reproduce, but I'll make the suggested change in case the package name is case-sensitive in some cases.

comment:2 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

(In [13123]) Fixes #6248: Avoid possible issues with case-sensitive package name in package_data specification. The error reported in #6248 has not yet been reproduced.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.