diff --git a/babel.cfg b/babel.cfg index a1339b8e7..6997238c3 100644 --- a/babel.cfg +++ b/babel.cfg @@ -8,3 +8,6 @@ encoding = utf-8 ignore_tags = script,style include_attrs = alt title summary placeholder + +# Extraction from Python files +[python: **.py] \ No newline at end of file diff --git a/docs/changelog.rst b/docs/changelog.rst index 9ef2299ae..d43d79b81 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -18,6 +18,7 @@ Deprecated ---------- * Support for sphinx's html4 writer is deprecated and will be removed in version 2.0 (#1091) +* Installing from git is deprecated; Sphinx will warn if not using an official version of the theme. Other Changes ------------- diff --git a/sphinx_rtd_theme/__init__.py b/sphinx_rtd_theme/__init__.py index bd967a329..23fdf4eb6 100644 --- a/sphinx_rtd_theme/__init__.py +++ b/sphinx_rtd_theme/__init__.py @@ -5,6 +5,8 @@ """ from os import path +import pkg_resources + from sys import version_info as python_version from sphinx import version_info as sphinx_version @@ -33,9 +35,18 @@ def config_initiated(app, config): # See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package def setup(app): + app.require_sphinx('1.6') + + # Warn if a prerelease version of the theme is used + parsed_version = pkg_resources.parse_version(__version__) + if parsed_version.is_prerelease: + logger.warning(_('You are using a pre-release version (%s) of sphinx-rtd-theme.'), __version__) + logger.warning(_('Use a stable release if you encounter problems.')) + logger.warning(_('See .')) + if python_version[0] < 3: logger.warning("Python 2 is deprecated with sphinx_rtd_theme, update to Python 3") - app.require_sphinx('1.6') + if sphinx_version <= (2, 0, 0): logger.warning("Sphinx 1.x is deprecated with sphinx_rtd_theme, update to Sphinx 2.x or greater") if not app.config.html_experimental_html5_writer: