I'm only submitting the cover letter for this RFC.  The current state of
the patches can be seen on github.

https://github.com/openvswitch/ovs/compare/master...russellb:python

This is a fairly long patch series.  I tried to keep things broken up
into fairly small chunks to make it easier to review, but I may have
gone overboard.  I'm interested in feedback on how to best structure
this series.  It roughly represents the process I followed in doing
this port, which was:

1) Create a more traditional (for Python projects) test environment
   to quickyl 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.

At the end, 'make check' now tests against both Python 2 and Python 3
(if installed) and passes.

If anyone has their own Python code they'd like to try against this
branch, I'd love to hear your test feedback.

Thanks!

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.

 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                                  |  50 +++
 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 +-
 74 files changed, 1683 insertions(+), 1036 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

Reply via email to