def METHOD_NAME(self, clean=False):
    """Build the Sphinx project.
    :param bool clean:
        If True a clean build will be created.
    :raise ValueError:
        Raised if the project and/or package does not exist.
    :raise SphinxError:
        Raised if an error occured during the build.
    """
    self.validate_project_and_package()
    if clean:
        self.project_build_dir.rmtree_p()
    add_to_path = self.package_dir not in sys.path
    if add_to_path:
        sys.path.append(str(self.package_dir.parent))
    from sphinx import main
    argv = [
        '',  # Will be skipped.
        str(self.project_source_dir),
        str(self.project_build_dir),
    ]
    # Hacky, but required, because sphinx is reading sys.argv even if you
    # pass a list to main()
    old_argv = sys.argv
    sys.argv = argv
    try:
        main(sys.argv)
    except SystemExit as e:
        if e.code != 0:
            raise SphinxError
    finally:
        sys.argv = old_argv
        if add_to_path:
            sys.path.remove(str(self.package_dir.parent))