[ovs-dev] [RFC] [PATCH] 1/1 Add multi-column index support for the Python IDL

Terry Wilson twilson at redhat.com
Wed Apr 11 20:54:24 UTC 2018


On Wed, Apr 11, 2018 at 12:52 PM, Flavio Leitner <fbl at sysclose.org> wrote:
> On Wed, Apr 11, 2018 at 07:23:07PM +0200, Timothy Redaelli wrote:
>> On Tue, 10 Apr 2018 15:20:54 -0700
>> Ben Pfaff <blp at ovn.org> wrote:
>>
>> > On Mon, Apr 09, 2018 at 03:03:03PM -0500, twilson at redhat.com wrote:
>> > > From: Terry Wilson <twilson at redhat.com>
>> > >
>> > > This adds multi-column index support for the Python IDL that is
>> > > similar to the feature in the C IDL.
>> > >
>> > > Signed-off-by: Terry Wilson <twilson at redhat.com>
>> >
>> > Thanks for working on this.
>> >
>> > I think that this adds a new Python module dependency on
>> > "sortedcontainers".  I didn't have it installed for python2 or
>> > python3--at least on Debian, it is not installed by default--so many
>> > tests failed.  I guess that we should at least document that, and
>> > probably it means that there should be new dependencies.
>> >
>> > (When I installed the Python module, everything was fine.)
>>
>> Hi,
>> unfortunately "python-sortedcontainers" packages are not available on
>> RHEL repositories.
>>
>> This means, if this commit is approved, it will not be possible to build
>> OVS on RHEL anymore and, if we skip the tests, it will not be possible
>> to use the python OVS extensions.
>>
>> so I suggest, if possible, to find and alternative to
>> "sortedcontainers".
>
> Hi Terry,
>
> Not trying to be the obstructionist here, but as you pointed out in
> the cover letter and Tim highlighted here, that dependency isn't
> packaged in neither RHEL (7 or 8) or EPEL, which means it breaks OVS
> backwards compatibility. I suspect others not-so-recent distros might
> have the same problem.  For instance, only F27 includes that IIRC.
>
> Do you have a plan to address that issue?

My plan, if people are in general OK with adding the dependency at all
(and the architecture of the RFC patch), is 1) Take the Fedora
packages and try to get them in RHEL and 2) make only the feature
dependent on sortedcontainers with some simple try/except magic.
Another option would be to just take the part of sortedcontainers
(which is Apache 2.0) that we need, drop it in the tree, and have the
exception on import actually import from the local copy. In general I
don't like copying projects into other projects, though.
sortedcontainers is a very mature, fast, pure-python library. It would
be handy to be able to use it even in other parts of the library. For
instance, we call sorted() a lot in data.py for doing things like
to_json(), to_python(), to_string(), etc. Sorting on each call instead
of storing in a sorted object in the first place. And those methods
are called *a lot*.

Terry


More information about the dev mailing list