sphinx-contrib / sphinxcontrib-towncrier

An RST directive for injecting a Towncrier-generated changelog draft containing fragments for the unreleased (next) project version. Demo: https://ansible-pylibssh.rtfd.io/changelog. Docs: https://sphinxcontrib-towncrier.rtfd.io
https://pypi.org/p/sphinxcontrib-towncrier
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Error in get_outdated_docs when framents dir missing #84

Open jaraco opened 1 year ago

jaraco commented 1 year ago

Towncrier runs fine if the newsfragments directory doesn't exist.

This plugin will fail if the directory doesn't exist with this error:

Extension error (sphinxcontrib.towncrier.ext):
Handler <bound method TowncrierDraftEntriesEnvironmentCollector.get_outdated_docs of <sphinxcontrib.towncrier.ext.TowncrierDraftEntriesEnvironmentCollector object at 0x1075c3990>> for event 'env-get-outdated' threw an exception (exception: Failed to list the news fragment files.
FileNotFoundError: [Errno 2] No such file or directory: '../newsfragments/'
)

This plugin should honor the degenerate newsfragments including no directory, same as towncrier.

webknjaz commented 1 year ago

Fair enough. This needs to be fixed.

adkbbx commented 1 year ago

Hey there, I'm intersted in contributing to this issue do let me know how I can help

webknjaz commented 1 year ago

@adkbbx just need to figure out where to suppress the exception and the side effects of doing so.

jaraco commented 1 year ago

Apologies for not linking to a project that has this issue. To reproduce, you'll want to set up a sphinx docs using get_outdated_docs and then build the docs. Here's one project that's using that setting. The rest of the settings can probably be left at the defaults. Let me know if that's not enough to reproduce the issue.