ansible / ansible-documentation

Ansible community documentation
https://docs.ansible.com/
GNU General Public License v3.0
83 stars 488 forks source link

Antsibull warnings related to changelogs and README.rst #43

Open oraNod opened 1 year ago

oraNod commented 1 year ago

Docs build contains the following warns:

WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: /tmp/build-env-ixwpz4p8/lib64/python3.11/site-packages/setuptools/config/expand.py:132: SetuptoolsWarning: File '/home/dnaro/git/ansible-documentation/README.rst' cannot be found
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: return '\n'.join(
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/CHANGELOG*.rst'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/changelog.yaml'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: /tmp/build-env-ixwpz4p8/lib64/python3.11/site-packages/setuptools/config/expand.py:132: SetuptoolsWarning: File '/tmp/.tmp-ansible-pep517-sayg8faj/src/README.rst' cannot be found
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: return '\n'.join(
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/CHANGELOG*.rst'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/changelog.yaml'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

These warns occur because the changelogs folder and the README.rst file are not present after running bin/clone-core.py to clone relevant bits from Ansible core.

oraNod commented 1 year ago

Taken from this comment: https://github.com/ansible/ansible-documentation/pull/21#issuecomment-1602997366

If these warnings are just noise, we may be better off ignoring them and instead focusing on removing the need to build ansible-core from a clone during the docs build. Otherwise this repo becomes more dependent (not less) on the structure of the ansible repository -- which will make it more likely that moving/changing things in the ansible repo will break the docs build.

To resolve this issue we should further decouple the docs build from ansible-core, so that it doesn't require building it from source using a partial clone of the repo.

felixfontein commented 1 year ago

What antsibull does is run python -m build --sdist --outdir <dist_dir> <source_dir> for the <source_dir> passed as --ansible-core-source. If for some reason the source directory isn't a checkout of ansible/ansible but some random subset, the build scripts of ansible-core itself will produce these warnings/errors. antsibull-docs only passes them on to the user.

felixfontein commented 1 year ago

So these warnings come from ansible/ansible itself, not from antsibull-docs.

felixfontein commented 1 year ago

If ansible, ansible-galaxy, and ansible-doc from that partial checkout are available on $PATH, using --ansible-core-source is no longer necessary by passing --use-installed-ansible-core instead of --ansible-core-source /path/to/checkout.

(https://github.com/ansible/ansible-documentation/blob/devel/hacking/build_library/build_ansible/command_plugins/docs_build.py#L136 and https://github.com/ansible/ansible-documentation/blob/devel/hacking/build_library/build_ansible/command_plugins/docs_build.py#L189 would need to be modified.)

oraNod commented 1 year ago

Thanks for investigating @felixfontein I'll try and take a look at this today and play around with it.

Just to note we have an issue to go through that hacking folder, #35 so this could maybe be our first foray into rejigging things for the new repo.

mattclay commented 1 year ago

@felixfontein Can antsibull be updated to build the sdist from a clone in a temporary directory instead of trying to pull the ansible source into the current tree?

mattclay commented 1 year ago

Re-reading what @felixfontein wrote above, it sounds like this wouldn't require a change in antsibull. Instead, we'd change docs/bin/clone-core.py to put the clone of ansible into a subdirectory (perhaps called ansible-core) and then update https://github.com/ansible/ansible-documentation/blob/devel/hacking/build_library/build_ansible/command_plugins/docs_build.py to pass that directory as --ansible-core-source instead of the current tree.

@felixfontein Does that sound about right to you?

felixfontein commented 1 year ago

@mattclay yes, that sounds about right! Having it in a different place probably also need adjustments to other files in hacking/build_library/build_ansible/ though, like dump_keywords.py and generate_man.py, which dynamically import Python files from ansible-core.