-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-46368: Add support for building an LTD documentation site #38
Changes from all commits
f4bfef0
32b658a
e9caaf4
9379416
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build and upload documentation | ||
|
||
"on": | ||
merge_group: {} | ||
pull_request: {} | ||
push: | ||
branches-ignore: | ||
# These should always correspond to pull requests, so ignore them for | ||
# the push trigger and let them be triggered by the pull_request | ||
# trigger, avoiding running the workflow twice. This is a minor | ||
# optimization so there's no need to ensure this is comprehensive. | ||
- "dependabot/**" | ||
- "gh-readonly-queue/**" | ||
- "renovate/**" | ||
- "tickets/**" | ||
- "u/**" | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
docs: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Install Graphviz | ||
run: sudo apt-get install graphviz | ||
|
||
- name: Run tox | ||
uses: lsst-sqre/run-tox@v1 | ||
with: | ||
python-version: "3.11" | ||
tox-envs: "docs" | ||
# Add docs-linkcheck when the docs and PyPI package are published | ||
# tox-envs: "docs,docs-linkcheck" | ||
tox-plugins: tox-uv | ||
|
||
# Only attempt documentation uploads for tagged releases and pull | ||
# requests from ticket branches in the same repository. This avoids | ||
# version clutter in the docs and failures when a PR doesn't have access | ||
# to secrets. | ||
- name: Upload to LSST the Docs | ||
uses: lsst-sqre/ltd-upload@v1 | ||
with: | ||
project: "consdb" | ||
dir: "doc/_build/html" | ||
username: ${{ secrets.LTD_USERNAME }} | ||
password: ${{ secrets.LTD_PASSWORD }} | ||
if: > | ||
github.event_name != 'merge_group' | ||
&& (github.event_name != 'pull_request' | ||
|| startsWith(github.head_ref, 'tickets/')) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
"""Sphinx configuration file for an LSST stack package. | ||
|
||
This configuration only affects single-package Sphinx documentation builds. | ||
For more information, see: | ||
https://developer.lsst.io/stack/building-single-package-docs.html | ||
This configuration only affects single-package Sphinx documenation builds. | ||
""" | ||
|
||
from documenteer.conf.pipelinespkg import * # type: ignore # noqa | ||
|
||
project = "consdb" | ||
html_theme_options["logotext"] = project # type: ignore # noqa | ||
html_title = project | ||
html_short_title = project | ||
from documenteer.conf.guide import * # noqa: F403,F401 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[project] | ||
title = "ConsDB" | ||
copyright = "GNU General Public License v3" | ||
|
||
[project.python] | ||
package = "consdb" | ||
|
||
[sphinx] | ||
disable_primary_sidebars = [ | ||
"index" | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,16 @@ | ||
.. py:currentmodule:: lsst.consdb | ||
:html_theme.sidebar_secondary.remove: | ||
|
||
.. _lsst.consdb: | ||
|
||
########### | ||
lsst.consdb | ||
########### | ||
|
||
.. Paragraph that describes what this Python module does and links to related modules and frameworks. | ||
|
||
.. .. _lsst.consdb-using: | ||
|
||
.. Using lsst.consdb | ||
.. ================= | ||
|
||
.. toctree linking to topics related to using the module's APIs. | ||
|
||
.. .. toctree:: | ||
.. :maxdepth: 1 | ||
|
||
.. _lsst.consdb-contributing: | ||
|
||
Contributing | ||
============ | ||
ConsDB | ||
====== | ||
|
||
``lsst.consdb`` is developed at https://github.com/lsst-dm/consdb. | ||
You can find Jira issues for this module under the `consdb <https://jira.lsstcorp.org/issues/?jql=project%20%3D%20DM%20AND%20component%20%3D%20consdb>`_ component. | ||
|
||
.. If there are topics related to developing this module (rather than using it), link to this from a toctree placed here. | ||
|
||
.. .. toctree:: | ||
.. :maxdepth: 1 | ||
|
||
.. .. _lsst.consdb-scripts: | ||
|
||
.. Script reference | ||
.. ================ | ||
|
||
.. .. TODO: Add an item to this toctree for each script reference topic in the scripts subdirectory. | ||
|
||
.. .. toctree:: | ||
.. :maxdepth: 1 | ||
|
||
.. .. _lsst.consdb-pyapi: | ||
############# | ||
Documentation | ||
############# | ||
|
||
Python API reference | ||
==================== | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
.. automodapi:: lsst.consdb | ||
:no-main-docstr: | ||
:no-inheritance-diagram: | ||
user-guide/index |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
########## | ||
User Guide | ||
########## | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
installation |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
############ | ||
Installation | ||
############ | ||
|
||
installation instructions go here |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[tox] | ||
envlist = py,coverage-report,typing,lint,docs,docs-linkcheck | ||
isolated_build = True | ||
|
||
[testenv] | ||
description = Run pytest against {envname}. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little worried that the testing here is going to conflict with how we want/need to do testing in per-component subdirectories. Can we leave this out for a docs-only commit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless you plan to use I would suggest we leave this in as it is basically working boilerplate that I copied from another project so that |
||
extras = | ||
dev | ||
|
||
[testenv:py] | ||
description = Run pytest | ||
commands = | ||
coverage run -m pytest {posargs} | ||
|
||
[testenv:coverage-report] | ||
description = Compile coverage from each test run. | ||
skip_install = true | ||
deps = coverage[toml]>=5.0.2 | ||
depends = | ||
py | ||
commands = | ||
coverage combine | ||
coverage report | ||
|
||
[testenv:typing] | ||
description = Run mypy. | ||
commands = | ||
mypy src/example tests | ||
|
||
[testenv:lint] | ||
description = Lint codebase by running pre-commit (Black, isort, Flake8). | ||
skip_install = true | ||
deps = | ||
pre-commit | ||
commands = pre-commit run --all-files | ||
|
||
[testenv:docs] | ||
description = Build documentation (HTML) with Sphinx. | ||
commands = | ||
sphinx-build --keep-going -n -W -T -b html -d {envtmpdir}/doctrees doc doc/_build/html | ||
|
||
[testenv:docs-linkcheck] | ||
description = Check links in the documentation. | ||
allowlist_externals = | ||
make | ||
commands = | ||
make linkcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the DM side we usually do
branches: main
rather than try to exclude, but this is fine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copied from a SQuaRE template. I have no preference, and this can be changed if you like. The rules defined here are just an optimization so workflows aren't run more than once unnecessarily.