v1: - https://github.com/russellb/ovs/commits/python_submit_v1
I sent an RFC last Friday, but I was able to finish up the final tweaks I wanted to make today, so it's ready for review. This patch series ports the ovs Python library, as well as miscellaneous Python scripts, to Python 3. The series roughly represents the process I followed in doing this port, which was: 1) Create a more traditional (for Python projects) test environment to quickly reproduce the errors that could be found just by trying to install or import the code. This environment also let me run some static analysis to find several of the obvious things that needed to be fixed. 2) Include a patch from Terry Wilson, submitted a few months ago, that starts to address some Python 3 issues. It fixes the issues that arise simply by trying to install the code. 3) Apply Python style fixes. I couldn't help it. This also lets us run flake8 against the Python code automatically, which can find some basic bugs. 4) Go through the python library and fix compatibility issues. The changes are generally broken up by the type of change required. 5) Fix up various Python scripts in the source tree. Some commits addressed one script. Other commits address a handful of related scripts. 6) Fix up Python code in the main ovs test suite so that it also works under Python 3. 7) Refactor the OVS test suite to run Python tests with both Python 2 and Python 3. These commits are broken up by test module. 8) Integrate the tox test environment into the main ovs test suite. Testing: a) flake8 is run automatically against the code during 'make check', which can find some basic bugs using static analysis. All reported issues were resolved in this series, with the exception of some less important formatting warnings that are still ignored for now. b) The test suite was refactored to run Python tests using both Python 2.7 and Python 3.4. 'make check' passes. c) The OpenStack CI system has run successfully against this branch using the OpenStack integration for OVN, which uses the ovs Python library. Russell Bryant (54): python: Set up initial tox test environment. python: Remove unused imports and variables. python: Fix invalid variable reference. python: Add pep8 test environment. python: Resolve pep8 blank line errors. python: Resolve pep8 comparison errors. python: Restrict line length to 79 chars. python: Fix several pep8 whitespace errors. python: Inherit from object. python: Fix print function compatibility. python: Add missing Apache License headers. python: Fix xmlrpclib imports. python: Stop use of tuple parameter unpacking python: Stop using xrange(). python: Convert dict iterators. python: Drop usage of long type. python: Drop unicode type. python: Drop use of types.StringTypes. python: Drop use of types.FunctionType. xml2nroff: Make compatible with Python 3. ovsdb-doc: Make compatible with Python 3. extract-ofp: Python 3 compatibility. check-structs: Make Python 3 compatible. python: Don't use StringIO directly. python: Drop use of sys.maxint. python: Use six.unichr(). python: Add basic testing of ovs.json. python: Run ovsdb-doc from tox. python: Remove reamining direct type comarisons. tests: Make Python 3 compatible. tests: Python style fixes. python: Don't compare None and int. tests: Deal with Python output differences. python: Fix object comparisons in Python 3. python: Deal with str and byte differences. ovs-monitor-ipsec: Fix Python 3 compatibility. ovs-monitor-ipsec: Minor style fixes. ovs-pcap: Fix Python 3 compatibility. ovs-vtep: Fix Python 3 compatibility. ipfix-gen-entities: Fix Python 3 compatibility. ovs-xapi-sync: Fix Python 3 compatibility. configure: Check for presence of Python 3. check-structs.at: Run for both Python 2 and 3. json.at: Run for Python 2 and 3. ovsdb.at: Run Python tests for Python 2 and 3. ovsdb-idl.at: Run tests with both Python 2 and 3. library.at: Run tests for Python 2 and 3. jsonrpc-py.at: Run tests with Python 2 and 3. reconnect.at: Run tests for Python 2 and 3. daemon-py.at: Run tests with Python 2 and 3. unixctl-py.at: Run tests for Python 2 and 3. vlog.at: Run tests for Python 2 and 3. tests: Integrate tox with 'make check'. NEWS: Claim support for Python 3. Terry Wilson (1): python: Start fixing some Python 3 issues. INSTALL.md | 2 +- NEWS | 3 + build-aux/check-structs | 6 +- build-aux/extract-ofp-actions | 72 +-- build-aux/extract-ofp-errors | 38 +- build-aux/extract-ofp-fields | 10 +- build-aux/extract-ofp-msgs | 12 +- build-aux/xml2nroff | 14 +- configure.ac | 2 + debian/ovs-monitor-ipsec | 25 +- m4/openvswitch.m4 | 62 +++ ofproto/ipfix-gen-entities | 70 +-- ovsdb/ovsdb-doc | 38 +- python/.gitignore | 3 + python/automake.mk | 11 +- python/ovs/daemon.py | 33 +- python/ovs/db/data.py | 69 ++- python/ovs/db/idl.py | 103 +++-- python/ovs/db/parser.py | 35 +- python/ovs/db/schema.py | 47 +- python/ovs/db/types.py | 70 +-- python/ovs/dirs.py | 22 +- python/ovs/fatal_signal.py | 2 +- python/ovs/json.py | 62 +-- python/ovs/jsonrpc.py | 28 +- python/ovs/ovsuuid.py | 9 +- python/ovs/poller.py | 5 +- python/ovs/reconnect.py | 2 +- python/ovs/socket_util.py | 60 +-- python/ovs/stream.py | 26 +- python/ovs/tests/__init__.py | 1 + python/ovs/tests/test_json.py | 58 +++ python/ovs/tests/test_ovs.py | 46 ++ python/ovs/timeval.py | 3 + python/ovs/unixctl/__init__.py | 7 +- python/ovs/unixctl/client.py | 7 +- python/ovs/unixctl/server.py | 9 +- python/ovs/vlog.py | 17 +- python/ovstest/args.py | 4 +- python/ovstest/rpcserver.py | 9 +- python/ovstest/tests.py | 53 ++- python/ovstest/udp.py | 6 +- python/ovstest/util.py | 19 +- python/ovstest/vswitch.py | 4 +- python/requirements.txt | 2 + python/setup.py | 8 +- python/test-requirements.txt | 3 + python/tox.ini | 21 + tests/MockXenAPI.py | 3 + tests/atlocal.in | 6 + tests/automake.mk | 3 +- tests/check-structs.at | 39 +- tests/daemon-py.at | 483 +++++++++++---------- tests/json.at | 21 +- tests/jsonrpc-py.at | 79 ++-- tests/library.at | 34 +- tests/ovsdb-idl.at | 56 ++- tests/ovsdb.at | 52 ++- tests/reconnect.at | 8 +- tests/test-daemon.py | 1 - tests/test-json.py | 18 +- tests/test-jsonrpc.py | 8 +- tests/test-l7.py | 8 +- tests/test-ovsdb.py | 116 ++--- tests/test-reconnect.py | 50 ++- tests/test-unix-socket.py | 1 + tests/test-unixctl.py | 3 +- tests/test-vlog.py | 3 +- tests/testsuite.at | 1 + tests/tox.at | 13 + tests/unixctl-py.at | 202 +++++---- tests/vlog.at | 174 ++++---- utilities/ovs-pcap.in | 17 +- vtep/ovs-vtep | 96 ++-- .../usr_share_openvswitch_scripts_ovs-xapi-sync | 20 +- 75 files changed, 1696 insertions(+), 1037 deletions(-) create mode 100644 python/ovs/tests/__init__.py create mode 100644 python/ovs/tests/test_json.py create mode 100644 python/ovs/tests/test_ovs.py create mode 100644 python/requirements.txt create mode 100644 python/test-requirements.txt create mode 100644 python/tox.ini create mode 100644 tests/tox.at -- 2.5.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev