Skip to content

Commit 5f0445d

Browse files
author
Jussi Kukkonen
authored
Merge pull request #1517 from sechkova/configure-sphinx
Enable docs build with sphinx
2 parents 66aac38 + bfb509a commit 5f0445d

17 files changed

Lines changed: 255 additions & 29 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ dist/*
33
build/*
44
env/*
55

6+
# docs build directory
7+
docs/build/*
8+
69
# global file patterns
710
*.log
811
*.pyc

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation with Sphinx
9+
sphinx:
10+
builder: html
11+
configuration: docs/conf.py
12+
13+
# Optionally build your docs in additional formats such as PDF
14+
formats: []
15+
16+
# Optionally set the version of Python and requirements required to build your docs
17+
python:
18+
install:
19+
- requirements: requirements-docs.txt

docs/INSTALLATION.rst

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@ is available on our `website
1212
and on the `maintainers page
1313
<https://github.com/theupdateframework/tuf/blob/develop/docs/MAINTAINERS.txt>`_.
1414

15-
The latest release and its packaging information, such as who signed the
16-
release and their PGP fingerprint, can also be found on our 1-year `roadmap
17-
<ROADMAP.md>`_.
18-
19-
2015

2116
Release Verification
2217
--------------------
2318

24-
Assuming you trust `the maintainer's PGP key <MAINTAINERS.txt>`_, the detached
25-
ASC signature can be downloaded and verified. For example:
26-
27-
::
19+
Assuming you trust `the maintainer's PGP key
20+
<https://github.com/theupdateframework/tuf/blob/develop/docs/MAINTAINERS.txt>`_,
21+
the detached ASC signature can be downloaded and verified. For example::
2822

2923
$ gpg --verify securesystemslib-0.10.8.tar.gz.asc
3024
gpg: assuming signed data in 'securesystemslib-0.10.8.tar.gz'
@@ -42,20 +36,20 @@ installation, done simply with one of the following commands:
4236

4337
Installing from Python Package Index (https://pypi.python.org/pypi).
4438
(Note: Please use "python3 -m pip install --no-use-wheel tuf" if your version
45-
of pip <= 1.5.6)
46-
::
39+
of pip <= 1.5.6)::
40+
4741
$ python3 -m pip install tuf
4842

4943

5044
**Alternatively**, if you wish to install from a GitHub release you've already
5145
downloaded, or a package you obtained in another way, you can instead:
5246

53-
Install from a local source archive:
54-
::
47+
Install from a local source archive::
48+
5549
$ python3 -m pip install <path to archive>
5650

57-
Or install from the root directory of the unpacked archive:
58-
::
51+
Or install from the root directory of the unpacked archive::
52+
5953
$ python3 -m pip install .
6054

6155

@@ -68,8 +62,8 @@ be verified, in pure Python. To fully support RSA, Ed25519, ECDSA, and
6862
other crypto, you must install the extra dependencies declared by
6963
securesystemslib. **Note**: that may require non-Python dependencies, so if
7064
you encounter an error attempting this pip command, see
71-
`more instructions below <#non-python-dependencies>`_).
72-
::
65+
`more instructions below <#non-python-dependencies>`_). ::
66+
7367
$ python3 -m pip install securesystemslib[crypto,pynacl] tuf
7468

7569

@@ -84,17 +78,16 @@ For example, PyNaCl and Cryptography -- two libraries used in the full
8478
installation to support certain cryptographic functions -- may require FFI
8579
(Foreign Function Interface) development header files.
8680

87-
Debian-based distributions can install the necessary header libraries with apt
88-
(Advanced Package Tool.)
89-
::
81+
Debian-based distributions can install the necessary header libraries with apt::
82+
9083
$ apt-get install build-essential libssl-dev libffi-dev python-dev
9184

92-
Fedora-based distributions can instead install these libraries with dnf.
93-
::
85+
Fedora-based distributions can instead install these libraries with dnf::
86+
9487
$ dnf install libffi-devel redhat-rpm-config openssl-devel
9588

9689
OS X users can install these header libraries with the `Homebrew <https://brew.sh/>`_
97-
package manager, among other options.
98-
::
90+
package manager, among other options::
91+
9992
$ brew install python3
10093
$ brew install libffi

docs/api/api-reference.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
API Reference
2+
=====================
3+
4+
5+
TUF provides multiple APIs:
6+
7+
8+
* The low-level :doc:`tuf.api` provides access to a Metadata file abstraction
9+
that closely follows the TUF specification's `document formats`_.
10+
This API handles de/serialization to and from files and makes it easier to access
11+
and modify metadata content safely. It is purely focused on individual
12+
pieces of Metadata and provides no concepts like "repository" or "update
13+
workflow".
14+
15+
* The `client update workflow`_ is implemented in the :doc:`tuf.ngclient` module:
16+
It is a higher-level API that provides ways to query and download target files
17+
securely, while handling the TUF update workflow behind the scenes. ngclient
18+
is implemented on top of the Metadata API and can be used to implement
19+
various TUF clients with relatively little effort.
20+
21+
.. note:: Major API changes are unlikely but these APIs are not yet
22+
considered stable, and a higher-level repository operations API is not yet
23+
included.
24+
25+
There is a legacy implementation in the source code (not covered by this
26+
documentation): it is in maintenance mode and receives no feature work.
27+
28+
.. toctree::
29+
:maxdepth: 2
30+
:caption: Contents:
31+
32+
tuf.api
33+
tuf.ngclient
34+
35+
.. _client update workflow: https://theupdateframework.github.io/specification/latest/#detailed-client-workflow
36+
.. _document formats: https://theupdateframework.github.io/specification/latest/#document-formats

docs/api/tuf.api.metadata.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Metadata
2+
---------------------------------
3+
4+
.. automodule:: tuf.api.metadata
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/api/tuf.api.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Metadata API
2+
===============
3+
4+
The low-level Metadata API contains two modules:
5+
6+
* :doc:`tuf.api.metadata` contains the actual Metadata abstraction
7+
that higher level libraries and application code should use to interact
8+
with TUF metadata. This abstraction provides safe reading and writing to
9+
supported file formats and helper functions for accessing and modifying
10+
the metadata contents.
11+
* :doc:`tuf.api.serialization` covers serializing the metadata into
12+
specific wire formats (like json).
13+
14+
.. toctree::
15+
:hidden:
16+
17+
tuf.api.metadata
18+
tuf.api.serialization

docs/api/tuf.api.serialization.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Serialization
2+
=============================
3+
4+
JSON serialization
5+
-----------------------------
6+
7+
.. automodule:: tuf.api.serialization.json
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

docs/api/tuf.ngclient.config.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Configuration
2+
=============
3+
4+
.. automodule:: tuf.ngclient.config
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/api/tuf.ngclient.fetcher.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Fetcher
2+
============
3+
4+
.. automodule:: tuf.ngclient.fetcher
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/api/tuf.ngclient.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ngclient
2+
========
3+
4+
The ngclient module contains a complete TUF client library implementation.
5+
6+
* :doc:`tuf.ngclient.updater` implements the `detailed client workflow`_
7+
* :doc:`tuf.ngclient.config` provides optional configuration for the updater
8+
* :doc:`tuf.ngclient.fetcher` can be used for optional low-level network I/O control
9+
10+
11+
.. toctree::
12+
:hidden:
13+
14+
tuf.ngclient.updater
15+
tuf.ngclient.config
16+
tuf.ngclient.fetcher
17+
18+
.. _detailed client workflow: https://theupdateframework.github.io/specification/latest/#detailed-client-workflow
19+

0 commit comments

Comments
 (0)