All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] nvmetcli fixes
@ 2016-10-13  0:00 Andy Grover
  2016-10-13  0:00 ` [PATCH 1/3] Add nvmetcli to setup.py scripts Andy Grover
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Andy Grover @ 2016-10-13  0:00 UTC (permalink / raw)


Here are some small fixes that help packaging nvmetcli,
and help it minimally work with Python 3 -- there are likely more
Py2/3 issues that will come out in testing but this gets us past
initial import errors.

Thanks -- Andy

Andy Grover (3):
  Add nvmetcli to setup.py scripts
  Use relative import in nvmet/__init__.py
  nvmetcli: Fix nvmet import

 nvmet/__init__.py | 2 +-
 nvmetcli          | 2 +-
 setup.py          | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] Add nvmetcli to setup.py scripts
  2016-10-13  0:00 [PATCH 0/3] nvmetcli fixes Andy Grover
@ 2016-10-13  0:00 ` Andy Grover
  2016-10-13 10:05   ` Christoph Hellwig
  2016-10-13  0:00 ` [PATCH 2/3] Use relative import in nvmet/__init__.py Andy Grover
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Andy Grover @ 2016-10-13  0:00 UTC (permalink / raw)


This results in nvmetcli being placed in the right place on install, and
the interpreter name will be changed to the current interpreter name,
which may be different, e.g. /usr/bin/python3.

Signed-off-by: Andy Grover <agrover at redhat.com>
---
 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index 078020f..f62ce5b 100755
--- a/setup.py
+++ b/setup.py
@@ -27,4 +27,5 @@ setup(
     maintainer_email = 'hch at lst.de',
     test_suite='nose2.collector.collector',
     packages = ['nvmet'],
+    scripts = ['nvmetcli'],
     )
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] Use relative import in nvmet/__init__.py
  2016-10-13  0:00 [PATCH 0/3] nvmetcli fixes Andy Grover
  2016-10-13  0:00 ` [PATCH 1/3] Add nvmetcli to setup.py scripts Andy Grover
@ 2016-10-13  0:00 ` Andy Grover
  2016-10-13  0:00 ` [PATCH 3/3] nvmetcli: Fix nvmet import Andy Grover
  2016-10-13 10:06 ` [PATCH 0/3] nvmetcli fixes Christoph Hellwig
  3 siblings, 0 replies; 8+ messages in thread
From: Andy Grover @ 2016-10-13  0:00 UTC (permalink / raw)


This is supported by Python 2.7 and later.

Signed-off-by: Andy Grover <agrover at redhat.com>
---
 nvmet/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvmet/__init__.py b/nvmet/__init__.py
index eba0ebb..a084151 100644
--- a/nvmet/__init__.py
+++ b/nvmet/__init__.py
@@ -1 +1 @@
-from nvme import Root, Subsystem, Namespace
+from .nvme import Root, Subsystem, Namespace
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] nvmetcli: Fix nvmet import
  2016-10-13  0:00 [PATCH 0/3] nvmetcli fixes Andy Grover
  2016-10-13  0:00 ` [PATCH 1/3] Add nvmetcli to setup.py scripts Andy Grover
  2016-10-13  0:00 ` [PATCH 2/3] Use relative import in nvmet/__init__.py Andy Grover
@ 2016-10-13  0:00 ` Andy Grover
  2016-10-13 10:06 ` [PATCH 0/3] nvmetcli fixes Christoph Hellwig
  3 siblings, 0 replies; 8+ messages in thread
From: Andy Grover @ 2016-10-13  0:00 UTC (permalink / raw)


We should just need to import nvmet, which will run __init__.py and import
just the public things from nvmet/nvme.py.

Signed-off-by: Andy Grover <agrover at redhat.com>
---
 nvmetcli | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvmetcli b/nvmetcli
index a318aa6..8140fc6 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -23,7 +23,7 @@ from __future__ import print_function
 import os
 import sys
 import configshell_fb as configshell
-import nvmet.nvme as nvme
+import nvmet as nvme
 
 
 class UINode(configshell.node.ConfigNode):
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/3] Add nvmetcli to setup.py scripts
  2016-10-13  0:00 ` [PATCH 1/3] Add nvmetcli to setup.py scripts Andy Grover
@ 2016-10-13 10:05   ` Christoph Hellwig
  2016-10-13 16:23     ` Andy Grover
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2016-10-13 10:05 UTC (permalink / raw)


On Wed, Oct 12, 2016@05:00:40PM -0700, Andy Grover wrote:
> This results in nvmetcli being placed in the right place on install, and
> the interpreter name will be changed to the current interpreter name,
> which may be different, e.g. /usr/bin/python3.
> 
> Signed-off-by: Andy Grover <agrover at redhat.com>

It installs it into the wrong place unfortunately, /usr/bin instead
of /usr/sbin.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/3] nvmetcli fixes
  2016-10-13  0:00 [PATCH 0/3] nvmetcli fixes Andy Grover
                   ` (2 preceding siblings ...)
  2016-10-13  0:00 ` [PATCH 3/3] nvmetcli: Fix nvmet import Andy Grover
@ 2016-10-13 10:06 ` Christoph Hellwig
  3 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2016-10-13 10:06 UTC (permalink / raw)


On Wed, Oct 12, 2016@05:00:39PM -0700, Andy Grover wrote:
> Here are some small fixes that help packaging nvmetcli,
> and help it minimally work with Python 3 -- there are likely more
> Py2/3 issues that will come out in testing but this gets us past
> initial import errors.

Thanks Andy, I've applied patches 2 and 3.  Any idea how to get
nvmetcli installed to /usr/sbin using setuptools?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] Add nvmetcli to setup.py scripts
  2016-10-13 10:05   ` Christoph Hellwig
@ 2016-10-13 16:23     ` Andy Grover
  2016-10-14  5:50       ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Grover @ 2016-10-13 16:23 UTC (permalink / raw)


On 10/13/2016 03:05 AM, Christoph Hellwig wrote:
> On Wed, Oct 12, 2016@05:00:40PM -0700, Andy Grover wrote:
>> This results in nvmetcli being placed in the right place on install, and
>> the interpreter name will be changed to the current interpreter name,
>> which may be different, e.g. /usr/bin/python3.
>>
>> Signed-off-by: Andy Grover <agrover at redhat.com>
>
> It installs it into the wrong place unfortunately, /usr/bin instead
> of /usr/sbin.

There's a command-line argument to 'python setup.py install', 
--install-scripts, that can be used to put it in /usr/sbin if you want...

-- Andy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] Add nvmetcli to setup.py scripts
  2016-10-13 16:23     ` Andy Grover
@ 2016-10-14  5:50       ` Christoph Hellwig
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2016-10-14  5:50 UTC (permalink / raw)


On Thu, Oct 13, 2016@09:23:54AM -0700, Andy Grover wrote:
> On 10/13/2016 03:05 AM, Christoph Hellwig wrote:
> > On Wed, Oct 12, 2016@05:00:40PM -0700, Andy Grover wrote:
> > > This results in nvmetcli being placed in the right place on install, and
> > > the interpreter name will be changed to the current interpreter name,
> > > which may be different, e.g. /usr/bin/python3.
> > > 
> > > Signed-off-by: Andy Grover <agrover at redhat.com>
> > 
> > It installs it into the wrong place unfortunately, /usr/bin instead
> > of /usr/sbin.
> 
> There's a command-line argument to 'python setup.py install',
> --install-scripts, that can be used to put it in /usr/sbin if you want...

Can you fix up the specfile to use it?  I'll take care of the Debian
packaging then.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-14  5:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13  0:00 [PATCH 0/3] nvmetcli fixes Andy Grover
2016-10-13  0:00 ` [PATCH 1/3] Add nvmetcli to setup.py scripts Andy Grover
2016-10-13 10:05   ` Christoph Hellwig
2016-10-13 16:23     ` Andy Grover
2016-10-14  5:50       ` Christoph Hellwig
2016-10-13  0:00 ` [PATCH 2/3] Use relative import in nvmet/__init__.py Andy Grover
2016-10-13  0:00 ` [PATCH 3/3] nvmetcli: Fix nvmet import Andy Grover
2016-10-13 10:06 ` [PATCH 0/3] nvmetcli fixes Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.