diff --git a/docs/conf.py b/docs/conf.py index f999e79..ddde83b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,22 +42,20 @@ # built documents. # -with open("../version.py") as f: - code = compile(f.read(), "version.py", 'exec') - version_dict = {} - exec(code, {}, version_dict) - # The short X.Y version. - version = version_dict['version'] - # The full version, including alpha/beta/rc tags. - release = version_dict['release'] - - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None +# with open("../version.py") as f: +# code = compile(f.read(), "version.py", 'exec') +# version_dict = {} +# exec(code, {}, version_dict) +# # The short X.Y version. +# version = version_dict['version'] +# # The full version, including alpha/beta/rc tags. +# release = version_dict['release'] + +import xmltodict +with open("../grain.xml") as fx: + grain_dict = xmltodict.parse(fx.read()) +version = grain_dict['salt-grain']['version'] +release = version # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/version.py b/version.py deleted file mode 100644 index 5eb152e..0000000 --- a/version.py +++ /dev/null @@ -1,7 +0,0 @@ -# The short X.Y version. -version = '0.0.1' -# The full version, including alpha/beta/rc tags. -release = version + "" - -if __name__ == '__main__': - print('NIST SOEN PDK v' + version) \ No newline at end of file