(self)
| 166 | ] |
| 167 | |
| 168 | def run(self) -> None: |
| 169 | if not color_terminal(): |
| 170 | nocolor() |
| 171 | if not self.verbose: # type: ignore |
| 172 | status_stream = StringIO() |
| 173 | else: |
| 174 | status_stream = sys.stdout # type: ignore |
| 175 | confoverrides = {} |
| 176 | if self.project: |
| 177 | confoverrides["project"] = self.project |
| 178 | if self.version: |
| 179 | confoverrides["version"] = self.version |
| 180 | if self.release: |
| 181 | confoverrides["release"] = self.release |
| 182 | if self.today: |
| 183 | confoverrides["today"] = self.today |
| 184 | if self.copyright: |
| 185 | confoverrides["copyright"] = self.copyright |
| 186 | if self.nitpicky: |
| 187 | confoverrides["nitpicky"] = self.nitpicky |
| 188 | |
| 189 | for builder, builder_target_dir in self.builder_target_dirs: |
| 190 | app = None |
| 191 | |
| 192 | try: |
| 193 | confdir = self.config_dir or self.source_dir |
| 194 | with patch_docutils(confdir), docutils_namespace(): |
| 195 | app = Sphinx( |
| 196 | self.source_dir, |
| 197 | self.config_dir, |
| 198 | builder_target_dir, |
| 199 | self.doctree_dir, |
| 200 | builder, |
| 201 | confoverrides, |
| 202 | status_stream, |
| 203 | freshenv=self.fresh_env, |
| 204 | warningiserror=self.warning_is_error, |
| 205 | verbosity=self.verbosity, |
| 206 | keep_going=self.keep_going, |
| 207 | ) |
| 208 | app.build(force_all=self.all_files) |
| 209 | if app.statuscode: |
| 210 | raise ExecError( |
| 211 | "caused by %s builder." % app.builder.name |
| 212 | ) |
| 213 | except Exception as exc: |
| 214 | handle_exception(app, self, exc, sys.stderr) |
| 215 | if not self.pdb: |
| 216 | raise SystemExit(1) from exc |
| 217 | |
| 218 | if not self.link_index: |
| 219 | continue |
| 220 | |
| 221 | src = app.config.root_doc + app.builder.out_suffix # type: ignore |
| 222 | dst = app.builder.get_outfilename("index") # type: ignore |
| 223 | os.symlink(src, dst) |
| 224 | |
| 225 |
no outgoing calls
no test coverage detected