Modify

Opened 6 years ago

Closed 6 years ago

#2557 closed defect (fixed)

Can't Find Templates When Packaged As .EGG

Reported by: pacopablo Owned by: athomas
Priority: normal Component: TracDeveloperPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Checked out the latest code and ran:

python setup.py bdist_egg

Then move the .egg to the plugins directory of my test environment. Upon restarting the server, was encountered with

Traceback (most recent call last):
  File "/var/trac-0.11dev/lib/python2.4/site-packages/Trac-0.11dev_r6490-py2.4.egg/trac/web/main.py", line 406, in _dispatch_request
    dispatcher.dispatch(req)
  File "/var/trac-0.11dev/lib/python2.4/site-packages/Trac-0.11dev_r6490-py2.4.egg/trac/web/main.py", line 217, in dispatch
    data, content_type)
  File "/var/trac-0.11dev/lib/python2.4/site-packages/Trac-0.11dev_r6490-py2.4.egg/trac/web/chrome.py", line 667, in render_template
    template = self.load_template(filename, method=method)
  File "/var/trac-0.11dev/lib/python2.4/site-packages/Trac-0.11dev_r6490-py2.4.egg/trac/web/chrome.py", line 643, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/var/trac-0.11dev/lib/python2.4/site-packages/Trac-0.11dev_r6490-py2.4.egg/trac/web/chrome.py", line 397, in get_all_templates_dirs
    dirs += provider.get_templates_dirs()
  File "build/bdist.linux-i686/egg/tracdeveloper/main.py", line 37, in get_templates_dirs
  File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 799, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 1229, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/usr/lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py", line 1240, in _extract_resource
    zip_stat = self.zipinfo[zip_path]
KeyError: 'tracdeveloper/templates'

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by pacopablo

Did a little digging and found out that the issue is due to either a misconfiguration of setup.py or an incorrect location of the templates.

Below is the simple patch to fix setup.py

  • setup.py

     
    2222        'tracdeveloper' : [ 
    2323            'htdocs/css/*.css', 
    2424            'htdocs/js/*.js', 
    25             'templates/*.html', 
     25            'templates/developer/*.html', 
    2626        ] 
    2727    } 
    2828) 

comment:2 Changed 6 years ago by athomas

  • Resolution set to fixed
  • Status changed from new to closed

(In [3234]) Fix template distribution. Closes #2557. Thanks paco.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from athomas. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.