Add `rbt install` command for installing dependencies.
Review Request #8294 — Created July 18, 2016 and submitted
In some cases, we want to be able to install extra dependencies on-demand
instead of shipping everything with RBTools. The current example of this is
that we're pulling the TFS interface out into our own custom-written helper
(instead of making everyone download Team Explorer Everywhere), but it's too
big to just include in the egg.With this new command, users can download and install said dependencies in one
command. This doesn't attempt to be a full-fledged package manager (there's no
versioning, or dependencies, or conflict resolution, etc), but it should be
good enough.This does make some efforts to verify that the downloaded package is authentic.
Ifgpg
is installed, it will check that the file is correctly signed.
Otherwise, it will check the sha256sum.
Used this a bunch while iterating on the TFS module. Checked that both
signature and sha256sum validation worked as expected.
Description | From | Last Updated |
---|---|---|
local variable 'gpg_dir' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Swap these. |
chipx86 | |
"RBTools" |
chipx86 | |
Missing period. |
chipx86 | |
Let's place this in its own directory on downloads.beanbaginc.com. That'll make it easier for our stuff to manage the files. |
chipx86 | |
No need for the []. |
chipx86 | |
Period after sentences in comments, here and below. |
chipx86 | |
Trying to decide.... since these log entries (particularly the logging.info ones) are being output to the terminal, should we have … |
chipx86 | |
%s instead of + |
chipx86 | |
We should delete this before we raise CommandError above. |
chipx86 | |
Let's use %s instead of +. We also need to catch HTTPError and URLError for this. Particularly important when dealing … |
chipx86 | |
We should probably sanity-check this, and raise an error if we're not seeing what we expect. Might want to sanity-check … |
chipx86 | |
Let's put more information in here, say what hash we expected and what we got, specify the URL, and explain … |
chipx86 | |
We should either delete this when aborting above, or specify the location so that users can handle/refer to it. |
chipx86 | |
We should have try/except to catch any IOError or OSError from this. |
chipx86 | |
We need to catch here too, in case permissions are wrong (or something like SELinux gets in the way). |
chipx86 | |
Need to catch URLError and HTTPError here. (Or maybe the caller should do it? In which case, the docstring should … |
chipx86 | |
The description must be indented for exceptions. |
chipx86 | |
Can we wrap the line at the \n? We could maybe start the string indented 4 spaces from the raise, … |
chipx86 | |
Blank line between these. |
chipx86 | |
This can be while read_bytes != total_bytes:, instead of having that at the end. |
chipx86 | |
Needs the full module path. |
chipx86 | |
Newlines don't work so well in debug output. Subsequent lines don't get the prefix. Let's make each of these lines … |
chipx86 |
- Commit:
-
1b6de96740421ff489ad9904757fd18fe573ae32b42c51fe50bd3be0fcb2cd2a3d9226862bf3afdd
- Diff:
-
Revision 2 (+165 -1)
- Commit:
-
b42c51fe50bd3be0fcb2cd2a3d9226862bf3afdd72987d09ba726a889e78b9579daac45450f8aca0
- Diff:
-
Revision 3 (+166 -1)
-
Tool: PEP8 Style Checker Processed Files: setup.py rbtools/commands/install.py Tool: Pyflakes Processed Files: setup.py rbtools/commands/install.py
-
-
-
-
-
Let's place this in its own directory on downloads.beanbaginc.com. That'll make it easier for our stuff to manage the files.
-
-
-
Trying to decide.... since these log entries (particularly the
logging.info
ones) are being output to the terminal, should we have these in sentence format, with a period at the end?RBTools
logging.info
andCommandError
-based output generally do unless doingMy message: %s
. I kinda feel that'd be the right thing to do. -
-
-
Let's use
%s
instead of+
.We also need to catch
HTTPError
andURLError
for this. Particularly important when dealing with proxies.Should we use
download_file
for this? -
We should probably sanity-check this, and raise an error if we're not seeing what we expect.
Might want to sanity-check the length of the
real_sha
as well. -
Let's put more information in here, say what hash we expected and what we got, specify the URL, and explain what this means (the file might not be safe).
-
We should either delete this when aborting above, or specify the location so that users can handle/refer to it.
-
-
We need to catch here too, in case permissions are wrong (or something like SELinux gets in the way).
-
Need to catch
URLError
andHTTPError
here. (Or maybe the caller should do it? In which case, the docstring should specify that those can raise.)
- Commit:
-
72987d09ba726a889e78b9579daac45450f8aca067f04199cfbc67548699e48c7ca93000d46a340e
- Diff:
-
Revision 4 (+207 -1)
-
Tool: Pyflakes Processed Files: setup.py rbtools/commands/install.py Tool: PEP8 Style Checker Processed Files: setup.py rbtools/commands/install.py
-
-
-
Can we wrap the line at the
\n
? We could maybe start the string indented 4 spaces from theraise
, like above.It'd also be nice to specify the signatures (expected and actual), so the user can compare themselves if needed, and report to us. Would particularly help if there's an issue of some sort with the file contents from an upload.
-
-
- Commit:
-
67f04199cfbc67548699e48c7ca93000d46a340efe9ffbef1b84975c21b0f9acaee7c11622164440
- Diff:
-
Revision 5 (+206 -1)
-
Tool: PEP8 Style Checker Processed Files: setup.py rbtools/commands/install.py Tool: Pyflakes Processed Files: setup.py rbtools/commands/install.py
- Change Summary:
-
Add debug log of SHA checks, fix up documentation on exceptions raised.
- Commit:
-
fe9ffbef1b84975c21b0f9acaee7c11622164440c06909a82841b996ea030c10a00c7ea5b267b074
- Diff:
-
Revision 6 (+222 -1)
-
Tool: PEP8 Style Checker Processed Files: setup.py rbtools/commands/install.py Tool: Pyflakes Processed Files: setup.py rbtools/commands/install.py