diff mbox series

[net-next] Documentation: add pyyaml to requirements.txt

Message ID 20231222133628.3010641-1-vegard.nossum@oracle.com (mailing list archive)
State Accepted
Commit 7df54188a897ff656e237239f2b02a8f70183333
Delegated to: Netdev Maintainers
Headers show
Series [net-next] Documentation: add pyyaml to requirements.txt | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 4 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Vegard Nossum Dec. 22, 2023, 1:36 p.m. UTC
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(+)

Comments

Jani Nikula Dec. 22, 2023, 5:40 p.m. UTC | #1
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
Simon Horman Dec. 24, 2023, 4:46 p.m. UTC | #2
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>
Breno Leitao Jan. 2, 2024, 11:51 a.m. UTC | #3
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?
patchwork-bot+netdevbpf@kernel.org Jan. 2, 2024, 1:50 p.m. UTC | #4
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!
diff mbox series

Patch

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