python-holidays icon indicating copy to clipboard operation
python-holidays copied to clipboard

When I followed the contributor guildline,"make pre-commit" ourred an error"rstcheck Failed"

Open peter-ni-noob opened this issue 2 years ago • 6 comments

env:python 3.9 linux ubuntun rstcheck.................................................................Failed

  • hook id: rstcheck
  • exit code: 1

WARNING:rstcheck_core.checker:An AttributeError error occured. This is most probably due to a code block directive (code/code-block/sourcecode) without a specified language. This may result in a false negative for source: 'docs/source/contributing.rst'. The reason can also be another directive. For more information see the FAQ (https://rstcheck-core.rtfd.io/en/latest/faq) or the corresponding github issue: https://github.com/rstcheck/rstcheck-core/issues/3. WARNING:rstcheck_core.checker:An AttributeError error occured. This is most probably due to a code block directive (code/code-block/sourcecode) without a specified language. This may result in a false negative for source: 'docs/source/changelog.rst'. The reason can also be another directive. For more information see the FAQ (https://rstcheck-core.rtfd.io/en/latest/faq) or the corresponding github issue: https://github.com/rstcheck/rstcheck-core/issues/3. WARNING:rstcheck_core.checker:An AttributeError error occured. This is most probably due to a code block directive (code/code-block/sourcecode) without a specified language. This may result in a false negative for source: 'docs/source/index.rst'. The reason can also be another directive. For more information see the FAQ (https://rstcheck-core.rtfd.io/en/latest/faq) or the corresponding github issue: https://github.com/rstcheck/rstcheck-core/issues/3. docs/source/api.rst:4: (INFO/1) No directive entry for "automodule" in module "docutils.parsers.rst.languages.en". docs/source/api.rst:4: (ERROR/3) Unknown directive type "automodule". docs/source/api.rst:5: (INFO/1) No directive entry for "automodule" in module "docutils.parsers.rst.languages.en". docs/source/api.rst:5: (ERROR/3) Unknown directive type "automodule". docs/source/modules.rst:4: (INFO/1) No directive entry for "autosummary" in module "docutils.parsers.rst.languages.en". docs/source/modules.rst:4: (ERROR/3) Unknown directive type "autosummary". Error! Issues detected.

peter-ni-noob avatar Dec 22 '23 03:12 peter-ni-noob

as usual ,I didn't change anything.

peter-ni-noob avatar Dec 22 '23 04:12 peter-ni-noob

@peter-ni-noob Please ensure you've pip install -r insert_filename_here.txt everything in the python-holidays\requirements folder.

I'm still determining how to proceed if that doesn't work since I've only coded with WSL2 on Windows, but @arkid15r likely has the answer here.

PPsyrius avatar Dec 22 '23 07:12 PPsyrius

Thank you for your help,I apply "make setup" to install this project,and I saw pip install --upgrade pip pip install --requirement requirements/dev.txt pip install --requirement requirements/docs.txt pip install --requirement requirements/runtime.txt pip install --requirement requirements/tests.txt in MakeFile,so I have installed everything in the python-holidays\requirements. I think the cause of the error is in docs/source/api.rst:4: (ERROR/3) Unknown directive type "automodule", but I dont really know rstcheck/(ㄒoㄒ)/~~.

peter-ni-noob avatar Dec 22 '23 12:12 peter-ni-noob

I was able to reproduce this with python3.9 I guess the best work around now would be commenting related pre-commit configuration block out.

You might also need to run make package after make setup if you see importlib_metadata.PackageNotFoundError: No package metadata was found for holidays error.

Thanks for reporting this!

arkid15r avatar Dec 22 '23 18:12 arkid15r

I just commented related pre-commit configuration block out,and all passed. the this issue will be closed.

peter-ni-noob avatar Dec 26 '23 12:12 peter-ni-noob

Yeah, that's a workaround for now. I'd prefer to not close the issue yet if you don't mind. At least until we look deeper into the problem.

arkid15r avatar Dec 26 '23 17:12 arkid15r