diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a5abab..3788c1f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,4 +55,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Parser error if click command contained `}` ([`#2040`](https://github.com/polybar/polybar/issues/2040)) -[Unreleased]: https://github.com/polybar/polybar/compare/3.5.2...HEAD +## [3.5.3] - 2020-12-23 +### Build +- Don't use `git` when building documentation ([`#2311`](https://github.com/polybar/polybar/issues/2309)) +### Fixed +- Empty color values are no longer treated as invalid and no longer produce an error. + +[Unreleased]: https://github.com/polybar/polybar/compare/3.5.3...HEAD +[3.5.3]: https://github.com/polybar/polybar/releases/tag/3.5.3 diff --git a/doc/conf.py b/doc/conf.py index a68eaa55..94d10cbe 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,11 +13,25 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # import os +from pathlib import Path import datetime -import subprocess -from docutils.nodes import Node from typing import List +from docutils.nodes import Node from sphinx.domains.changeset import VersionChange +import packaging.version + +def get_version(root_path): + """ + Reads the polybar version from the version.txt at the root of the repo. + """ + path = Path(root_path) / "version.txt" + with open(path, "r") as f: + for line in f.readlines(): + if not line.startswith("#"): + return packaging.version.parse(line) + + raise RuntimeError("No version found in {}".format(path)) + # -- Project information ----------------------------------------------------- @@ -50,6 +64,11 @@ else: # build folder. doc_path = '@doc_path@' +# The version from the version.txt file. Since we are not always first +# configured by cmake, we don't necessarily have access to the current version +# number +version_txt = get_version(Path(doc_path).absolute().parent) + # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -213,12 +232,9 @@ class VersionDirective(VersionChange): deprecated and adds an unreleased tag to versions that are not yet released """ def run(self) -> List[Node]: - # If the tag exists 'git rev-parse' will succeed and otherwise fail - completed = subprocess.run(["git", "rev-parse", self.arguments[0]], - stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, cwd=doc_path, - check=False) + directive_version = packaging.version.parse(self.arguments[0]) - if completed.returncode != 0: + if directive_version > version_txt: self.arguments[0] += " (unreleased)" return super().run() diff --git a/src/components/config.cpp b/src/components/config.cpp index a94aaee2..5be2c223 100644 --- a/src/components/config.cpp +++ b/src/components/config.cpp @@ -225,6 +225,10 @@ chrono::duration config::convert(string&& value) const { template <> rgba config::convert(string&& value) const { + if (value.empty()) { + return rgba{}; + } + rgba ret{value}; if (!ret.has_color()) { diff --git a/version.txt b/version.txt index 2bd23581..af8cdbfd 100644 --- a/version.txt +++ b/version.txt @@ -1,4 +1,4 @@ # Polybar version information # Update this on every release # This is used to create the version string if a git repo is not available -3.5.2 +3.5.3