#11606 closed defect (fixed)
Cannot install ThemeEnginePlugin 2.2.2 cause of "running compile_catalog_js"
| Reported by: | Jun Omae | Owned by: | Olemis Lang | 
|---|---|---|---|
| Priority: | normal | Component: | ThemeEnginePlugin | 
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.12 | 
Description
bdist_egg command raises the following error. Also easy_install raises the same. The issue is originally from http://14code.com/blog/20140303_664.
$ ~/venv/trac/0.12.5/bin/python setup.py bdist_egg running bdist_egg running egg_info writing requirements to TracThemeEngine.egg-info/requires.txt writing TracThemeEngine.egg-info/PKG-INFO writing top-level names to TracThemeEngine.egg-info/top_level.txt writing dependency_links to TracThemeEngine.egg-info/dependency_links.txt writing entry points to TracThemeEngine.egg-info/entry_points.txt reading manifest file 'TracThemeEngine.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.swp' found anywhere in distribution warning: no previously-included files matching '*.swo' found anywhere in distribution warning: no previously-included files matching '*.mo' found anywhere in distribution writing manifest file 'TracThemeEngine.egg-info/SOURCES.txt' installing library code to build/bdist.linux-i686/egg running install_lib running compile_catalog_js error: you must specify either the input file or the base directory
The plugin seems that it should use get_l10n_cmdclass instead of get_l10n_js_cmdclass, as it doesn't use message files for javascript.
- 
        
setup.py
14 14 15 15 extra = {} 16 16 try: 17 from trac.util.dist import get_l10n_ js_cmdclass18 cmdclass = get_l10n_ js_cmdclass()17 from trac.util.dist import get_l10n_cmdclass 18 cmdclass = get_l10n_cmdclass() 19 19 if cmdclass: 20 20 extra['cmdclass'] = cmdclass 21 21 extractors = [  
Attachments (0)
Change History (11)
comment:1 Changed 12 years ago by
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
comment:2 Changed 12 years ago by
Just wondering, what is the reason for including *.po and *pot in the package data? Trac does not seem to do the same: trac:browser:/tags/trac-1.0.1/setup.py?marks=83-92#L56
comment:4 Changed 12 years ago by
Let me rephrase the question. Why do you think it is necessary to include *.po and *.pot files as package data? I think only the compiled catalogs need to be included, and the setup.py for Trac and Bloodhound would seem to support this.
comment:5 Changed 12 years ago by
It seems I see what you mean now , including .mo files only in bdist packages and .po , .pot only in source tarballs . Is this the case ?
comment:7 Changed 12 years ago by
We could remove *.po and *.pot files from the package_data. But the removing leads KeyError: 'themeengine/locale' from resource_filename(__name__, 'locale') if Babel isn't installed.
We should handle a KeyError or check the existence of locale directory using resource_isdir().
- 
        
setup.py
41 41 'htdocs/farbtastic/*.png', 42 42 'htdocs/farbtastic/*.js', 43 43 'htdocs/farbtastic/*.css', 44 'locale/*.pot',45 'locale/*/LC_MESSAGES/*.po',46 44 'locale/*/LC_MESSAGES/*.mo'] }, 47 45 author = 'Noah Kantrowitz', 48 46 author_email = 'noah@coderanger.net',  - 
        
themeengine/api.py
107 107 108 108 def __init__(self): 109 109 import pkg_resources 110 locale_dir = pkg_resources.resource_filename(__name__, 'locale') 111 add_domain(self.env.path, locale_dir) 110 try: 111 locale_dir = pkg_resources.resource_filename(__name__, 'locale') 112 except KeyError: 113 pass 114 else: 115 add_domain(self.env.path, locale_dir) 112 116 113 117 if lazy is None: 114 118 # Trac < 1.0 : this can safely go in here because the data can  
comment:8 Changed 12 years ago by
I honestly do not like over-complicating the code for this. Initialization code must take for granted the existence of locale folder and setup.py code must ensure that this will be the case .
comment:10 Changed 12 years ago by
@jun66j5 please take a look . Other translations are welcome as well .
comment:11 Changed 12 years ago by
Looks good to me.
$ rm -f themeengine/locale/*/LC_*/*.mo $ rm -rf build dist $ ~/venv/trac/0.12.5-nobabel/bin/python setup.py bdist_egg ... $ unzip -l dist/TracThemeEngine-2.2.2dev-py2.4.egg | grep locale 187 03-24-14 00:26 themeengine/locale/README.txt



In 13718: