Merge lp:~sergiusens/snapcraft/1501222 into lp:~snappy-dev/snapcraft/core

Proposed by Sergio Schvezov
Status: Merged
Approved by: Sergio Schvezov
Approved revision: no longer in the source branch.
Merged at revision: 257
Proposed branch: lp:~sergiusens/snapcraft/1501222
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 68 lines (+14/-1)
3 files modified
debian/control (+2/-0)
setup.py (+1/-1)
snapcraft/main.py (+11/-0)
To merge this branch: bzr merge lp:~sergiusens/snapcraft/1501222
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+276033@code.launchpad.net

Commit message

Support --version with small note on snapcraft help

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) wrote :

lgtm!

review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~sergiusens/snapcraft/1501222 into lp:snapcraft failed. Below is the output from the failed tests.

snapcraft/main.py:32:9: E126 continuation line over-indented for hanging indent

lp:~sergiusens/snapcraft/1501222 updated
257. By Sergio Schvezov

Support --version with small note on snapcraft help by sergiusens approved by chipaca

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-10-19 14:45:26 +0000
3+++ debian/control 2015-10-28 17:35:21 +0000
4@@ -11,6 +11,7 @@
5 python3-fixtures,
6 python3-jsonschema,
7 python3-lxml,
8+ python3-pkg-resources,
9 python3-requests,
10 python3-setuptools,
11 python3-testscenarios,
12@@ -31,6 +32,7 @@
13 python3-apt,
14 python3-jsonschema,
15 python3-lxml,
16+ python3-pkg-resources,
17 python3-requests,
18 python3-yaml,
19 sudo,
20
21=== modified file 'setup.py'
22--- setup.py 2015-10-14 18:14:47 +0000
23+++ setup.py 2015-10-28 17:35:21 +0000
24@@ -23,7 +23,7 @@
25
26
27 setup(name="snapcraft",
28- version="0",
29+ version='0.4',
30 description="Easily craft snaps",
31 author_email="snappy-devel@lists.ubuntu.com",
32 url="https://launchpad.net/snapcraft",
33
34=== modified file 'snapcraft/main.py'
35--- snapcraft/main.py 2015-10-27 19:35:58 +0000
36+++ snapcraft/main.py 2015-10-28 17:35:21 +0000
37@@ -16,6 +16,7 @@
38 # along with this program. If not, see <http://www.gnu.org/licenses/>.
39
40 import argparse
41+import pkg_resources
42 import sys
43
44 import snapcraft.cmds
45@@ -23,6 +24,13 @@
46 from snapcraft import help
47 from snapcraft import log
48
49+try:
50+ _version = pkg_resources.require('snapcraft')[0].version
51+except pkg_resources.DistributionNotFound:
52+ _version = 'devel'
53+_VERSION = '%(prog)s ({}). Run "%(prog)s help" to get started.'.format(
54+ _version)
55+
56
57 def main():
58 log.configure()
59@@ -39,6 +47,9 @@
60 parents=[force_parser])
61 cmd_parser.add_argument('part', nargs='*')
62
63+ root_parser.add_argument('--version', action='version',
64+ version=_VERSION)
65+
66 # Command parsers
67
68 parser = subparsers.add_parser('init', help='start a project')

Subscribers

People subscribed via source and target branches