Skip to content

Commit 899b762

Browse files
author
Jussi Kukkonen
authored
Merge pull request #1853 from lukpueh/update-install-docs
doc: update installation documentation
2 parents 73ce299 + cd70e47 commit 899b762

File tree

4 files changed

+65
-93
lines changed

4 files changed

+65
-93
lines changed

docs/CONTRIBUTING.rst

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Instructions for Contributors
1+
Instructions for contributors
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

44
Contribute to python-tuf by submitting pull requests against the "develop"
@@ -9,37 +9,14 @@ All submitted code should follow our `style guidelines
99
<https://github.com/secure-systems-lab/code-style-guidelines/blob/master/python.md>`_
1010
and must be `unit tested <#unit-tests>`_.
1111

12-
Development Installation
13-
========================
14-
15-
To work on the TUF project, it's best to perform a development install.
16-
17-
To facilitate development and installation of edited version of the code base,
18-
developers are encouraged to use `venv <https://docs.python.org/3/library/venv.html>`_.
19-
20-
1. First, `install non-Python dependencies
21-
<https://theupdateframework.readthedocs.io/en/latest/INSTALLATION.html#non-python-dependencies>`_.
22-
23-
2. Then clone this repository:
24-
25-
::
26-
27-
$ git clone https://github.com/theupdateframework/python-tuf
28-
29-
3. Then perform a full, editable/development install. This will include all
30-
optional cryptographic support, the testing/linting dependencies, etc.
31-
With a development installation, modifications to the code in the current
32-
directory will affect the installed version of TUF.
33-
34-
::
35-
36-
$ python3 -m pip install -r requirements-dev.txt
12+
.. note::
3713

14+
Also see `development installation instructions <https://theupdateframework.readthedocs.io/en/latest/INSTALLATION.html#install-for-development>`_.
3815

3916
Testing
4017
=======
4118

42-
With `tox <https://testrun.org/tox/>`_ the whole test suite can be executed in
19+
With `tox <https:///tox.wiki>`_ the whole test suite can be executed in
4320
a separate *virtual environment* for each supported Python version available on
4421
the system. ``tuf`` and its dependencies are installed automatically for each
4522
tox run.

docs/INSTALLATION.rst

Lines changed: 58 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,86 @@
11
Installation
22
============
33

4-
*pip* is the recommended installer for installing and managing Python packages.
5-
The project can be installed either locally or from the Python Package Index.
6-
All `TUF releases
7-
<https://github.com/theupdateframework/python-tuf/releases>`_ are cryptographically
8-
signed, with GPG signatures available on both GitHub and `PyPI
9-
<https://pypi.python.org/pypi/tuf/>`_. PGP key information for our maintainers
10-
is available on our `website
11-
<https://theupdateframework.github.io/people.html>`_, on major keyservers,
12-
and on the `maintainers page
13-
<https://github.com/theupdateframework/python-tuf/blob/develop/docs/MAINTAINERS.txt>`_.
4+
All versions of ``python-tuf`` can be installed from
5+
`PyPI <https://pypi.org/project/tuf/>`_ with
6+
`pip <https://pip.pypa.io/en/stable/>`_.
147

8+
::
159

16-
Release Verification
17-
--------------------
10+
python3 -m pip install tuf
1811

19-
Assuming you trust `the maintainer's PGP key
20-
<https://github.com/theupdateframework/python-tuf/blob/develop/docs/MAINTAINERS.txt>`_,
21-
the detached ASC signature can be downloaded and verified. For example::
12+
By default tuf is installed as pure python package with limited cryptographic
13+
abilities. See `Install with full cryptographic abilities`_ for more options.
2214

23-
$ gpg --verify securesystemslib-0.10.8.tar.gz.asc
24-
gpg: assuming signed data in 'securesystemslib-0.10.8.tar.gz'
25-
gpg: Signature made Wed Nov 8 15:21:47 2017 EST
26-
gpg: using RSA key 3E87BB339378BC7B3DD0E5B25DEE9B97B0E2289A
27-
gpg: Good signature from "Vladimir Diaz (Vlad) <[email protected]>" [ultimate]
2815

16+
Install with full cryptographic abilities
17+
-----------------------------------------
2918

19+
Default installation supports signature verification only, using a pure Python
20+
*ed25519* implementation. While this allows to operate a *basic client* on
21+
almost any computing device, you will need additional cryptographic abilities
22+
for *repository* code, i.e. key and signature generation, additional
23+
algorithms, and more performant backends. Opt-in is available via
24+
``securesystemslib``.
3025

31-
Simple Installation
32-
-------------------
26+
.. note::
3327

34-
If you are only using ed25519-based cryptography, you can employ a pure-Python
35-
installation, done simply with one of the following commands:
28+
Please consult with underlying crypto backend installation docs --
29+
`cryptography <https://cryptography.io/en/latest/installation/>`_ and
30+
`pynacl <https://pynacl.readthedocs.io/en/latest/install/>`_ --
31+
for possible system dependencies.
3632

37-
Installing from Python Package Index (https://pypi.python.org/pypi).
38-
(Note: Please use "python3 -m pip install --no-use-wheel tuf" if your version
39-
of pip <= 1.5.6)::
33+
::
4034

41-
$ python3 -m pip install tuf
35+
python3 -m pip securesystemslib[crypto,pynacl] tuf
4236

4337

44-
**Alternatively**, if you wish to install from a GitHub release you've already
45-
downloaded, or a package you obtained in another way, you can instead:
46-
47-
Install from a local source archive::
48-
49-
$ python3 -m pip install <path to archive>
50-
51-
Or install from the root directory of the unpacked archive::
52-
53-
$ python3 -m pip install .
54-
55-
56-
57-
Install with More Cryptographic Flexibility
58-
-------------------------------------------
38+
Install for development
39+
-----------------------
5940

60-
By default, C extensions are not installed and only Ed25519 signatures can
61-
be verified, in pure Python. To fully support RSA, Ed25519, ECDSA, and
62-
other crypto, you must install the extra dependencies declared by
63-
securesystemslib. **Note**: that may require non-Python dependencies, so if
64-
you encounter an error attempting this pip command, see
65-
`more instructions below <#non-python-dependencies>`_). ::
41+
To install tuf in editable mode together with development dependencies,
42+
`clone <https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository>`_ the
43+
`python-tuf repository <https://github.com/theupdateframework/python-tuf>`_
44+
from GitHub, change into the project root directory, and install with pip
45+
(using `venv <https://docs.python.org/3/library/venv.html>`_ is recommended).
6646

67-
$ python3 -m pip install securesystemslib[crypto,pynacl] tuf
47+
.. note::
6848

49+
Development installation will `Install with full cryptographic abilities`_.
50+
Please check above for possible system dependencies.
6951

52+
::
7053

71-
Non-Python Dependencies
72-
-----------------------
54+
python3 -m pip install -r requirements-dev.txt
7355

74-
If you encounter errors during installation, you may be missing
75-
certain system libraries.
7656

77-
For example, PyNaCl and Cryptography -- two libraries used in the full
78-
installation to support certain cryptographic functions -- may require FFI
79-
(Foreign Function Interface) development header files.
57+
Verify release signatures
58+
-------------------------
8059

81-
Debian-based distributions can install the necessary header libraries with apt::
60+
Releases on PyPI are signed with a maintainer key using
61+
`gpg <https://gnupg.org/>`_ (see
62+
`MAINTAINERS.txt <https://github.com/theupdateframework/python-tuf/blob/develop/docs/MAINTAINERS.txt>`_
63+
for key fingerprints). Signatures can be downloaded from the
64+
`GitHub release <https://github.com/theupdateframework/python-tuf/releases>`_
65+
page (look for *\*.asc* files in the *Assets* section).
8266

83-
$ apt-get install build-essential libssl-dev libffi-dev python-dev
67+
Below code shows how to verify the signature of a
68+
`built <https://packaging.python.org/en/latest/glossary/#term-Built-Distribution>`_ distribution,
69+
signed by the maintainer *Lukas Pühringer*. It works
70+
alike for `source <https://packaging.python.org/en/latest/glossary/#term-Source-Distribution-or-sdist>`_ distributions.
8471

85-
Fedora-based distributions can instead install these libraries with dnf::
72+
::
8673

87-
$ dnf install libffi-devel redhat-rpm-config openssl-devel
74+
# Get wheel from PyPI and signature from GitHub
75+
python3 -m pip download --no-deps tuf==0.20.0
76+
wget https://github.com/theupdateframework/python-tuf/releases/download/v0.20.0/tuf-0.20.0-py3-none-any.whl.asc
8877

89-
OS X users can install these header libraries with the `Homebrew <https://brew.sh/>`_
90-
package manager, among other options::
78+
# Get public key, compare fingerprint in MAINTAINERS.txt, and verify with gpg
79+
gpg --recv-keys 89A2AD3C07D962E8
80+
gpg --verify tuf-0.20.0-py3-none-any.whl.asc
9181

92-
$ brew install python3
93-
$ brew install libffi
82+
# Output:
83+
# gpg: assuming signed data in 'tuf-0.20.0-py3-none-any.whl'
84+
# gpg: Signature made Thu Dec 16 09:21:38 2021 CET
85+
# gpg: using RSA key 8BA69B87D43BE294F23E812089A2AD3C07D962E8
86+
# gpg: Good signature from "Lukas Pühringer <[email protected]>" [ultimate]

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
'sphinx.ext.autosectionlabel'
3636
]
3737

38+
autosectionlabel_prefix_document = True
39+
3840
# Add any paths that contain templates here, relative to this directory.
3941
templates_path = ['_templates']
4042

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ systems.
1717
api/api-reference
1818
INSTALLATION
1919
Usage examples <https://github.com/theupdateframework/python-tuf/tree/develop/examples>
20-
CONTRIBUTING
20+
Contribute <CONTRIBUTING>

0 commit comments

Comments
 (0)