Reasons are:
- The prompt says 2.7.3 Sep 26 2013, which makes the tutorial look
outdated
- There is another section that explains how snippets should be
executed in a Python interactive interpreter
- The only activity in the snippet is importing tuf functions and
creating a repo, both of which is done in another snippet below.
And the here created repo is not re-used
- The tutorial is long enough
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Note that target filepaths specified in the repo use '/' even on
Windows.
(That property is important to make sure that metadata is platform-
independent.)
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
(that is, despite currently existing issue to be remedied in #774)
Currently, repository_tool.get_filepaths_in_directory yields
relative paths, not the absolute paths it promises in its docstring.
This test will now function despite this and continue to function
after #774 is merged.
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
Because leading '/' is no longer allowed in target filenames in
target addition or delegation.
See https://github.com/theupdateframework/tuf/issues/639
While we're at it, remove some other unnecessary '/' characters
in repository creation and loading in the tutorial and tutorial
test.
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
add_restricted_paths was renamed to add_path; however, this
function represents a problematic element of TUF that assumes
that roles are have a single delegator and delegatee, and that
one can refer to a role's expected keys without being concerned
about any delegation metadata....
So this is being removed from the tutorial. In time, add_paths
will either be removed or changed (to expect a delegator role
and a delegatee role, not just a delegatee role).
This comment does not do justice to the issue: please see TUF
GitHub Issue #660:
https://github.com/theupdateframework/tuf/issues/660
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
While it may be nice, the use of a keystore/ directory for the
temporary keys created in the tutorial complicates the code a
good bit when it's done in a portable way (tons of os.path.join()
calls), and that's not worth it. It also is a slight complication
in a tutorial that profits from being as simple as possible.
Tests will be run in multiple environments (including non-Linux
environments) and to leave so many extra subdirectory uses in the
tutorial means that the tutorial test will deviate over a large
number of lines from the TUTORIAL.md content it is intended to
test, which would be bad.
This commit adjusts both the tutorial doc and the regression test
for the tutorial.
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
running test_tutorial.py attempts the commands replicated from
TUTORIAL.md. This should help us avoid breaking the tutorial with
future changes without noticing by having automated testing run
the tutorial and produce helpful output.
NOTE that this test currently fails because the tutorial is
currently broken!
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
- Drop 3.4 (due to end-of-life) and add 3.7 and 3.8 to tox, travis
and appveyor configuration for automated testing.
- Adapt classifiers in setup.py accordingly.
- Add python_requires field in setup.py to reflect supported
versions. This will prevent pip from trying to install tuf on
a non-supported version.
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
- line-wraps are integrated with
190a736d297ef5d8d3c1e8761ac196666954f3a2 in #775
- sorting the value returned by `get_dirty_roles()` in
`dirty_roles()` is not necessary as `get_dirty_roles()` already
returns a sorted list per ac010337f0e154f9c183f8abe759ce26ed16731c
in #775.
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
By sorting this printed list we make the output much easier to compare,
whether by eye (as in users following the tutorial) or programatically.
Signed-off-by: Joshua Lock <jlock@vmware.com>
An attempt to make part of the tutorial less jarring, and reformatting
of the surrounding text to keep the lines <80 characters.
Signed-off-by: Joshua Lock <jlock@vmware.com>
- Fix syntax issue (remove stray conflict marker)
- Update dependencies
astroid from 2.3.2 to 2.3.3
securesystemslib from 0.12.1 to 0.12.2
six from 1.12.0 to 1.13.0
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
backports.functools-lru-cache from 1.5 to 1.6.1
cffi from 1.13.1 to 1.13.2
python-dateutil from 2.8.0 to 2.8.1
securesystemslib from 0.12.0 to 0.12.1
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
gitpython from 3.0.3 to 3.0.4
lazy-object-proxy from 1.4.2 to 1.4.3
virtualenv from 16.7.6 to 16.7.7
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
asn1crypto from 1.1.0 to 1.2.0
astroid from 2.3.1 to 2.3.2
cffi from 1.12.3 to 1.13.1
cffi from 1.13.0 to 1.13.1
cryptography from 2.7 to 2.8
ipaddress from 1.0.22 to 1.0.23
pylint from 2.4.2 to 2.4.3
virtualenv from 16.7.5 to 16.7.6
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>