Skip to content

Commit f29d36c

Browse files
committed
Document Sphinx usage
1 parent 8664843 commit f29d36c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/common_issues/sphinx_usage.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,22 @@ To determine current project version in Sphinx with the following config:
2727
# The full version, including alpha/beta/rc tags
2828
release = "???"
2929
30-
Add these lines:
30+
Use ``get_version`` function:
3131

3232
.. code-block:: python
3333
:caption: docs/conf.py
3434
35+
# same as above
36+
import os
37+
import sys
38+
from pathlib import Path
39+
40+
PROJECT_ROOT_DIR = Path(__file__).parent.parent.resolve()
41+
42+
sys.path.insert(0, os.fspath(PROJECT_ROOT_DIR))
43+
44+
# add lines below
45+
3546
from setuptools_git_versioning import get_version
3647
3748
# to resolve pyproject.toml, setup.py or version_file, we need to pass package root explicitly,

0 commit comments

Comments
 (0)