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

Add documentation testing #902

Merged
merged 4 commits into from Jul 8, 2022
Merged

Conversation

kurtmckee
Copy link
Contributor

@kurtmckee kurtmckee commented Jul 7, 2022

This introduces the following changes:

  • Sphinx is now a test requirement.
  • tox now tests HTML documentation builds. Warnings are escalated to errors.
  • GitHub CI now tests HTML documentation builds.
  • A single warning that occurs during HTML doc builds is now fixed.

Testing the documentation helps identify build errors before publication. In this case, the tests caught a rendering problem that is visible in the current documentation, which prevented Sphinx from substituting watchdog for |project_name| in a code example on the Installation page:

$ python -m pip install -U watchdog

# or to install the watchmedo utility:
$ python -m pip install -U |project_name|[watchmedo]

@BoboTiG
Copy link
Collaborator

BoboTiG commented Jul 8, 2022

Is it enough to fix #898 also?

@kurtmckee
Copy link
Contributor Author

I reviewed #898 but didn't tag it here because I don't think this PR addresses the root issue in that PR. However, this PR does lay the groundwork for addressing that, as well.

This PR tests HTML generation; #898 is about man page generation. I can augment this PR to try addressing that concern as well (in fact I need to update this PR to fix merge conflicts in tox.ini anyway).

I'll be able to circle back to this shortly.

@kurtmckee
Copy link
Contributor Author

kurtmckee commented Jul 8, 2022

The merge conflict is resolved.

I noticed that #898 is turning on nitpick mode (the -n option). When I enabled that for the HTML build I found that there is a class of error that I don't see a way to fix without rearchitecting the code itself. In particular, the module docstring for watchdog/observers/__init__.py includes relative :class: references to each of the system-specific observers. However, some of those modules will raise exceptions just be importing them on the wrong system, so Sphinx cannot consistently reach into those modules and link to the Observer classes in them.

As another example, there isn't a way to reference :class:`queue.Empty` because it's not part of the watchdog documentation -- it's a stdlib class. This could be converted to a simple monospace reference like ``queue.Empty``, or it could be converted to an external link to the Python stdlib.

I may be able to swing back around to start dealing with these classes of issues by simply removing or downgrading these types of references, but for now, this PR lays the groundwork to enable that future cleanup work.

@BoboTiG BoboTiG merged commit eb331de into gorakhargosh:master Jul 8, 2022
@kurtmckee kurtmckee deleted the add-doc-testing branch July 8, 2022 20:59
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 5, 2023
3.0.0
~~~~~

- Drop support for Python 3.6.
- ``watchdog`` is now PEP 561 compatible, and tested with ``mypy``
- Fix missing ``>`` in ``FileSystemEvent.__repr__()``  (`#980 <https://github.com/gorakhargosh/watchdog/pull/980>`__)
- [ci] Lots of improvements
- [inotify] Return from ``InotifyEmitter.queue_events()`` if not launched when thread is inactive (`#963 <https://github.com/gorakhargosh/watchdog/pull/963>`__)
- [tests] Stability improvements
- [utils] Remove handling of ``threading.Event.isSet`` spelling (`#962 <https://github.com/gorakhargosh/watchdog/pull/962>`__)
- [watchmedo] Fixed tricks YAML generation (`#965 <https://github.com/gorakhargosh/watchdog/pull/965>`__)
- Thanks to our beloved contributors: @kurtmckee, @altendky, @agroszer, @BoboTiG

2.3.1
~~~~~

- Run ``black`` on the entire source code
- Bundle the ``requirements-tests.txt`` file in the source distribution (`#939 <https://github.com/gorakhargosh/watchdog/pull/939>`__)
- [watchmedo] Exclude ``FileOpenedEvent`` events from ``AutoRestartTrick``, and ``ShellCommandTrick``, to restore watchdog < 2.3.0 behavior. A better solution should be found in the future. (`#949 <https://github.com/gorakhargosh/watchdog/pull/949>`__)
- [watchmedo] Log ``FileOpenedEvent``, and ``FileClosedEvent``, events in ``LoggerTrick``
- Thanks to our beloved contributors: @BoboTiG

2.3.0
~~~~~

- [inotify] Add support for ``IN_OPEN`` events: a ``FileOpenedEvent`` event will be fired (`#941 <https://github.com/gorakhargosh/watchdog/pull/941>`__)
- [watchmedo] Add optional event debouncing for ``auto-restart``, only restarting once if many events happen in quick succession (``--debounce-interval``) (`#940 <https://github.com/gorakhargosh/watchdog/pull/940>`__)
- [watchmedo] Exit gracefully on ``KeyboardInterrupt`` exception (Ctrl+C) (`#945 <https://github.com/gorakhargosh/watchdog/pull/945>`__)
- [watchmedo] Add option to not auto-restart the command after it exits (``--no-restart-on-command-exit``) (`#946 <https://github.com/gorakhargosh/watchdog/pull/946>`__)
- Thanks to our beloved contributors: @BoboTiG, @dstaple, @taleinat, @cernekj

2.2.1
~~~~~

- Enable ``mypy`` to discover type hints as specified in PEP 561 (`#933 <https://github.com/gorakhargosh/watchdog/pull/933>`__)
- [ci] Set the expected Python version when building release files
- [ci] Update actions versions in use
- [watchmedo] [regression] Fix usage of missing ``signal.SIGHUP`` attribute on non-Unix OSes (`#935 <https://github.com/gorakhargosh/watchdog/pull/935>`__)
- Thanks to our beloved contributors: @BoboTiG, @simon04, @piotrpdev

2.2.0
~~~~~

- [build] Wheels are now available for Python 3.11 (`#932 <https://github.com/gorakhargosh/watchdog/pull/932>`__)
- [documentation] HTML documentation builds are now tested for errors (`#902 <https://github.com/gorakhargosh/watchdog/pull/902>`__)
- [documentation] Fix typos here, and there (`#910 <https://github.com/gorakhargosh/watchdog/pull/910>`__)
- [fsevents2] The ``fsevents2`` observer is now deprecated (`#909 <https://github.com/gorakhargosh/watchdog/pull/909>`__)
- [tests] The error message returned by musl libc for error code ``-1`` is now allowed (`#923 <https://github.com/gorakhargosh/watchdog/pull/923>`__)
- [utils] Remove unnecessary code in ``dirsnapshot.py`` (`#930 <https://github.com/gorakhargosh/watchdog/pull/930>`__)
- [watchmedo] Handle shutdown events from ``SIGHUP`` (`#912 <https://github.com/gorakhargosh/watchdog/pull/912>`__)
- Thanks to our beloved contributors: @kurtmckee, @babymastodon, @QuantumEnergyE, @timgates42, @BoboTiG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants