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
25 changes: 25 additions & 0 deletions sphinx/environment/__init__.py
Expand Up @@ -502,10 +502,35 @@ 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:
try:
depmtime_dt = datetime.utcfromtimestamp(depmtime)
except ValueError: # e.g., year 53606865 is out of range
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
depmtime_str = str(depmtime)
else:
depmtime_str = str(depmtime_dt)
try:
mtime_dt = datetime.utcfromtimestamp(mtime)
except ValueError:
mtime_str = str(mtime)
else:
mtime_str = str(mtime_dt)
logger.debug(
'[build target] outdated %r '
'from dependency %r: %s -> %s',
docname,
deppath,
mtime_str,
depmtime_str,
)
changed.add(docname)
break
except OSError:
Expand Down