Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed automatic README generation #268

Open
SirAionTech opened this issue Aug 1, 2024 · 0 comments
Open

Failed automatic README generation #268

SirAionTech opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SirAionTech
Copy link
Contributor

SirAionTech commented Aug 1, 2024

Describe the bug

When pre-commit executes the hook oca-gen-addon-readme, the following occurs:

Generate addons README files from fragments..............................Failed
- hook id: oca-gen-addon-readme
- exit code: 1

Traceback (most recent call last):
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/bin/oca-gen-addon-readme", line 8, in <module>
    sys.exit(gen_addon_readme())
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/tools/gen_addon_readme.py", line 564, in gen_addon_readme
    gen_one_addon_readme(
  File "/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/tools/gen_addon_readme.py", line 376, in gen_one_addon_readme
    with open(template_filename, "r", encoding="utf8") as tf:
FileNotFoundError: [Errno 2] No such file or directory: '/home/simone/.cache/pre-commit/repovulpicmx/py_env-python3/lib/python3.10/site-packages/tools/gen_addon_readme.rst.jinja'

To Reproduce

Steps to reproduce the behavior:

  1. pipx install pre-commit
  2. git clone [email protected]:OCA/server-tools.git && cd server-tools
    Right now the repository is https://github.com/OCA/server-tools/tree/5577e14e231a7907c8869dcb638fd34178b6d8af
  3. pre-commit install
  4. Edit any file that generates the README (for instance attachment_queue/readme/DESCRIPTION.rst)
  5. git commit --all

Expected behavior
The README is generated

Additional context
There has been some discussion about this but I can't find it anymore, this is similar to acsone/setuptools-odoo#55.

I'm opening the issue here instead of https://github.com/OCA/maintainer-tools because installing the package as described there ($ pipx install oca-maintainers-tools@git+https://github.com/OCA/maintainer-tools.git) allows to generate the readme correctly, so the problem might be with how the template tells pre-commit to install the package.

@SirAionTech SirAionTech added the bug Something isn't working label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant