Skip to content

Commit

Permalink
Merge pull request #907 from samdoran/backport/894/release_2.1
Browse files Browse the repository at this point in the history
[release_2.1] Set version in docs configuration (#894)

Backport of #894 for Ansible Runner 2.1.

Reviewed-by: David Shrewsbury <None>
Reviewed-by: None <None>
  • Loading branch information
ansible-zuul[bot] authored Nov 4, 2021
2 parents c0db181 + c02072c commit c73f478
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ sphinx:

python:
install:
# Installation is needed in order to get the version string
- method: pip
path: .

- requirements: docs/requirements.txt
19 changes: 12 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@
# 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.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('./'))
import datetime

from ansible_runner.__main__ import VERSION


# -- Project information -----------------------------------------------------

def _get_version():
version_parts = VERSION.split('.', 3)[:3]

return '.'.join(version_parts)


project = 'ansible-runner'
copyright = '2018, Red Hat Ansible'
author = 'Red Hat Ansible'
copyright = f'2018-{datetime.datetime.today().year}, Red Hat, Inc'
author = 'Red Hat, Inc.'
version = _get_version()

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

Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ commands=
[testenv:docs]
description = Build documentation
deps = -r{toxinidir}/docs/requirements.txt
skip_install = True
commands =
sphinx-build -T -E -W --keep-going {tty:--color} -j auto -d docs/build/doctrees -b html docs docs/build/html

0 comments on commit c73f478

Please sign in to comment.