Skip to content

Commit 8dc95ce

Browse files
committed
Update build conf.py
1 parent fbef88e commit 8dc95ce

File tree

2 files changed

+61
-5
lines changed

2 files changed

+61
-5
lines changed

.github/workflows/docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- docs_build
8+
release:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
shell: bash -l {0}
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
activate-environment: build
24+
auto-update-conda: true
25+
26+
- name: install requirements
27+
run: >-
28+
conda install -n build -c conda-forge
29+
--file requirements/build.txt
30+
--file requirements/run.txt
31+
--file requirements/docs.txt
32+
--quiet --yes
33+
34+
- name: install the package
35+
run: python -m pip install . --no-deps
36+
37+
- name: build documents
38+
run: make -C doc/manual html

doc/source/conf.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,44 @@
1313
import sys
1414
import os
1515
sys.path.insert(0, os.path.abspath('../..'))
16+
sys.path.insert(0, os.path.abspath('../../src'))
1617

1718

1819
# -- Project information -----------------------------------------------------
1920

2021
project = 'PDFmorph'
22+
project_full = 'diffpy.pdfmorph'
2123
copyright = '2009-2019, Trustees of Columbia University in the City of New York, all rights reserved.'
2224
author = 'Chris Farrow, Christopher J. Wright, Pavol Juhás, Chia-Hao (Timothy) Liu, S. Matthew Román, Simon J.L. Billinge'
2325

2426
# The full version, including alpha/beta/rc tags
25-
release = '0.1.0'
27+
from importlib.metadata import version
28+
fullversion = version(project_full)
29+
# The short X.Y version.
30+
version = ''.join(fullversion.split('.post')[:1])
31+
# The full version, including alpha/beta/rc tags.
32+
release = fullversion
33+
34+
# Get current date for copyright
35+
import time
36+
today = time.strftime('%B %d, %Y', time.localtime())
37+
year = today.split()[-1]
38+
copyright = copyright.replace('%Y', year)
2639

2740

2841
# -- General configuration ---------------------------------------------------
2942

3043
# Add any Sphinx extension module names here, as strings. They can be
3144
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3245
# ones.
33-
import sphinx_rtd_theme
34-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon',
35-
'sphinx.ext.todo', 'sphinx.ext.viewcode',
36-
'sphinx.ext.intersphinx', 'm2r']
46+
extensions = ['sphinx.ext.autodoc',
47+
'sphinx.ext.napoleon',
48+
'sphinx.ext.todo',
49+
'sphinx.ext.viewcode',
50+
'sphinx.ext.intersphinx',
51+
'sphinx_rtd_theme',
52+
'm2r',
53+
]
3754
napoleon_google_docstring = False
3855
napoleon_use_param = False
3956
napoleon_use_ivar = False
@@ -61,6 +78,7 @@
6178

6279
# The theme to use for HTML and HTML Help pages. See the documentation for
6380
# a list of builtin themes.
81+
import sphinx_rtd_theme
6482
html_theme = 'sphinx_rtd_theme'
6583
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
6684

0 commit comments

Comments
 (0)