Skip to content

Commit

Permalink
docs: Hide conftest at any level (#170)
Browse files Browse the repository at this point in the history
Now that `conftest` to test examples can live at a higher level in the
directory structure it is better to ignore any `conftest` module, even
if there is a slim chance that anyone could have a `conftest` module
that should be part of the public interface (which will conflict with
`pytest` anyway).
  • Loading branch information
llucax authored Nov 2, 2023
2 parents a946e61 + 4032da7 commit b8ee525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ If upgrading `pylint` you might get a few new check errors.
### Cookiecutter template

There is no need to regenerate any templates with this release.

## Bug Fixes

- `mkdocs`: The `conftest` module is now properly hidden from the documentation again.
2 changes: 1 addition & 1 deletion src/frequenz/repo/config/mkdocs/api_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _is_internal(path_parts: Tuple[str, ...]) -> bool:
def with_underscore_not_init(part: str) -> bool:
return part.startswith("_") and part != "__init__"

is_conftest = len(path_parts) == 1 and path_parts[0] == "conftest"
is_conftest = path_parts[-1] == "conftest" if path_parts else False

return is_conftest or any(p for p in path_parts if with_underscore_not_init(p))

Expand Down

0 comments on commit b8ee525

Please sign in to comment.