Merge ~jugmac00/lpci:start-sphinx-documentation into lpci:main

Proposed by Jürgen Gmach
Status: Merged
Merged at revision: e42729bc96c934e611f8779eea4a656f37857f92
Proposed branch: ~jugmac00/lpci:start-sphinx-documentation
Merge into: lpci:main
Diff against target: 205 lines (+137/-8)
8 files modified
.gitignore (+1/-0)
CONTRIBUTING.rst (+19/-0)
README.rst (+0/-8)
docs/CONTRIBUTING.rst (+1/-0)
docs/conf.py (+60/-0)
docs/index.rst (+48/-0)
setup.cfg (+2/-0)
tox.ini (+6/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+412854@code.launchpad.net

Commit message

Start sphinx documentation

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

The readthedocs project can only be created/run successfully after this MP got merged.

Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 94df19c..903613f 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -6,3 +6,4 @@ __pycache__
6 .coverage
7 htmlcov
8 build/
9+docs/_build/
10diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
11new file mode 100644
12index 0000000..ead4dcd
13--- /dev/null
14+++ b/CONTRIBUTING.rst
15@@ -0,0 +1,19 @@
16+Developing
17+==========
18+
19+To run this project's tests, use `tox <https://tox.readthedocs.io/en/latest/>`_.
20+
21+To update the `project's documentation
22+<https://lpcraft.readthedocs.io/en/latest/>`_ you need to trigger a manual
23+build on the project's dashboard on https://readthedocs.org.
24+
25+If you need to modify ``requirements.in``, run ``tox -e pip-compile``
26+afterwards to regenerate ``requirements.txt``.
27+
28+
29+Getting help
30+------------
31+
32+If you find bugs in this package, you can report them here:
33+
34+ https://launchpad.net/lpcraft
35diff --git a/README.rst b/README.rst
36index 1e4f4e2..aa700b3 100644
37--- a/README.rst
38+++ b/README.rst
39@@ -25,11 +25,3 @@ although it won't do very much useful yet.
40
41 To save the output from a job, use ``lpcraft run --output
42 /path/to/output/directory``.
43-
44-Developing
45-==========
46-
47-Run tests using ``tox``.
48-
49-If you need to modify ``requirements.in``, run ``tox -e pip-compile``
50-afterwards.
51diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst
52new file mode 120000
53index 0000000..798f2aa
54--- /dev/null
55+++ b/docs/CONTRIBUTING.rst
56@@ -0,0 +1 @@
57+../CONTRIBUTING.rst
58\ No newline at end of file
59diff --git a/docs/conf.py b/docs/conf.py
60new file mode 100644
61index 0000000..7943bc6
62--- /dev/null
63+++ b/docs/conf.py
64@@ -0,0 +1,60 @@
65+# Configuration file for the Sphinx documentation builder.
66+#
67+# This file only contains a selection of the most common options. For a full
68+# list see the documentation:
69+# https://www.sphinx-doc.org/en/master/usage/configuration.html
70+
71+# -- Path setup --------------------------------------------------------------
72+
73+# If extensions (or modules to document with autodoc) are in another directory,
74+# add these directories to sys.path here. If the directory is relative to the
75+# documentation root, use os.path.abspath to make it absolute, like shown here.
76+#
77+# import os
78+# import sys
79+# sys.path.insert(0, os.path.abspath('.'))
80+
81+
82+# -- Project information -----------------------------------------------------
83+
84+project = "lpcraft"
85+copyright = "2021, Canonical Ltd"
86+
87+
88+# -- General configuration ---------------------------------------------------
89+
90+# Add any Sphinx extension module names here, as strings. They can be
91+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
92+# ones.
93+extensions = []
94+
95+# Add any paths that contain templates here, relative to this directory.
96+templates_path = ["_templates"]
97+
98+# List of patterns, relative to source directory, that match files and
99+# directories to ignore when looking for source files.
100+# This pattern also affects html_static_path and html_extra_path.
101+exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
102+
103+
104+# -- Options for HTML output -------------------------------------------------
105+
106+# The theme to use for HTML and HTML Help pages. See the documentation for
107+# a list of builtin themes.
108+#
109+html_theme = "alabaster"
110+
111+# Add any paths that contain custom static files (such as style sheets) here,
112+# relative to this directory. They are copied after the builtin static files,
113+# so a file named "default.css" will overwrite the builtin "default.css".
114+html_static_path = ["_static"]
115+
116+# This is required for the alabaster theme
117+# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
118+html_sidebars = {
119+ "**": [
120+ "globaltoc.html",
121+ "relations.html", # needs 'show_related': True theme option to display
122+ "searchbox.html",
123+ ]
124+}
125diff --git a/docs/index.rst b/docs/index.rst
126new file mode 100644
127index 0000000..48860fc
128--- /dev/null
129+++ b/docs/index.rst
130@@ -0,0 +1,48 @@
131+.. lpcraft documentation master file, created by
132+ sphinx-quickstart on Tue Dec 7 12:44:23 2021.
133+ You can adapt this file completely to your liking, but it should at least
134+ contain the root `toctree` directive.
135+
136+lpcraft
137+=======
138+
139+``lpcraft`` is a runner for continuous integration jobs in Launchpad. It is
140+intended mainly for use in Launchpad builders, but can also be installed and
141+used locally on branches with a ``.launchpad.yaml`` file.
142+
143+This project owes a considerable amount to `snapcraft
144+<https://github.com/snapcore/snapcraft>`_ and `charmcraft
145+<https://github.com/canonical/charmcraft>`_: the provider support for
146+container management is based substantially on ``charmcraft``, while much of
147+the CLI design is based on both those tools.
148+
149+The development is in a very early stage.
150+
151+Example configuration
152+---------------------
153+
154+.. code:: bash
155+
156+ $ cat .launchpad.yaml
157+ pipeline:
158+ - test
159+
160+ jobs:
161+ test:
162+ series: focal
163+ architectures: amd64
164+ run: echo hello world >output
165+ output:
166+ paths: [output]
167+
168+ $ lpcraft run --output out
169+ Running the job
170+ $ cat out/test/focal/amd64/files/output
171+ hello world
172+
173+
174+.. toctree::
175+ :maxdepth: 2
176+
177+ self
178+ CONTRIBUTING
179diff --git a/setup.cfg b/setup.cfg
180index a1a9ef9..7f9e2d8 100644
181--- a/setup.cfg
182+++ b/setup.cfg
183@@ -34,6 +34,8 @@ console_scripts =
184 lpcraft = lpcraft.main:main
185
186 [options.extras_require]
187+docs =
188+ sphinx
189 test =
190 coverage
191 fixtures
192diff --git a/tox.ini b/tox.ini
193index 3e16570..7ee20e8 100644
194--- a/tox.ini
195+++ b/tox.ini
196@@ -52,3 +52,9 @@ commands =
197 coverage run -m pytest
198 coverage html
199 coverage report -m --fail-under=100
200+
201+[testenv:docs]
202+basepython = python3
203+extras = docs
204+commands =
205+ sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html

Subscribers

People subscribed via source and target branches