diff --git a/docs/source/conf.py b/docs/source/conf.py index 01fb41c..519b3b9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,13 +18,15 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -parentdir = os.path.split(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))[0] -sys.path.insert(0,str(parentdir)) +import importlib.metadata -import pkg_resources -__version__ = pkg_resources.get_distribution('rwslib').version +_DISTRIBUTION_METADATA = importlib.metadata.metadata('rwslib') + +author = _DISTRIBUTION_METADATA['Author'] +project = _DISTRIBUTION_METADATA['Name'] +version = _DISTRIBUTION_METADATA['Version'] +copyright = _DISTRIBUTION_METADATA['Copyright'] -from rwslib import __copyright__ # -- General configuration ----------------------------------------------------- @@ -48,17 +50,11 @@ master_doc = 'index' # General information about the project. -project = u'rwslib' -copyright = __copyright__ # 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 = __version__ # The full version, including alpha/beta/rc tags. release = version