Add Python version to `rbt --version` output
Review Request #10917 — Created Feb. 25, 2020 and submitted
Add Python version to
rbt --version
output.
sys.version
has full python version value. The output is
Python 2.7.17 (default, Jan 10 2020, 00:33:00) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
and
sys.version_info
is a key=value pair tuple.
sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)
and
sys.version_info[:3]
will get the first 3 keys' values into a tuple.
The output is(2, 7, 17)
To format the version for python such as x.x.x, I get each digit in the tuple.
Tested in terminal in
reviewboard-dev
virtual env andreviewboard-dev-rbt
for python 2 and 3.
andreviewboard-4.0
virtual envs andreviewboard-4.0-rbt
for python 2 and 3.Create TestCase and pass successfully using
./tests/runtests.py rbtools.commands.tests.test_main
and./tests/runtests.py rbtools.commands.tests.test_main:VersionCommandTests
. Test number is #246
Summary | ID | Author |
---|---|---|
588f9bd3495cfaad57e533e05f874a6454b5e50c | XiaoleZ | |
3db574024ded5cb29e967b6dbfca7bd981cddbbd | XiaoleZ | |
b46eaaac4e6a4eeaa672c52c44615eea055b9578 | XiaoleZ | |
9ba27cc4be2ed137109e1e91f5686d2a8cf15355 | XiaoleZ | |
4fb7719ac1c5ab186fe24f954d0aa28c86f51b95 | XiaoleZ |
Description | From | Last Updated |
---|---|---|
E302 expected 2 blank lines, found 1 |
reviewbot | |
E221 multiple spaces before operator |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E203 whitespace before ',' |
reviewbot | |
E231 missing whitespace after ',' |
reviewbot | |
W391 blank line at end of file |
reviewbot |
- Change Summary:
-
Add test case for
rbt --version
command - Testing Done:
-
Tested in terminal in
reviewboard-dev
virtual env andreviewboard-dev-rbt
for python 2 and 3.and reviewboard-4.0
virtual envs andreviewboard-4.0-rbt
for python 2 and 3.+ + Create TestCase and pass successfully using
./tests/runtests.py rbtools.commands.tests.test_main
and./tests/runtests.py rbtools.commands.tests.test_main:VersionCommandTests
. Test number is #246 - Commits:
-
Summary ID Author 588f9bd3495cfaad57e533e05f874a6454b5e50c XiaoleZ 588f9bd3495cfaad57e533e05f874a6454b5e50c XiaoleZ 3db574024ded5cb29e967b6dbfca7bd981cddbbd XiaoleZ b46eaaac4e6a4eeaa672c52c44615eea055b9578 XiaoleZ
- Change Summary:
-
fix python coding styling
- Commits:
-
Summary ID Author 588f9bd3495cfaad57e533e05f874a6454b5e50c XiaoleZ 3db574024ded5cb29e967b6dbfca7bd981cddbbd XiaoleZ b46eaaac4e6a4eeaa672c52c44615eea055b9578 XiaoleZ 588f9bd3495cfaad57e533e05f874a6454b5e50c XiaoleZ 3db574024ded5cb29e967b6dbfca7bd981cddbbd XiaoleZ b46eaaac4e6a4eeaa672c52c44615eea055b9578 XiaoleZ 9ba27cc4be2ed137109e1e91f5686d2a8cf15355 XiaoleZ
Checks run (2 succeeded)
- Change Summary:
-
remove comma based on Katherine's feedback
- Commits:
-
Summary ID Author 588f9bd3495cfaad57e533e05f874a6454b5e50c XiaoleZ 3db574024ded5cb29e967b6dbfca7bd981cddbbd XiaoleZ b46eaaac4e6a4eeaa672c52c44615eea055b9578 XiaoleZ 9ba27cc4be2ed137109e1e91f5686d2a8cf15355 XiaoleZ 588f9bd3495cfaad57e533e05f874a6454b5e50c XiaoleZ 3db574024ded5cb29e967b6dbfca7bd981cddbbd XiaoleZ b46eaaac4e6a4eeaa672c52c44615eea055b9578 XiaoleZ 9ba27cc4be2ed137109e1e91f5686d2a8cf15355 XiaoleZ 4fb7719ac1c5ab186fe24f954d0aa28c86f51b95 XiaoleZ