Skip to content

Commit 04bbc03

Browse files
author
Jussi Kukkonen
authored
Merge pull request #1493 from jku/updated-commands-python3
updated docs and comments
2 parents f6df086 + 112575d commit 04bbc03

17 files changed

Lines changed: 64 additions & 89 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161

6262
- name: Install dependencies
6363
run: |
64-
python -m pip install --upgrade pip
65-
pip install --upgrade tox coveralls
64+
python3 -m pip install --upgrade pip
65+
python3 -m pip install --upgrade tox coveralls
6666
6767
- name: Run tox (${{ env.TOXENV }})
6868
# See TOXENV environment variable for the testenv to be executed here
@@ -99,6 +99,6 @@ jobs:
9999
env:
100100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101101
run: |
102-
python -m pip install --upgrade pip
103-
pip install --upgrade coveralls
102+
python3 -m pip install --upgrade pip
103+
python3 -m pip install --upgrade coveralls
104104
coveralls --finish

docs/CLI.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The TUF command-line interface (CLI) requires a full
44
[TUF installation](INSTALLATION.rst). Be sure to include the installation of
55
extra dependencies and C extensions (
6-
```pip install securesystemslib[crypto,pynacl]```).
6+
```python3 -m pip install securesystemslib[crypto,pynacl]```).
77

88
The use of the CLI is documented with examples below.
99

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

280280
Serve the repo
281281
```Bash
282-
$ cd tufrepo/
283-
$ python -m SimpleHTTPServer 8001
284-
```
285-
286-
If running python 3:
287-
```Bash
288282
$ python3 -m http.server 8001
289283
```
290284

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

413407
Serve the repo
414408
```Bash
415-
$ cd tufrepo/
416-
$ python -m SimpleHTTPServer 8001
417-
```
418-
419-
If running python 3:
420-
```Bash
421409
$ python3 -m http.server 8001
422410
```
423411

docs/CONTRIBUTORS.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ and instructions for installing locally from source are provided here:
7979
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.3.tar.gz
8080
$ tar xvfz virtualenv-15.0.3.tar.gz
8181
$ cd virtualenv-15.0.3
82-
$ python virtualenv.py myVE
82+
$ python3 virtualenv.py myVE
8383

8484

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

103103
::
104104

105-
$ pip install -r requirements-dev.txt
105+
$ python3 -m pip install -r requirements-dev.txt
106106

107107

108108
Auto-formatting
@@ -134,15 +134,15 @@ dependencies must already be installed (see above).
134134
::
135135

136136
$ cd tests
137-
$ python aggregate_tests.py
137+
$ python3 aggregate_tests.py
138138

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

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

147147

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

182182
$ cd path/to/tuf
183-
$ pip install -r requirements-dev.txt
183+
$ python3 -m pip install -r requirements-dev.txt
184184
$ cd path/to/securesystemslib
185-
$ pip install -r requirements-dev.txt
185+
$ python3 -m pip install -r requirements-dev.txt
186186

187187

188188
With `tox <https://testrun.org/tox/>`_ the test suite can be executed in a

docs/INSTALLATION.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ If you are only using ed25519-based cryptography, you can employ a pure-Python
4141
installation, done simply with one of the following commands:
4242

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

4949

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

5353
Install from a local source archive:
5454
::
55-
$ pip install <path to archive>
55+
$ python3 -m pip install <path to archive>
5656

5757
Or install from the root directory of the unpacked archive:
5858
::
59-
$ pip install .
59+
$ python3 -m pip install .
6060

6161

6262

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

7575

7676

@@ -96,5 +96,5 @@ Fedora-based distributions can instead install these libraries with dnf.
9696
OS X users can install these header libraries with the `Homebrew <https://brew.sh/>`_
9797
package manager, among other options.
9898
::
99-
$ brew install python
99+
$ brew install python3
100100
$ brew install libffi

docs/QUICKSTART.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ how TUF works, however. It will serve as a very basic update system.
1515

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

2020
If you run into errors during that pip command, please consult the more
2121
detailed [TUF Installation Instructions](INSTALLATION.rst). (There are some
@@ -81,10 +81,6 @@ repository's metadata.
8181
```Bash
8282
$ cd "tufrepo/"
8383
$ python3 -m http.server 8001
84-
85-
# or, if you are using Python2:
86-
$ python -m SimpleHTTPServer 8001
87-
8884
```
8985

9086
**Step (4)** - Obtain and verify the `testfile` update on a client.

docs/TUTORIAL.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,6 @@ repository example created earlier in this document.
674674
## Test TUF Locally ##
675675
Run the local TUF repository server.
676676
```Bash
677-
$ cd "repository/"; python -m SimpleHTTPServer 8001
678-
```
679-
680-
If running Python 3:
681-
```Bash
682677
$ cd "repository/"; python3 -m http.server 8001
683678
```
684679

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
# 1. Use this script to create a pinned requirements file for each Python
2727
# version
2828
# ```
29-
# for v in 2.7 3.6 3.7 3.8 3.9; do
29+
# for v in 3.6 3.7 3.8 3.9; do
3030
# mkvirtualenv tuf-env-${v} -p python${v};
31-
# pip install pip-tools;
31+
# python3 -m pip install pip-tools;
3232
# pip-compile --no-header -o requirements-${v}.txt requirements.txt;
3333
# deactivate;
3434
# rmvirtualenv tuf-env-${v};

setup.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@
2323
distributed to other users. The packaged source is saved to the 'dist'
2424
folder in the current directory.
2525
26-
$ python setup.py sdist
26+
$ python3 setup.py sdist
2727
2828
2929
INSTALLATION OPTIONS
3030
3131
pip - installing and managing Python packages (recommended):
3232
3333
# Installing from Python Package Index (https://pypi.python.org/pypi).
34-
$ pip install tuf
34+
$ python3 -m pip install tuf
3535
3636
# Installing from local source archive.
37-
$ pip install <path to archive>
37+
$ python3 -m pip install <path to archive>
3838
3939
# Or from the root directory of the unpacked archive.
40-
$ pip install .
40+
$ python3 -m pip install .
4141
4242
# Installing optional requirements (i.e., after installing tuf).
4343
# Support for creation of Ed25519 signatures and support for RSA and ECDSA
4444
# signatures in general requires optional dependencies:
45-
$ pip install securesystemslib[crypto,pynacl]
45+
$ python3 -m pip install securesystemslib[crypto,pynacl]
4646
4747
4848
Alternate installation options:
@@ -51,13 +51,13 @@
5151
run one of the following shell commands:
5252
5353
Install to the global site-packages directory.
54-
$ python setup.py install
54+
$ python3 setup.py install
5555
5656
Install to the user site-packages directory.
57-
$ python setup.py install --user
57+
$ python3 setup.py install --user
5858
5959
Install to a chosen directory.
60-
$ python setup.py install --home=<directory>
60+
$ python3 setup.py install --home=<directory>
6161
6262
6363
Note: The last two installation options may require modification of
@@ -96,7 +96,6 @@
9696
'Operating System :: POSIX :: Linux',
9797
'Operating System :: MacOS :: MacOS X',
9898
'Operating System :: Microsoft :: Windows',
99-
'Programming Language :: Python',
10099
'Programming Language :: Python :: 3',
101100
'Programming Language :: Python :: 3.6',
102101
'Programming Language :: Python :: 3.7',

tests/repository_data/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Or by invoking `aggregate_tests.py` from the
1313
directory.
1414

1515
```
16-
$ python aggregate_tests.py
16+
$ python3 aggregate_tests.py
1717
```
1818

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

2424
```
25-
$ python test_updater.py
25+
$ python3 test_updater.py
2626
```
2727

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

3030
```
31-
$ python -m unittest test_updater.TestMultiRepoUpdater.test_get_one_valid_targetinfo
31+
$ python3 -m unittest test_updater.TestMultiRepoUpdater.test_get_one_valid_targetinfo
3232
```
3333

3434
## Setup

tests/test_tutorial.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,6 @@ def test_tutorial(self):
389389

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

392-
# $ cd "repository/"; python -m SimpleHTTPServer 8001
393-
# If running Python 3:
394-
395392
# $ cd "repository/"; python3 -m http.server 8001
396393
# 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 . . .
397394

0 commit comments

Comments
 (0)