diff --git a/docs/conf.py b/docs/conf.py index 0946f30e..b3242767 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,11 +59,15 @@ author = 'Wenzel Jakob' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -# -# The short X.Y version. -version = '2.5' + +# Read the listed version +with open("../pybind11/_version.py") as f: + code = compile(f.read(), "../pybind11/_version.py", "exec") +loc = {} +exec(code, loc) + # The full version, including alpha/beta/rc tags. -release = '2.5.dev1' +version = loc["__version__"] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -145,7 +149,7 @@ else: #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". +# " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. diff --git a/setup.py b/setup.py index c9ba77d6..3a032798 100644 --- a/setup.py +++ b/setup.py @@ -35,9 +35,9 @@ to_src = ( # Read the listed version with open("pybind11/_version.py") as f: code = compile(f.read(), "pybind11/_version.py", "exec") - loc = {} - exec(code, loc) - version = loc["__version__"] +loc = {} +exec(code, loc) +version = loc["__version__"] # Verify that the version matches the one in C++ with open("include/pybind11/detail/common.h") as f: