The removed files are not needed by users, and some files
are incompatible with free software packaging (e.g. jar)
Drawback: if a developer changes congress grammar, s/he
needs to compile or download the antlr3 file to generate
the Parser/Lexer.
Instructions added to download antlr3 and generate files.
Partial-Bug: 1591763
Change-Id: I716ffe9f651dc48eb513efbb653aadf8f33f604a
The raw_input() raises NameError: name 'raw_input' is not defined in
python3. This patch fixes it by replacing raw_input with input to
make PY3 compatible
Change-Id: Ib8ee47730f5358b3929612c5a966bfb56df022f3
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
* Remove the directory thirdparty/antlr3/
* Modify the antlr3 symbolic link to point to
thirdparty/antlr3-antlr-3.5/runtime/Python/antlr3/
Change-Id: I8104b7352e96d8e282da4e5bd8ff4fb4817aaa32
Having a local copy of a library is a bad practice. Files are
duplicated on the system, it's harder to update it.
For example, the local copy of dateutil 1.5 is not compatible with
Python 3.
Replace the local copy with a dependency to dateutil, at least the
version 2.4.2. dateutil 2.4.2 is compatible with Python 3.
Partially implements blueprint: support-python3
Change-Id: I366c8004e5eb683b41fec2c31cf4a5afdb48180c
Adding antlr3 to the front of sys.path causes confusion for subsequent
imports. I ran into a problem where "import extras" imported something from
the antlr3 directory instead of site-packages. Antlr3 should be at the back
of the sys.path.
Change-Id: I03c4f723236c1b99759fa9d03f6296f4e49f98db
The python34 gating is complaining about the 'unicode' parameter when
trying to do its job. This patch attempts to solve it.
Closes-Bug: 1396969
Change-Id: I16a19f51325285973f37b36aa0469537fca766a7
Previously we had not updated setup.cfg to properly install dateutil.
All the tests ran fine, but 'python setup.py install' did not put
dateutil in the proper place, which made the server fail when installed.
Change-Id: Icc468ff41c0d1a70c5dccb9966ce7ed41207c67e
Borrowed (with license) from python-dateutil. We're copying
code here instead of inserting it as a package. Because
(1) this package is not supported by OS.
(2) all new OS packages must be python 3 compliant.
(3) this package has a python-3 compliant version and a python-2 version
(4) Congress is not yet python-3 compliant
Change-Id: Idaa29ecd9fc6d12298ca441748f71b6e41262d8f