From: Walker, Benjamin <benjamin.walker at intel.com>
To: spdk@lists.01.org
Subject: Re: [SPDK] spdk 19.1 RPCs using python 3
Date: Mon, 11 Feb 2019 23:42:36 +0000 [thread overview]
Message-ID: <b2826fff2b75bae3d36075720ca859f6bdb7ec8a.camel@intel.com> (raw)
In-Reply-To: AM6PR04MB51271E8FE6B25CDAB9E7E3E0896F0@AM6PR04MB5127.eurprd04.prod.outlook.com
[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]
On Wed, 2019-02-06 at 13:11 +0000, Shahar Salzman wrote:
> Hi,
>
> As spdk 19.1 RPC have moved to python 3, I am faced with a problem, as some of
> our production code runs on python 2.6.
> I was able to successfully port the spdk RPCs to python 2.6 by using the
> print_function from __future__.
>
> I prefer to use the spdk rpc "as is", and not have to modify the code every
> time I integrate it into my environment, but understand that python 2.6 is
> EOL, so moving to python 3 is expected.
>
> Would it be possible to keep a python 2.6 RPC which imports the new RPCs and
> uses print_function, e.g.
>
> #!/usr/bin/python
> from __future__ import print_function
> from rpc_implementation import *
>
> And have a python 3 version be something like this:
> #!/usr/bin/env python3
> from rpc_implementation import *
>
> In this way python 2.6 support can be maintained without duplicating any of
> the code.
>
> WDYT?
> I would be glad to wirte and test this code if you approve.
I spent a bit of time getting to the bottom of this. Is the problem that on
Python 2.6, this Python code doesn't work?
>> print("test")
Because that works for me on Python 2.7 and Python 3. This print_function seems
to only be necessary for the more advanced usages of print() in Python 3, which
rpc.py is not using.
Also, you mention Python 2.6, but Python 2.6 is officially end of life as of
October 29, 2013 and has been replaced by Python 2.7. Since the Python
foundation dropped support for 2.6 more than five years ago, we can't support it
in SPDK.
For Python 2.7, that's officially supported until the end of this year. I think
SPDK will take the official stance that Python 2.7 will be supported in SPDK
until then, at which point we'll migrate fully to Python 3. If you notice any
compatibility issues with Python 2.7 in SPDK scripts, go ahead and file a bug
and we'll get them fixed for releases occurring in 2019.
>
> Shahar
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk
next reply other threads:[~2019-02-11 23:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 23:42 Walker, Benjamin [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-02-06 20:00 [SPDK] spdk 19.1 RPCs using python 3 Harris, James R
2019-02-06 13:11 Shahar Salzman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b2826fff2b75bae3d36075720ca859f6bdb7ec8a.camel@intel.com \
--to=spdk@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).