linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] Documentation: add pyyaml to requirements.txt
@ 2023-12-22 13:36 Vegard Nossum
  2023-12-22 17:40 ` Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Vegard Nossum @ 2023-12-22 13:36 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, linux-doc, linux-kernel, Vegard Nossum, Breno Leitao,
	David S . Miller, Jonathan Corbet

Commit f061c9f7d058 ("Documentation: Document each netlink family") added
a new Python script that is invoked during 'make htmldocs' and which reads
the netlink YAML spec files.

Using the virtualenv from scripts/sphinx-pre-install, we get this new
error wen running 'make htmldocs':

  Traceback (most recent call last):
    File "./tools/net/ynl/ynl-gen-rst.py", line 26, in <module>
      import yaml
  ModuleNotFoundError: No module named 'yaml'
  make[2]: *** [Documentation/Makefile:112: Documentation/networking/netlink_spec/rt_link.rst] Error 1
  make[1]: *** [Makefile:1708: htmldocs] Error 2

Fix this by adding 'pyyaml' to requirements.txt.

Note: This was somehow present in the original patch submission:
<https://lore.kernel.org/all/20231103135622.250314-1-leitao@debian.org/>
I'm not sure why the pyyaml requirement disappeared in the meantime.

Fixes: f061c9f7d058 ("Documentation: Document each netlink family")
Cc: Breno Leitao <leitao@debian.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
 Documentation/sphinx/requirements.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt
index 335b53df35e2..a8a1aff6445e 100644
--- a/Documentation/sphinx/requirements.txt
+++ b/Documentation/sphinx/requirements.txt
@@ -1,3 +1,4 @@
 # jinja2>=3.1 is not compatible with Sphinx<4.0
 jinja2<3.1
 Sphinx==2.4.4
+pyyaml
-- 
2.34.1


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

* Re: [PATCH net-next] Documentation: add pyyaml to requirements.txt
  2023-12-22 13:36 [PATCH net-next] Documentation: add pyyaml to requirements.txt Vegard Nossum
@ 2023-12-22 17:40 ` Jani Nikula
  2023-12-24 16:46 ` Simon Horman
  2024-01-02 13:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2023-12-22 17:40 UTC (permalink / raw)
  To: Vegard Nossum, Jakub Kicinski
  Cc: netdev, linux-doc, linux-kernel, Vegard Nossum, Breno Leitao,
	David S . Miller, Jonathan Corbet

On Fri, 22 Dec 2023, Vegard Nossum <vegard.nossum@oracle.com> wrote:
> Commit f061c9f7d058 ("Documentation: Document each netlink family") added
> a new Python script that is invoked during 'make htmldocs' and which reads
> the netlink YAML spec files.
>
> Using the virtualenv from scripts/sphinx-pre-install, we get this new
> error wen running 'make htmldocs':
>
>   Traceback (most recent call last):
>     File "./tools/net/ynl/ynl-gen-rst.py", line 26, in <module>
>       import yaml
>   ModuleNotFoundError: No module named 'yaml'
>   make[2]: *** [Documentation/Makefile:112: Documentation/networking/netlink_spec/rt_link.rst] Error 1
>   make[1]: *** [Makefile:1708: htmldocs] Error 2
>
> Fix this by adding 'pyyaml' to requirements.txt.
>
> Note: This was somehow present in the original patch submission:
> <https://lore.kernel.org/all/20231103135622.250314-1-leitao@debian.org/>
> I'm not sure why the pyyaml requirement disappeared in the meantime.

FWIW, not really specific to the patch at hand, but I'd always prefer
strictyaml [1] with schemas over plain yaml. You get strict typing and
validation of the data during parsing. It's pretty nice, maybe worth
looking into here.


BR,
Jani.


[1] https://hitchdev.com/strictyaml/



>
> Fixes: f061c9f7d058 ("Documentation: Document each netlink family")
> Cc: Breno Leitao <leitao@debian.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
>  Documentation/sphinx/requirements.txt | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt
> index 335b53df35e2..a8a1aff6445e 100644
> --- a/Documentation/sphinx/requirements.txt
> +++ b/Documentation/sphinx/requirements.txt
> @@ -1,3 +1,4 @@
>  # jinja2>=3.1 is not compatible with Sphinx<4.0
>  jinja2<3.1
>  Sphinx==2.4.4
> +pyyaml

-- 
Jani Nikula, Intel

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

* Re: [PATCH net-next] Documentation: add pyyaml to requirements.txt
  2023-12-22 13:36 [PATCH net-next] Documentation: add pyyaml to requirements.txt Vegard Nossum
  2023-12-22 17:40 ` Jani Nikula
@ 2023-12-24 16:46 ` Simon Horman
  2024-01-02 11:51   ` Breno Leitao
  2024-01-02 13:50 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2023-12-24 16:46 UTC (permalink / raw)
  To: Vegard Nossum
  Cc: Jakub Kicinski, netdev, linux-doc, linux-kernel, Breno Leitao,
	David S . Miller, Jonathan Corbet

On Fri, Dec 22, 2023 at 02:36:28PM +0100, Vegard Nossum wrote:
> Commit f061c9f7d058 ("Documentation: Document each netlink family") added
> a new Python script that is invoked during 'make htmldocs' and which reads
> the netlink YAML spec files.
> 
> Using the virtualenv from scripts/sphinx-pre-install, we get this new
> error wen running 'make htmldocs':
> 
>   Traceback (most recent call last):
>     File "./tools/net/ynl/ynl-gen-rst.py", line 26, in <module>
>       import yaml
>   ModuleNotFoundError: No module named 'yaml'
>   make[2]: *** [Documentation/Makefile:112: Documentation/networking/netlink_spec/rt_link.rst] Error 1
>   make[1]: *** [Makefile:1708: htmldocs] Error 2
> 
> Fix this by adding 'pyyaml' to requirements.txt.
> 
> Note: This was somehow present in the original patch submission:
> <https://lore.kernel.org/all/20231103135622.250314-1-leitao@debian.org/>
> I'm not sure why the pyyaml requirement disappeared in the meantime.
> 
> Fixes: f061c9f7d058 ("Documentation: Document each netlink family")
> Cc: Breno Leitao <leitao@debian.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>

I think the patch at the link above went through a few revisions
and landed as:

  f061c9f7d058 ("Documentation: Document each netlink family")

And that along the way the requirements.txt update got lost.

Reviewed-by: Simon Horman <horms@kernel.org>

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

* Re: [PATCH net-next] Documentation: add pyyaml to requirements.txt
  2023-12-24 16:46 ` Simon Horman
@ 2024-01-02 11:51   ` Breno Leitao
  0 siblings, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2024-01-02 11:51 UTC (permalink / raw)
  To: Simon Horman, vegard.nossum
  Cc: Vegard Nossum, Jakub Kicinski, netdev, linux-doc, linux-kernel,
	David S . Miller, Jonathan Corbet

Hello Vegard,

On Fri, Dec 22, 2023 at 02:36:28PM +0100, Vegard Nossum wrote:
> Commit f061c9f7d058 ("Documentation: Document each netlink family") added
> a new Python script that is invoked during 'make htmldocs' and which reads
> the netlink YAML spec files.
> 
> Using the virtualenv from scripts/sphinx-pre-install, we get this new
> error wen running 'make htmldocs':

The commit doesn't depend on sphinx. This is a standalone script now.
The requirements file is at tools/net/ynl/requirements.txt not in sphinx

> Note: This was somehow present in the original patch submission:
> <https://lore.kernel.org/all/20231103135622.250314-1-leitao@debian.org/>
> I'm not sure why the pyyaml requirement disappeared in the meantime.

It disapperared because the original patch version was a sphinx module,
thus, pyaml was not at sphinx dependency.

In the commit final form, the script is a standalone script inside
'tools/net/ynl', and PyYAML is already tracked in
`tools/net/ynl/requirements.txt`.

That said, can you try to install `tools/net/ynl/requirements.txt` and
see if you are able to reproduce the problem?

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

* Re: [PATCH net-next] Documentation: add pyyaml to requirements.txt
  2023-12-22 13:36 [PATCH net-next] Documentation: add pyyaml to requirements.txt Vegard Nossum
  2023-12-22 17:40 ` Jani Nikula
  2023-12-24 16:46 ` Simon Horman
@ 2024-01-02 13:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-02 13:50 UTC (permalink / raw)
  To: Vegard Nossum
  Cc: kuba, netdev, linux-doc, linux-kernel, leitao, davem, corbet

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 22 Dec 2023 14:36:28 +0100 you wrote:
> Commit f061c9f7d058 ("Documentation: Document each netlink family") added
> a new Python script that is invoked during 'make htmldocs' and which reads
> the netlink YAML spec files.
> 
> Using the virtualenv from scripts/sphinx-pre-install, we get this new
> error wen running 'make htmldocs':
> 
> [...]

Here is the summary with links:
  - [net-next] Documentation: add pyyaml to requirements.txt
    https://git.kernel.org/netdev/net-next/c/7df54188a897

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-01-02 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-22 13:36 [PATCH net-next] Documentation: add pyyaml to requirements.txt Vegard Nossum
2023-12-22 17:40 ` Jani Nikula
2023-12-24 16:46 ` Simon Horman
2024-01-02 11:51   ` Breno Leitao
2024-01-02 13:50 ` patchwork-bot+netdevbpf

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).