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

Always say why something is out of date #11572

Merged
merged 12 commits into from Aug 10, 2023
Merged
3 changes: 3 additions & 0 deletions CHANGES
Expand Up @@ -37,6 +37,9 @@ Features added
Patch by Rouslan Korneychuk.
* #10938: doctest: Add :confval:`doctest_show_successes` option.
Patch by Trey Hunner.
* #11572: Improve ``debug`` logging of reasons why files are detected as out of
date.
Patch by Eric Larson.

Bugs fixed
----------
Expand Down
14 changes: 14 additions & 0 deletions sphinx/environment/__init__.py
Expand Up @@ -502,10 +502,24 @@ def get_outdated_files(self, config_changed: bool) -> tuple[set[str], set[str],
# this will do the right thing when dep is absolute too
deppath = path.join(self.srcdir, dep)
if not path.isfile(deppath):
logger.debug(
'[build target] changed %r missing dependency %r',
docname, deppath,
)
changed.add(docname)
break
depmtime = _last_modified_time(deppath)
if depmtime > mtime:
mtime_dt = datetime.fromtimestamp(
mtime / 1_000_000, tz=timezone.utc,
)
depmtime_dt = datetime.fromtimestamp(
depmtime / 1_000_000, tz=timezone.utc,
)
logger.debug(
'[build target] outdated %r from dependency %r: %s -> %s',
docname, deppath, mtime_dt, depmtime_dt,
)
changed.add(docname)
break
except OSError:
Expand Down