Python Version:
Python 3.9 using conda forge for most packages
Nikola Version:
Nikola v8.2.3 installed through pip
Operating System:
debian linux
Description:
With the current version of watchdog, events are generated when files are opened or closed. A number of files generate these events during the build process, which currently causes the built-in Nikola plugin "auto" and its associated command, to constantly rebuild after the first build is triggered.
The fix is simply to ignore those events inside the init.py of the "auto" plugin:
async def queue_rebuild(self, event) -> None:
"""Rebuild the site."""
# Move events have a dest_path, some editors like gedit use a
# move on larger save operations for write protection
event_path = event.dest_path if hasattr(event, 'dest_path') else event.src_path
if sys.platform == 'win32':
# Windows hidden files support
is_hidden = os.stat(event_path).st_file_attributes & stat.FILE_ATTRIBUTE_HIDDEN
else:
is_hidden = False
has_hidden_component = any(p.startswith('.') for p in event_path.split(os.sep))
if event.event_type in ['opened', 'closed']:
return
The last two lines here were added and seem to fix the issue. Tested by copying the plugin to a local folder.
Environment
Python Version: Python 3.9 using conda forge for most packages Nikola Version: Nikola v8.2.3 installed through pip
Operating System: debian linux
Description:
With the current version of watchdog, events are generated when files are opened or closed. A number of files generate these events during the build process, which currently causes the built-in Nikola plugin "auto" and its associated command, to constantly rebuild after the first build is triggered.
The fix is simply to ignore those events inside the init.py of the "auto" plugin:
The last two lines here were added and seem to fix the issue. Tested by copying the plugin to a local folder.