Closed webknjaz closed 4 years ago
@ewjoachim mind taking a rough look? It's a workaround-ish thingy that addresses #1 in a non-granular way. I think I'll implement a better solution as a part of #8 sometime later, once I figure out how to make it right...
I'm off for a week, sorry :) Feel free to move on, I'll review later, even post-merge.
@ewjoachim ah, sure :) Have a great vacation! It's just a one-liner, though. I just wanted to make sure you see the current motivation.
This change addresses #1 only partially and as such it needs a follow-up.
The solution is suboptimal because it forces Sphinx to rebuild documents regardless of whether the news fragments have changed in any way.
OTOH, using
BuildEnvironment.note_dependency()
would be rather useless inTowncrierDraftEntriesDirective.run()
since it'd only make it depend on the existing fragment changes (that almost never happens) and would ignore any new fragments appearing on disk (because the only dependencies declared would be the ones that existed at the time of the first directive run).The next step would be implementing tracking of the fragments outside of the directive using 'env-get-outdated' combined with tracking of the documents that use the directive via
BuildEnvironment
custom attribute andEnvironmentCollector
for the Sphinx parallel mode support.Refs: