Skip to content

Commit

Permalink
updated docs and comments
Browse files Browse the repository at this point in the history
Updated/removed documented commands and comments which were referencing Python2. Also updated links to documentation referencing Python2 docs (unchanged where needed)

Signed-off-by: Samuel Gregorovic <[email protected]>
Signed-off-by: samuelgregorovic <[email protected]>
  • Loading branch information
samuelgregorovic committed Jul 1, 2021
1 parent e61055a commit 7c8774b
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 89 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade tox coveralls
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade tox coveralls
- name: Run tox (${{ env.TOXENV }})
# See TOXENV environment variable for the testenv to be executed here
Expand Down Expand Up @@ -99,6 +99,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install --upgrade pip
pip install --upgrade coveralls
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade coveralls
coveralls --finish
14 changes: 1 addition & 13 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The TUF command-line interface (CLI) requires a full
[TUF installation](INSTALLATION.rst). Be sure to include the installation of
extra dependencies and C extensions (
```pip install securesystemslib[crypto,pynacl]```).
```python3 -m pip install securesystemslib[crypto,pynacl]```).

The use of the CLI is documented with examples below.

Expand Down Expand Up @@ -279,12 +279,6 @@ Enter a password for the encrypted key (tufkeystore/mykey):

Serve the repo
```Bash
$ cd tufrepo/
$ python -m SimpleHTTPServer 8001
```

If running python 3:
```Bash
$ python3 -m http.server 8001
```

Expand Down Expand Up @@ -412,12 +406,6 @@ $ repo.py --add README.txt --role role_x --sign tufkeystore/key_x tufkeystore/ke

Serve the repo
```Bash
$ cd tufrepo/
$ python -m SimpleHTTPServer 8001
```

If running python 3:
```Bash
$ python3 -m http.server 8001
```

Expand Down
16 changes: 8 additions & 8 deletions docs/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ and instructions for installing locally from source are provided here:
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.3.tar.gz
$ tar xvfz virtualenv-15.0.3.tar.gz
$ cd virtualenv-15.0.3
$ python virtualenv.py myVE
$ python3 virtualenv.py myVE


Development Installation
Expand All @@ -102,7 +102,7 @@ To work on the TUF project, it's best to perform a development install.

::

$ pip install -r requirements-dev.txt
$ python3 -m pip install -r requirements-dev.txt


Auto-formatting
Expand Down Expand Up @@ -134,15 +134,15 @@ dependencies must already be installed (see above).
::

$ cd tests
$ python aggregate_tests.py
$ python3 aggregate_tests.py

Individual tests can also be executed. Optional '-v' flags can be added to
increase log level up to DEBUG ('-vvvv').
::

$ python test_updater.py # run a specific test file
$ python test_updater.py TestUpdater.test_4_refresh # run a specific test
$ python test_updater.py -vvvv TestUpdater.test_4_refresh # run test with DEBUG log level
$ python3 test_updater.py # run a specific test file
$ python3 test_updater.py TestUpdater.test_4_refresh # run a specific test
$ python3 test_updater.py -vvvv TestUpdater.test_4_refresh # run test with DEBUG log level


All of the log levels and the corresponding options that could be used for testing are:
Expand Down Expand Up @@ -180,9 +180,9 @@ a *venv*), and then install ``securesystemslib`` in editable mode too (in the sa
::

$ cd path/to/tuf
$ pip install -r requirements-dev.txt
$ python3 -m pip install -r requirements-dev.txt
$ cd path/to/securesystemslib
$ pip install -r requirements-dev.txt
$ python3 -m pip install -r requirements-dev.txt


With `tox <https://testrun.org/tox/>`_ the test suite can be executed in a
Expand Down
12 changes: 6 additions & 6 deletions docs/INSTALLATION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ If you are only using ed25519-based cryptography, you can employ a pure-Python
installation, done simply with one of the following commands:

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


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

Install from a local source archive:
::
$ pip install <path to archive>
$ python3 -m pip install <path to archive>

Or install from the root directory of the unpacked archive:
::
$ pip install .
$ python3 -m pip install .



Expand All @@ -70,7 +70,7 @@ securesystemslib. **Note**: that may require non-Python dependencies, so if
you encounter an error attempting this pip command, see
`more instructions below <#non-python-dependencies>`_).
::
$ pip install securesystemslib[crypto,pynacl] tuf
$ python3 -m pip install securesystemslib[crypto,pynacl] tuf



Expand All @@ -96,5 +96,5 @@ Fedora-based distributions can instead install these libraries with dnf.
OS X users can install these header libraries with the `Homebrew <https://brew.sh/>`_
package manager, among other options.
::
$ brew install python
$ brew install python3
$ brew install libffi
6 changes: 1 addition & 5 deletions docs/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ how TUF works, however. It will serve as a very basic update system.

Make sure that TUF is installed, along with some of the optional cryptographic
libraries and C extensions. Try this command to do that:
`pip install securesystemslib[colors,crypto,pynacl] tuf`
`python3 -m pip install securesystemslib[colors,crypto,pynacl] tuf`

If you run into errors during that pip command, please consult the more
detailed [TUF Installation Instructions](INSTALLATION.rst). (There are some
Expand Down Expand Up @@ -81,10 +81,6 @@ repository's metadata.
```Bash
$ cd "tufrepo/"
$ python3 -m http.server 8001

# or, if you are using Python2:
$ python -m SimpleHTTPServer 8001

```

**Step (4)** - Obtain and verify the `testfile` update on a client.
Expand Down
5 changes: 0 additions & 5 deletions docs/TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,6 @@ repository example created earlier in this document.
## Test TUF Locally ##
Run the local TUF repository server.
```Bash
$ cd "repository/"; python -m SimpleHTTPServer 8001
```

If running Python 3:
```Bash
$ cd "repository/"; python3 -m http.server 8001
```

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
# 1. Use this script to create a pinned requirements file for each Python
# version
# ```
# for v in 2.7 3.6 3.7 3.8 3.9; do
# for v in 3.6 3.7 3.8 3.9; do
# mkvirtualenv tuf-env-${v} -p python${v};
# pip install pip-tools;
# python3 -m pip install pip-tools;
# pip-compile --no-header -o requirements-${v}.txt requirements.txt;
# deactivate;
# rmvirtualenv tuf-env-${v};
Expand Down
17 changes: 8 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
distributed to other users. The packaged source is saved to the 'dist'
folder in the current directory.
$ python setup.py sdist
$ python3 setup.py sdist
INSTALLATION OPTIONS
pip - installing and managing Python packages (recommended):
# Installing from Python Package Index (https://pypi.python.org/pypi).
$ pip install tuf
$ python3 -m pip install tuf
# Installing from local source archive.
$ pip install <path to archive>
$ python3 -m pip install <path to archive>
# Or from the root directory of the unpacked archive.
$ pip install .
$ python3 -m pip install .
# Installing optional requirements (i.e., after installing tuf).
# Support for creation of Ed25519 signatures and support for RSA and ECDSA
# signatures in general requires optional dependencies:
$ pip install securesystemslib[crypto,pynacl]
$ python3 -m pip install securesystemslib[crypto,pynacl]
Alternate installation options:
Expand All @@ -51,13 +51,13 @@
run one of the following shell commands:
Install to the global site-packages directory.
$ python setup.py install
$ python3 setup.py install
Install to the user site-packages directory.
$ python setup.py install --user
$ python3 setup.py install --user
Install to a chosen directory.
$ python setup.py install --home=<directory>
$ python3 setup.py install --home=<directory>
Note: The last two installation options may require modification of
Expand Down Expand Up @@ -96,7 +96,6 @@
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand Down
6 changes: 3 additions & 3 deletions tests/repository_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Or by invoking `aggregate_tests.py` from the
directory.

```
$ python aggregate_tests.py
$ python3 aggregate_tests.py
```

Note: integration tests end in `_integration.py`.
Expand All @@ -22,13 +22,13 @@ If you wish to run a particular unit test, navigate to the tests directory and
run that specific unit test. For example:

```
$ python test_updater.py
$ python3 test_updater.py
```

It it also possible to run the test cases of a unit test. For instance:

```
$ python -m unittest test_updater.TestMultiRepoUpdater.test_get_one_valid_targetinfo
$ python3 -m unittest test_updater.TestMultiRepoUpdater.test_get_one_valid_targetinfo
```

## Setup
Expand Down
3 changes: 0 additions & 3 deletions tests/test_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ def test_tutorial(self):

# TODO: Run subprocess to simulate the following bash instructions:

# $ cd "repository/"; python -m SimpleHTTPServer 8001
# If running Python 3:

# $ cd "repository/"; python3 -m http.server 8001
# We next retrieve targets from the TUF repository and save them to client/. The client.py script is available to download metadata and files from a specified repository. In a different command-line prompt . . .

Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ skipsdist = true
changedir = tests

commands =
python --version
python -m coverage run aggregate_tests.py
python -m coverage report -m --fail-under 97
python3 --version
python3 -m coverage run aggregate_tests.py
python3 -m coverage report -m --fail-under 97

deps =
-r{toxinidir}/requirements-test.txt
# Install TUF in editable mode, instead of tox default virtual environment
# installation (see `skipsdist`), to get relative paths in coverage reports
--editable {toxinidir}

install_command = pip install {opts} {packages}
install_command = python3 -m pip install {opts} {packages}

# Develop test env to run tests against securesystemslib's master branch
# Must to be invoked explicitly with, e.g. `tox -e with-sslib-master`
Expand All @@ -35,8 +35,8 @@ deps =
--editable {toxinidir}

commands =
python -m coverage run aggregate_tests.py
python -m coverage report -m
python3 -m coverage run aggregate_tests.py
python3 -m coverage report -m

[testenv:lint]
changedir = {toxinidir}
Expand Down
Loading

0 comments on commit 7c8774b

Please sign in to comment.