← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/disable-pot-generation into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/disable-pot-generation into lp:launchpad.

Commit message:
Disable launchpad.pot generation for now; it hasn't worked for some time, and obstructs converting the build system to pip.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/disable-pot-generation/+merge/330157

Without modifications:

  $ make potemplates
  bin/i18nextract.py
  make: bin/i18nextract.py: Command not found
  Makefile:421: recipe for target 'launchpad.pot' failed
  make: *** [launchpad.pot] Error 127

With the obvious fix:

  $ make potemplates
  bin/i18nextract
  domain:                 'launchpad'
  configuration:          /home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/parts/i18n/configure.zcml
  exclude dirs:           []
  include default domain: True
  python only:            False
  verify domain:          False
  header template:        None
  
  package: 'lp'
  base:    '/home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/'
  path:    '/home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/lp'
  
  There was an error processing /home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/lp/registry/templates/person-rdf-contents.pt
  Traceback (most recent call last):
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/extract.py", line 525, in tal_strings
      p.parseFile(filename)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/htmltalparser.py", line 122, in parseFile
      self.parseString(data)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/htmltalparser.py", line 128, in parseString
      self.feed(data)
    File "/usr/lib/python2.7/HTMLParser.py", line 117, in feed
      self.goahead(0)
    File "/usr/lib/python2.7/HTMLParser.py", line 161, in goahead
      k = self.parse_starttag(i)
    File "/usr/lib/python2.7/HTMLParser.py", line 327, in parse_starttag
      self.handle_starttag(tag, attrs)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/htmltalparser.py", line 156, in handle_starttag
      self.getpos())
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talgenerator.py", line 489, in emitStartElement
      raise TALError("bad TAL attribute: " + `key`, position)
  TALError: bad TAL attribute: 'xmlns:rdf', at line 1, column 1, in file /home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/lp/registry/templates/person-rdf-contents.pt
  Traceback (most recent call last):
    File "bin/i18nextract", line 34, in <module>
      '-p', 'lp'
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/z3c.recipe.i18n-0.8.1-py2.7.egg/z3c/recipe/i18n/i18nextract.py", line 257, in main
      maker.write()
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/z3c.recipe.i18n-0.8.1-py2.7.egg/z3c/recipe/i18n/i18nextract.py", line 108, in write
      entry.write(file)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/extract.py", line 125, in write
      file.write('msgid %s\n' % normalize(self.msgid))
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/pygettext.py", line 235, in normalize
      s = '"' + escape(s) + '"'
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/pygettext.py", line 221, in escape
      s[i] = escapes[ord(s[i])]
  IndexError: list index out of range
  Makefile:421: recipe for target 'launchpad.pot' failed
  make: *** [launchpad.pot] Error 1

I didn't see an obvious fix for this at first glance, so let's remove this from the build system for the time being, since z3c.recipe.i18n requires buildout and that was going to require a moderate amount of reworking anyway in order to convert to pip.  We can always add something similar back later if necessary.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/disable-pot-generation into lp:launchpad.
=== modified file 'Makefile'
--- Makefile	2017-05-11 14:15:36 +0000
+++ Makefile	2017-09-04 12:38:46 +0000
@@ -50,7 +50,6 @@
     $(PY) bin/apiindex bin/bzr bin/combine-css bin/fl-build-report \
     bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \
     bin/fl-record bin/fl-run-bench bin/fl-run-test bin/googletestservice \
-    bin/i18ncompile bin/i18nextract bin/i18nmergeall bin/i18nstats \
     bin/harness bin/iharness bin/ipy bin/jsbuild bin/lpjsmin\
     bin/killservice bin/kill-test-services bin/retest \
     bin/run bin/run-testapp bin/sprite-util bin/start_librarian \
@@ -417,8 +416,12 @@
 potemplates: launchpad.pot
 
 # Generate launchpad.pot by extracting message ids from the source
+# XXX cjwatson 2017-09-04: This was previously done using i18nextract from
+# z3c.recipe.i18n, but has been broken for some time.  The place to start in
+# putting this together again is probably zope.app.locales.
 launchpad.pot:
-	bin/i18nextract.py
+	echo "POT generation not currently supported; help us fix this!" >&2
+	exit 1
 
 # Called by the rocketfuel-setup script. You probably don't want to run this
 # on its own.

=== modified file 'buildout.cfg'
--- buildout.cfg	2017-05-12 10:04:55 +0000
+++ buildout.cfg	2017-09-04 12:38:46 +0000
@@ -6,7 +6,6 @@
     scripts
     tags
     iharness
-    i18n
     txlongpoll
     txpkgupload
 unzip = true
@@ -69,14 +68,6 @@
 recipe = z3c.recipe.tag:tags
 eggs = lp
 
-[i18n]
-recipe = z3c.recipe.i18n:i18n
-eggs = lp
-packages = lp
-domain = launchpad
-output = locales
-zcml = <include file="../../zcml/webapp.zcml" />
-
 [txlongpoll]
 recipe = z3c.recipe.scripts
 eggs = ${scripts:eggs}

=== modified file 'versions.cfg'
--- versions.cfg	2017-09-04 10:13:29 +0000
+++ versions.cfg	2017-09-04 12:38:46 +0000
@@ -149,7 +149,6 @@
 wsgiref = 0.1.2
 z3c.pt = 2.2.3
 z3c.ptcompat = 0.5.7
-z3c.recipe.i18n = 0.8.1
 z3c.recipe.tag = 0.6
 # Also upgrade the zc.buildout version in the Makefile's bin/buildout section.
 zc.buildout = 1.7.1


Follow ups