[PATCH v4 2/4] tools: ynl: add initial pyproject.toml for packaging

Jan Stancek posted 4 patches 11 months, 1 week ago
[PATCH v4 2/4] tools: ynl: add initial pyproject.toml for packaging
Posted by Jan Stancek 11 months, 1 week ago
Add pyproject.toml and define authors, dependencies and
user-facing scripts. This will be used later by pip to
install python code.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 tools/net/ynl/pyproject.toml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 tools/net/ynl/pyproject.toml

diff --git a/tools/net/ynl/pyproject.toml b/tools/net/ynl/pyproject.toml
new file mode 100644
index 000000000000..a81d8779b0e0
--- /dev/null
+++ b/tools/net/ynl/pyproject.toml
@@ -0,0 +1,24 @@
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "pyynl"
+authors = [
+    {name = "Donald Hunter", email = "donald.hunter@gmail.com"},
+    {name = "Jakub Kicinski", email = "kuba@kernel.org"},
+]
+description = "yaml netlink (ynl)"
+version = "0.0.1"
+requires-python = ">=3.9"
+dependencies = [
+    "pyyaml==6.*",
+    "jsonschema==4.*"
+]
+
+[tool.setuptools.packages.find]
+include = ["pyynl", "pyynl.lib"]
+
+[project.scripts]
+ynl = "pyynl.cli:main"
+ynl-ethtool = "pyynl.ethtool:main"
-- 
2.43.0
Re: [PATCH v4 2/4] tools: ynl: add initial pyproject.toml for packaging
Posted by Donald Hunter 11 months, 1 week ago
Jan Stancek <jstancek@redhat.com> writes:

> Add pyproject.toml and define authors, dependencies and
> user-facing scripts. This will be used later by pip to
> install python code.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

The ynl-ethtool script is broken when installed because it hard-codes
spec and schema paths to in-tree locations.  I'd be happy to fix that in
a followup patch, since I have a schema lookup patch in progress.

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>

> ---
>  tools/net/ynl/pyproject.toml | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 tools/net/ynl/pyproject.toml
>
> diff --git a/tools/net/ynl/pyproject.toml b/tools/net/ynl/pyproject.toml
> new file mode 100644
> index 000000000000..a81d8779b0e0
> --- /dev/null
> +++ b/tools/net/ynl/pyproject.toml
> @@ -0,0 +1,24 @@
> +[build-system]
> +requires = ["setuptools>=61.0"]
> +build-backend = "setuptools.build_meta"
> +
> +[project]
> +name = "pyynl"
> +authors = [
> +    {name = "Donald Hunter", email = "donald.hunter@gmail.com"},
> +    {name = "Jakub Kicinski", email = "kuba@kernel.org"},
> +]
> +description = "yaml netlink (ynl)"
> +version = "0.0.1"
> +requires-python = ">=3.9"
> +dependencies = [
> +    "pyyaml==6.*",
> +    "jsonschema==4.*"
> +]
> +
> +[tool.setuptools.packages.find]
> +include = ["pyynl", "pyynl.lib"]
> +
> +[project.scripts]
> +ynl = "pyynl.cli:main"
> +ynl-ethtool = "pyynl.ethtool:main"