From 07624a7564fae225a3ae1c7d013663ffdbc6e688 Mon Sep 17 00:00:00 2001 From: doron zarhi Date: Tue, 30 May 2023 11:13:51 +0300 Subject: [PATCH] docs: fix pyproject.toml support --- docs/conf.py | 10 ++++++---- src/rpcclient/pyproject.toml | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 5ae2994d..bcc66772 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,8 +14,9 @@ # import os import sys -import importlib -sys.path.insert(0, os.path.abspath('../src/rpcclient')) +from pathlib import Path + +import toml # -- Project information ----------------------------------------------------- @@ -26,7 +27,8 @@ # The short X.Y version # The full version, including alpha/beta/rc tags -release = version = importlib.import_module('setup').VERSION + +release = version = toml.loads(Path('../src/rpcclient/pyproject.toml').read_text())['project']['version'] # -- General configuration --------------------------------------------------- @@ -60,7 +62,7 @@ # # 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 +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/src/rpcclient/pyproject.toml b/src/rpcclient/pyproject.toml index 2df880b5..5acd95f2 100644 --- a/src/rpcclient/pyproject.toml +++ b/src/rpcclient/pyproject.toml @@ -29,6 +29,7 @@ dynamic = ["dependencies"] [project.optional-dependencies] test = ["pytest"] +docs = ["toml", "myst_parser", "sphinx", "sphinx-rtd-theme"] [project.urls] "Homepage" = "https://github.com/doronz88/rpc-project"