Skip to content

Partial build artifacts remain and exit code = 0 when mkdocstrings extension fails #338

@peytondmurray

Description

@peytondmurray

Bug description

I have a project that uses mkdocstrings for generating documentation. Currently (zensical==0.0.20) if the mkdocstrings extension fails, e.g.

$ zensical build --clean    
Build started
Error: ModuleNotFoundError: No module named 'mkdocstrings'
Error: ModuleNotFoundError: No module named 'mkdocstrings'
Error: ModuleNotFoundError: No module named 'mkdocstrings'
Build finished in 0.06s

$ echo $?
0

then the zensical output directory contains only a partially built site containing assets, with no pages:

├── assets
│   ├── images
│   │   └── favicon.png
│   ├── javascripts
│   │   ├── LICENSE
│   │   ├── bundle.8ffeb9c9.min.js
│   │   └── workers
│   │       └── search.e2d2d235.min.js
│   └── stylesheets
│       ├── classic
│       │   ├── main.9a39631f.min.css
│       │   └── palette.7dc9a0ad.min.css
│       └── modern
│           ├── main.d4922b3c.min.css
│           └── palette.dfe2e883.min.css
└── sitemap.xml

and the exit code is 0.

It would be nice if the exit code would be 1 (so that this is more obviously a failure, if for example it happens in CI). Maybe we should also have the output directory be cleaned up?

I should mention that I'd be happy to contribute the necessary changes if this sounds okay to the maintainers!

Related links

Reproduction

repro.tar.gz

Steps to reproduce

  1. In any fresh zensical docs config, enable the mkdocstrings plugin.
  2. Try to build without first installing mkdocstrings. The build will fail, but the exit code will be 0, and the site/ directory will only have the basic static assets.

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions