congress/congress
Eric K 0576d774a4 Python3-readiness for antlr3 pieces
Purpose: Make antlr code Python3-ready while keeping Python2 support

Changes:
- Generated Python3 CongressParser.py and CongressLexer.py placed in
subpackage congress/datalog/Python3/ (using antlr 3.5.2)
- Moved original CongressParser.py and CongressLexer.py into new
subpackage congress/datalog/Python2/
- Changed import section in congress/datalog/compiler.py to import
the appropriate subpackage based on python version used
- Removed original symlink antlr3 to the antlr3-python2 runtime
- Changed setup.py to create the appropriate antlr3 symlink based on
python version
- Changed the error reporting interface of antlr3-python3 runtime to
be compatible with what existing Congress code expects
(thirdparty/antlr3-antlr-3.5/runtime/Python3/antlr3/recognizers.py)

Result: tox -e py34 no longer reports any errors traced to antlr code.

Notes:
- Supporting both Python versions was not straightforward because
neither the antlr runtime nor the antlr generated code is
cross-version compatible.
- Making symlinks via setup.py is not ideal, but the best solution
I came up with among several I considered. If you have better ideas
please suggest.
- Making our own custom changes to antlr3-python3 runtime is not
ideal, but it was necessary because for some reason the
antlr3-python3 runtime broke error reporting interface compatibility
with antlr3-python2 runtime, leading to test failures in
test_compile.py and test_congress.py.
In theory, supporting our custom changes in antlr3 runtime bad, but
because antlr3 is not supported anyway, the situation is really no
worse than before. In addition, the changes are fairly minor.
- antlr4 was not adopted because it does not have support for
abstract syntax trees.

Partially implements blueprint: support-python3

Change-Id: I376aee803c4dc9953c1b5ba9311cf9c4a42f3319
2015-11-19 18:39:07 -08:00
..
api Revert "Code re-org for distributed architecture" 2015-10-23 14:28:48 -07:00
common Use oslo_config new type PortOpt for port options 2015-10-26 23:23:00 -06:00
datalog Python3-readiness for antlr3 pieces 2015-11-19 18:39:07 -08:00
datasources Add availability zone information into nova driver 2015-10-29 09:18:24 +01:00
db Allow deleting policy by name 2015-10-15 11:17:06 +05:30
dse Merge "Update hacking to version 0.10" 2015-09-23 00:39:54 +00:00
managers Merge "Prepare Schema Model API for the new architecture" 2015-09-21 22:06:29 +00:00
openstack Clean unused oslo incubator files 2015-07-07 09:10:06 +08:00
policy_engines Merge "Sets loaded rule info to Rule instances" 2015-10-20 18:46:14 +00:00
server Not show backtrace when stop server by sigint or ctrl+c 2015-07-09 10:09:00 +08:00
tests Merge "Revert "Code re-org for distributed architecture"" 2015-11-04 16:54:22 +00:00
__init__.py Attemp to fix python34 gating error 2014-11-27 23:18:33 +08:00
auth.py Migrate congress/openstack/common/log.py to oslo.log 2015-07-07 09:08:53 +08:00
context.py Use oslo.context instead of oslo incubator 2015-07-07 09:10:06 +08:00
exception.py Raise python-3 compatible exceptions 2015-09-15 10:11:00 +05:30
harness.py Revert "Code re-org for distributed architecture" 2015-10-23 14:28:48 -07:00
opts.py Using oslo to generate congress.conf.sample 2015-08-27 19:05:59 +08:00
service.py No using d6cage to initialize APIRouter() 2015-08-13 23:51:38 +00:00
synchronizer.py Migrate congress/openstack/common/log.py to oslo.log 2015-07-07 09:08:53 +08:00
utils.py Replace basestring with six.string_types 2015-07-29 17:17:32 +05:30
version.py Make congress-server --version work 2015-03-30 09:58:29 -07:00