mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: donald.hunter@gmail.com, kuba@kernel.org
Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@google.com,
	horms@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, jstancek@redhat.com
Subject: [PATCH 1/5] tools: ynl: move python code to separate sub-directory
Date: Tue,  3 Dec 2024 10:27:00 +0100	[thread overview]
Message-ID: <20b2bdfe94fed5b9694e22c79c79858502f5e014.1733216767.git.jstancek@redhat.com> (raw)
In-Reply-To: <cover.1733216767.git.jstancek@redhat.com>

Move python code to a separate directory so it can be
packaged as a python module.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 tools/net/ynl/Makefile                    | 1 +
 tools/net/ynl/generated/Makefile          | 2 +-
 tools/net/ynl/lib/.gitignore              | 1 -
 tools/net/ynl/lib/Makefile                | 1 -
 tools/net/ynl/pyynl/__init__.py           | 0
 tools/net/ynl/{ => pyynl}/cli.py          | 0
 tools/net/ynl/{ => pyynl}/ethtool.py      | 0
 tools/net/ynl/pyynl/lib/.gitignore        | 1 +
 tools/net/ynl/{ => pyynl}/lib/__init__.py | 0
 tools/net/ynl/{ => pyynl}/lib/nlspec.py   | 0
 tools/net/ynl/{ => pyynl}/lib/ynl.py      | 0
 tools/net/ynl/{ => pyynl}/ynl-gen-c.py    | 0
 tools/net/ynl/{ => pyynl}/ynl-gen-rst.py  | 0
 tools/net/ynl/ynl-regen.sh                | 2 +-
 14 files changed, 4 insertions(+), 4 deletions(-)
 create mode 100644 tools/net/ynl/pyynl/__init__.py
 rename tools/net/ynl/{ => pyynl}/cli.py (100%)
 rename tools/net/ynl/{ => pyynl}/ethtool.py (100%)
 create mode 100644 tools/net/ynl/pyynl/lib/.gitignore
 rename tools/net/ynl/{ => pyynl}/lib/__init__.py (100%)
 rename tools/net/ynl/{ => pyynl}/lib/nlspec.py (100%)
 rename tools/net/ynl/{ => pyynl}/lib/ynl.py (100%)
 rename tools/net/ynl/{ => pyynl}/ynl-gen-c.py (100%)
 rename tools/net/ynl/{ => pyynl}/ynl-gen-rst.py (100%)

diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile
index d1cdf2a8f826..617b405d9ef8 100644
--- a/tools/net/ynl/Makefile
+++ b/tools/net/ynl/Makefile
@@ -21,5 +21,6 @@ clean distclean:
 		fi \
 	done
 	rm -f libynl.a
+	rm -rf pyynl/lib/__pycache__
 
 .PHONY: all clean distclean $(SUBDIRS)
diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile
index 7db5240de58a..36519ea2792a 100644
--- a/tools/net/ynl/generated/Makefile
+++ b/tools/net/ynl/generated/Makefile
@@ -12,7 +12,7 @@ include ../Makefile.deps
 YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
 	--exclude-op stats-get
 
-TOOL:=../ynl-gen-c.py
+TOOL:=../pyynl/ynl-gen-c.py
 
 GENS_PATHS=$(shell grep -nrI --files-without-match \
 		'protocol: netlink' \
diff --git a/tools/net/ynl/lib/.gitignore b/tools/net/ynl/lib/.gitignore
index 296c4035dbf2..a4383358ec72 100644
--- a/tools/net/ynl/lib/.gitignore
+++ b/tools/net/ynl/lib/.gitignore
@@ -1,2 +1 @@
-__pycache__/
 *.d
diff --git a/tools/net/ynl/lib/Makefile b/tools/net/ynl/lib/Makefile
index 94c49cca3dca..4b2b98704ff9 100644
--- a/tools/net/ynl/lib/Makefile
+++ b/tools/net/ynl/lib/Makefile
@@ -19,7 +19,6 @@ ynl.a: $(OBJS)
 
 clean:
 	rm -f *.o *.d *~
-	rm -rf __pycache__
 
 distclean: clean
 	rm -f *.a
diff --git a/tools/net/ynl/pyynl/__init__.py b/tools/net/ynl/pyynl/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/tools/net/ynl/cli.py b/tools/net/ynl/pyynl/cli.py
similarity index 100%
rename from tools/net/ynl/cli.py
rename to tools/net/ynl/pyynl/cli.py
diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/pyynl/ethtool.py
similarity index 100%
rename from tools/net/ynl/ethtool.py
rename to tools/net/ynl/pyynl/ethtool.py
diff --git a/tools/net/ynl/pyynl/lib/.gitignore b/tools/net/ynl/pyynl/lib/.gitignore
new file mode 100644
index 000000000000..c18dd8d83cee
--- /dev/null
+++ b/tools/net/ynl/pyynl/lib/.gitignore
@@ -0,0 +1 @@
+__pycache__/
diff --git a/tools/net/ynl/lib/__init__.py b/tools/net/ynl/pyynl/lib/__init__.py
similarity index 100%
rename from tools/net/ynl/lib/__init__.py
rename to tools/net/ynl/pyynl/lib/__init__.py
diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/pyynl/lib/nlspec.py
similarity index 100%
rename from tools/net/ynl/lib/nlspec.py
rename to tools/net/ynl/pyynl/lib/nlspec.py
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
similarity index 100%
rename from tools/net/ynl/lib/ynl.py
rename to tools/net/ynl/pyynl/lib/ynl.py
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/pyynl/ynl-gen-c.py
similarity index 100%
rename from tools/net/ynl/ynl-gen-c.py
rename to tools/net/ynl/pyynl/ynl-gen-c.py
diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/pyynl/ynl-gen-rst.py
similarity index 100%
rename from tools/net/ynl/ynl-gen-rst.py
rename to tools/net/ynl/pyynl/ynl-gen-rst.py
diff --git a/tools/net/ynl/ynl-regen.sh b/tools/net/ynl/ynl-regen.sh
index a37304dcc88e..3212dab1cc6e 100755
--- a/tools/net/ynl/ynl-regen.sh
+++ b/tools/net/ynl/ynl-regen.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 
-TOOL=$(dirname $(realpath $0))/ynl-gen-c.py
+TOOL=$(dirname $(realpath $0))/pyynl/ynl-gen-c.py
 
 force=
 search=
-- 
2.43.0


  reply	other threads:[~2024-12-03  9:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  9:26 [PATCH 0/5] tools: ynl: add install target Jan Stancek
2024-12-03  9:27 ` Jan Stancek [this message]
2024-12-03 16:52   ` [PATCH 1/5] tools: ynl: move python code to separate sub-directory Stanislav Fomichev
2024-12-04 14:53     ` Jan Stancek
2024-12-03 19:50   ` Donald Hunter
2024-12-03  9:27 ` [PATCH 2/5] tools: ynl: rename ynl-gen-[c|rst] to ynl_gen_[c|rst] Jan Stancek
2024-12-03  9:27 ` [PATCH 3/5] tools: ynl: add initial pyproject.toml for packaging Jan Stancek
2024-12-03  9:27 ` [PATCH 4/5] tools: ynl: add install target for specs and docs Jan Stancek
2024-12-03  9:27 ` [PATCH 5/5] tools: ynl: add main install target Jan Stancek

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=20b2bdfe94fed5b9694e22c79c79858502f5e014.1733216767.git.jstancek@redhat.com \
    --to=jstancek@redhat.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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

all inboxes | Powered by JetHome®