Skip to content

Commit

Permalink
Try to fix ReadTheDocs Sphinx build that is having problems getting t…
Browse files Browse the repository at this point in the history
…he version from setuptools-scm
  • Loading branch information
tleonhardt committed Oct 23, 2024
1 parent 54219d4 commit 12e9596
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ formats: all
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
11 changes: 5 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import sys
from importlib.metadata import version as get_version
from os.path import abspath, dirname

# Make sure we get the version of this copy of cmd2
Expand All @@ -27,8 +28,6 @@
# Import for custom theme from Read the Docs
import sphinx_rtd_theme

import cmd2

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -66,10 +65,10 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# version will look like x.y.z
version = cmd2.__version__
# release will look like x.y
release = '.'.join(version.split('.')[:2])
# release will look like x.y.z
release: str = get_version("cmd2")
# for example take major/minor
version: str = ".".join(release.split('.')[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

pyperclip
setuptools
setuptools-scm<8
setuptools-scm
Sphinx
sphinx-autobuild
sphinx-rtd-theme
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
'ruff',
'twine',
],
'docs': [
'setuptools',
'setuptools_scm',
'sphinx',
'sphinx-rtd-theme',
'sphinx-autobuild',
],
'validate': [
'mypy',
'ruff',
Expand Down

0 comments on commit 12e9596

Please sign in to comment.