Merge lp:~sergiusens/snapcraft/icon-meta into lp:~snappy-dev/snapcraft/core
- icon-meta
- Merge into core
Status: | Merged |
---|---|
Approved by: | John Lenton |
Approved revision: | 155 |
Merged at revision: | 143 |
Proposed branch: | lp:~sergiusens/snapcraft/icon-meta |
Merge into: | lp:~snappy-dev/snapcraft/core |
Prerequisite: | lp:~sergiusens/snapcraft/testing-fixes |
Diff against target: |
739 lines (+101/-21) 32 files modified
examples/godd/snapcraft.yaml (+1/-0) examples/gopaste/snapcraft.yaml (+1/-0) examples/java-hello-world/snapcraft.yaml (+1/-0) examples/libpipeline/snapcraft.yaml (+1/-0) examples/py2-project/snapcraft.yaml (+1/-0) examples/py3-project/snapcraft.yaml (+1/-0) examples/qmldemo/snapcraft.yaml (+1/-0) examples/tomcat-maven-webapp/snapcraft.yaml (+1/-0) examples/webcam-webui-snap/snapcraft.yaml (+1/-0) examples/wget-deb/snapcraft.yaml (+1/-0) integration-tests/data/assemble/snapcraft.yaml (+1/-0) integration-tests/data/bzr-head/snapcraft.yaml (+1/-0) integration-tests/data/bzr-tag/snapcraft.yaml (+1/-0) integration-tests/data/conflicts/snapcraft.yaml (+1/-0) integration-tests/data/dependencies/snapcraft.yaml (+1/-0) integration-tests/data/git-branch/snapcraft.yaml (+1/-0) integration-tests/data/git-head/snapcraft.yaml (+1/-0) integration-tests/data/git-tag/snapcraft.yaml (+1/-0) integration-tests/data/hg-branch/snapcraft.yaml (+1/-0) integration-tests/data/hg-head/snapcraft.yaml (+1/-0) integration-tests/data/hg-tag/snapcraft.yaml (+1/-0) integration-tests/data/local-plugin/snapcraft.yaml (+1/-0) integration-tests/data/local-source/snapcraft.yaml (+1/-0) integration-tests/data/simple-cmake/snapcraft.yaml (+1/-0) integration-tests/data/simple-copy/snapcraft.yaml (+1/-0) integration-tests/data/simple-make/snapcraft.yaml (+1/-0) integration-tests/data/simple-tar/snapcraft.yaml (+1/-0) schema/snapcraft.yaml (+5/-0) snapcraft/meta.py (+11/-0) snapcraft/tests/test_meta.py (+20/-8) snapcraft/tests/test_yaml.py (+30/-12) snapcraft/yaml.py (+8/-1) |
To merge this branch: | bzr merge lp:~sergiusens/snapcraft/icon-meta |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John Lenton (community) | Approve | ||
Leo Arias (community) | Needs Fixing | ||
Review via email: mp+269446@code.launchpad.net |
Commit message
icon support for snapcraft.yaml
Description of the change
- 154. By Sergio Schvezov
-
oops moment
Sergio Schvezov (sergiusens) wrote : | # |
doh, thanks, done
On Thu, Aug 27, 2015 at 7:51 PM, Leo Arias <email address hidden> wrote:
> Review: Needs Fixing
>
> You forgot to add the icon.png files for the integration-tests. They all
> fail with:
>
> Issues while validating snapcraft.yaml: 'icon.png' is not a 'icon-path'
>
> And you are missing the assertion on the copy call:
>
> + icon_path = os.path.
> + self.mock_
> icon_path)
>
> --
> https:/
> You are the owner of lp:~sergiusens/snapcraft/icon-meta.
>
> Launchpad-
> Launchpad-
> Launchpad-Branch: ~sergiusens/
> Launchpad-Project: snapcraft
>
- 155. By Sergio Schvezov
-
da icons
Preview Diff
1 | === added file 'examples/godd/icon.png' | |||
2 | 0 | Binary files examples/godd/icon.png 1970-01-01 00:00:00 +0000 and examples/godd/icon.png 2015-08-28 00:36:51 +0000 differ | 0 | Binary files examples/godd/icon.png 1970-01-01 00:00:00 +0000 and examples/godd/icon.png 2015-08-28 00:36:51 +0000 differ |
3 | === modified file 'examples/godd/snapcraft.yaml' | |||
4 | --- examples/godd/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
5 | +++ examples/godd/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
6 | @@ -5,6 +5,7 @@ | |||
7 | 5 | - name: ./bin/godd | 5 | - name: ./bin/godd |
8 | 6 | summary: Simple dd like tool | 6 | summary: Simple dd like tool |
9 | 7 | description: written in go so it is self contained and really portable, you would need to use hw-assign to access devices. | 7 | description: written in go so it is self contained and really portable, you would need to use hw-assign to access devices. |
10 | 8 | icon: icon.png | ||
11 | 8 | 9 | ||
12 | 9 | parts: | 10 | parts: |
13 | 10 | godd: | 11 | godd: |
14 | 11 | 12 | ||
15 | === added file 'examples/gopaste/icon.png' | |||
16 | 12 | Binary files examples/gopaste/icon.png 1970-01-01 00:00:00 +0000 and examples/gopaste/icon.png 2015-08-28 00:36:51 +0000 differ | 13 | Binary files examples/gopaste/icon.png 1970-01-01 00:00:00 +0000 and examples/gopaste/icon.png 2015-08-28 00:36:51 +0000 differ |
17 | === modified file 'examples/gopaste/snapcraft.yaml' | |||
18 | --- examples/gopaste/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
19 | +++ examples/gopaste/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
20 | @@ -7,6 +7,7 @@ | |||
21 | 7 | start: bin/gopaste | 7 | start: bin/gopaste |
22 | 8 | summary: Simple pasting tool | 8 | summary: Simple pasting tool |
23 | 9 | description: Runs a service that allows you to paste to and share. | 9 | description: Runs a service that allows you to paste to and share. |
24 | 10 | icon: icon.png | ||
25 | 10 | 11 | ||
26 | 11 | parts: | 12 | parts: |
27 | 12 | gopaste: | 13 | gopaste: |
28 | 13 | 14 | ||
29 | === added file 'examples/java-hello-world/icon.png' | |||
30 | 14 | Binary files examples/java-hello-world/icon.png 1970-01-01 00:00:00 +0000 and examples/java-hello-world/icon.png 2015-08-28 00:36:51 +0000 differ | 15 | Binary files examples/java-hello-world/icon.png 1970-01-01 00:00:00 +0000 and examples/java-hello-world/icon.png 2015-08-28 00:36:51 +0000 differ |
31 | === modified file 'examples/java-hello-world/snapcraft.yaml' | |||
32 | --- examples/java-hello-world/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
33 | +++ examples/java-hello-world/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
34 | @@ -6,6 +6,7 @@ | |||
35 | 6 | exec: bin/wrapper | 6 | exec: bin/wrapper |
36 | 7 | summary: A java exmaple | 7 | summary: A java exmaple |
37 | 8 | description: this is not much more than an example | 8 | description: this is not much more than an example |
38 | 9 | icon: icon.png | ||
39 | 9 | 10 | ||
40 | 10 | parts: | 11 | parts: |
41 | 11 | local: | 12 | local: |
42 | 12 | 13 | ||
43 | === added file 'examples/libpipeline/icon.png' | |||
44 | 13 | Binary files examples/libpipeline/icon.png 1970-01-01 00:00:00 +0000 and examples/libpipeline/icon.png 2015-08-28 00:36:51 +0000 differ | 14 | Binary files examples/libpipeline/icon.png 1970-01-01 00:00:00 +0000 and examples/libpipeline/icon.png 2015-08-28 00:36:51 +0000 differ |
45 | === modified file 'examples/libpipeline/snapcraft.yaml' | |||
46 | --- examples/libpipeline/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
47 | +++ examples/libpipeline/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
48 | @@ -5,6 +5,7 @@ | |||
49 | 5 | - name: ./bin/pipelinetest | 5 | - name: ./bin/pipelinetest |
50 | 6 | summary: Libpipeline example | 6 | summary: Libpipeline example |
51 | 7 | description: this is an example package of an autotools project built with snapcraft using | 7 | description: this is an example package of an autotools project built with snapcraft using |
52 | 8 | icon: icon.png | ||
53 | 8 | 9 | ||
54 | 9 | parts: | 10 | parts: |
55 | 10 | pipelinetest: | 11 | pipelinetest: |
56 | 11 | 12 | ||
57 | === added file 'examples/py2-project/icon.png' | |||
58 | 12 | Binary files examples/py2-project/icon.png 1970-01-01 00:00:00 +0000 and examples/py2-project/icon.png 2015-08-28 00:36:51 +0000 differ | 13 | Binary files examples/py2-project/icon.png 1970-01-01 00:00:00 +0000 and examples/py2-project/icon.png 2015-08-28 00:36:51 +0000 differ |
59 | === modified file 'examples/py2-project/snapcraft.yaml' | |||
60 | --- examples/py2-project/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
61 | +++ examples/py2-project/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
62 | @@ -5,6 +5,7 @@ | |||
63 | 5 | - name: ./bin/sha3sum | 5 | - name: ./bin/sha3sum |
64 | 6 | summary: A python sha3 implementation | 6 | summary: A python sha3 implementation |
65 | 7 | description: A python2 project using snapcraft | 7 | description: A python2 project using snapcraft |
66 | 8 | icon: icon.png | ||
67 | 8 | 9 | ||
68 | 9 | parts: | 10 | parts: |
69 | 10 | spongeshaker: | 11 | spongeshaker: |
70 | 11 | 12 | ||
71 | === added file 'examples/py3-project/icon.png' | |||
72 | 12 | Binary files examples/py3-project/icon.png 1970-01-01 00:00:00 +0000 and examples/py3-project/icon.png 2015-08-28 00:36:51 +0000 differ | 13 | Binary files examples/py3-project/icon.png 1970-01-01 00:00:00 +0000 and examples/py3-project/icon.png 2015-08-28 00:36:51 +0000 differ |
73 | === modified file 'examples/py3-project/snapcraft.yaml' | |||
74 | --- examples/py3-project/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
75 | +++ examples/py3-project/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
76 | @@ -5,6 +5,7 @@ | |||
77 | 5 | - name: bin/sha3sum | 5 | - name: bin/sha3sum |
78 | 6 | summary: A python sha3 implementation | 6 | summary: A python sha3 implementation |
79 | 7 | description: A python2 project using snapcraft | 7 | description: A python2 project using snapcraft |
80 | 8 | icon: icon.png | ||
81 | 8 | 9 | ||
82 | 9 | parts: | 10 | parts: |
83 | 10 | spongeshaker: | 11 | spongeshaker: |
84 | 11 | 12 | ||
85 | === added file 'examples/qmldemo/icon.png' | |||
86 | 12 | Binary files examples/qmldemo/icon.png 1970-01-01 00:00:00 +0000 and examples/qmldemo/icon.png 2015-08-28 00:36:51 +0000 differ | 13 | Binary files examples/qmldemo/icon.png 1970-01-01 00:00:00 +0000 and examples/qmldemo/icon.png 2015-08-28 00:36:51 +0000 differ |
87 | === modified file 'examples/qmldemo/snapcraft.yaml' | |||
88 | --- examples/qmldemo/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
89 | +++ examples/qmldemo/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
90 | @@ -11,6 +11,7 @@ | |||
91 | 11 | - network-client | 11 | - network-client |
92 | 12 | summary: qml demo | 12 | summary: qml demo |
93 | 13 | description: An example of shipping a usable QML file in a snap using the QML plugin. | 13 | description: An example of shipping a usable QML file in a snap using the QML plugin. |
94 | 14 | icon: icon.png | ||
95 | 14 | 15 | ||
96 | 15 | parts: | 16 | parts: |
97 | 16 | qml: | 17 | qml: |
98 | 17 | 18 | ||
99 | === added file 'examples/tomcat-maven-webapp/icon.png' | |||
100 | 18 | Binary files examples/tomcat-maven-webapp/icon.png 1970-01-01 00:00:00 +0000 and examples/tomcat-maven-webapp/icon.png 2015-08-28 00:36:51 +0000 differ | 19 | Binary files examples/tomcat-maven-webapp/icon.png 1970-01-01 00:00:00 +0000 and examples/tomcat-maven-webapp/icon.png 2015-08-28 00:36:51 +0000 differ |
101 | === modified file 'examples/tomcat-maven-webapp/snapcraft.yaml' | |||
102 | --- examples/tomcat-maven-webapp/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
103 | +++ examples/tomcat-maven-webapp/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
104 | @@ -11,6 +11,7 @@ | |||
105 | 11 | - network-service | 11 | - network-service |
106 | 12 | summary: Demo of Tomcat-hosted Webapp | 12 | summary: Demo of Tomcat-hosted Webapp |
107 | 13 | description: This is a demo snap of a Tomcat-hosted webapp produced by snapcraft with maven. | 13 | description: This is a demo snap of a Tomcat-hosted webapp produced by snapcraft with maven. |
108 | 14 | icon: icon.png | ||
109 | 14 | 15 | ||
110 | 15 | parts: | 16 | parts: |
111 | 16 | webapp: | 17 | webapp: |
112 | 17 | 18 | ||
113 | === added file 'examples/webcam-webui-snap/icon.png' | |||
114 | 18 | Binary files examples/webcam-webui-snap/icon.png 1970-01-01 00:00:00 +0000 and examples/webcam-webui-snap/icon.png 2015-08-28 00:36:51 +0000 differ | 19 | Binary files examples/webcam-webui-snap/icon.png 1970-01-01 00:00:00 +0000 and examples/webcam-webui-snap/icon.png 2015-08-28 00:36:51 +0000 differ |
115 | === modified file 'examples/webcam-webui-snap/snapcraft.yaml' | |||
116 | --- examples/webcam-webui-snap/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
117 | +++ examples/webcam-webui-snap/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
118 | @@ -7,6 +7,7 @@ | |||
119 | 7 | security-template: unconfined | 7 | security-template: unconfined |
120 | 8 | summary: Webcam web UI | 8 | summary: Webcam web UI |
121 | 9 | description: Exposes your webcam over a web UI | 9 | description: Exposes your webcam over a web UI |
122 | 10 | icon: icon.png | ||
123 | 10 | 11 | ||
124 | 11 | parts: | 12 | parts: |
125 | 12 | golang-static-http: | 13 | golang-static-http: |
126 | 13 | 14 | ||
127 | === added file 'examples/wget-deb/icon.png' | |||
128 | 14 | Binary files examples/wget-deb/icon.png 1970-01-01 00:00:00 +0000 and examples/wget-deb/icon.png 2015-08-28 00:36:51 +0000 differ | 15 | Binary files examples/wget-deb/icon.png 1970-01-01 00:00:00 +0000 and examples/wget-deb/icon.png 2015-08-28 00:36:51 +0000 differ |
129 | === modified file 'examples/wget-deb/snapcraft.yaml' | |||
130 | --- examples/wget-deb/snapcraft.yaml 2015-08-25 18:53:18 +0000 | |||
131 | +++ examples/wget-deb/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
132 | @@ -5,6 +5,7 @@ | |||
133 | 5 | - name: usr/bin/wget | 5 | - name: usr/bin/wget |
134 | 6 | summary: wget for snappy | 6 | summary: wget for snappy |
135 | 7 | description: a basic example from ubuntu packages | 7 | description: a basic example from ubuntu packages |
136 | 8 | icon: icon.png | ||
137 | 8 | 9 | ||
138 | 9 | parts: | 10 | parts: |
139 | 10 | wget: | 11 | wget: |
140 | 11 | 12 | ||
141 | === added file 'integration-tests/data/assemble/icon.png' | |||
142 | 12 | Binary files integration-tests/data/assemble/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/assemble/icon.png 2015-08-28 00:36:51 +0000 differ | 13 | Binary files integration-tests/data/assemble/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/assemble/icon.png 2015-08-28 00:36:51 +0000 differ |
143 | === modified file 'integration-tests/data/assemble/snapcraft.yaml' | |||
144 | --- integration-tests/data/assemble/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
145 | +++ integration-tests/data/assemble/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
146 | @@ -3,6 +3,7 @@ | |||
147 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
148 | 4 | summary: one line summary | 4 | summary: one line summary |
149 | 5 | description: a longer description | 5 | description: a longer description |
150 | 6 | icon: icon.png | ||
151 | 6 | binaries: | 7 | binaries: |
152 | 7 | - exec: binary1 | 8 | - exec: binary1 |
153 | 8 | name: assemble-bin | 9 | name: assemble-bin |
154 | 9 | 10 | ||
155 | === added file 'integration-tests/data/bzr-head/icon.png' | |||
156 | 10 | Binary files integration-tests/data/bzr-head/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/bzr-head/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/bzr-head/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/bzr-head/icon.png 2015-08-28 00:36:51 +0000 differ |
157 | === modified file 'integration-tests/data/bzr-head/snapcraft.yaml' | |||
158 | --- integration-tests/data/bzr-head/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
159 | +++ integration-tests/data/bzr-head/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
160 | @@ -3,6 +3,7 @@ | |||
161 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
162 | 4 | summary: one line summary | 4 | summary: one line summary |
163 | 5 | description: a longer description | 5 | description: a longer description |
164 | 6 | icon: icon.png | ||
165 | 6 | 7 | ||
166 | 7 | parts: | 8 | parts: |
167 | 8 | bzr: | 9 | bzr: |
168 | 9 | 10 | ||
169 | === added file 'integration-tests/data/bzr-tag/icon.png' | |||
170 | 10 | Binary files integration-tests/data/bzr-tag/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/bzr-tag/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/bzr-tag/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/bzr-tag/icon.png 2015-08-28 00:36:51 +0000 differ |
171 | === modified file 'integration-tests/data/bzr-tag/snapcraft.yaml' | |||
172 | --- integration-tests/data/bzr-tag/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
173 | +++ integration-tests/data/bzr-tag/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
174 | @@ -3,6 +3,7 @@ | |||
175 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
176 | 4 | summary: one line summary | 4 | summary: one line summary |
177 | 5 | description: a longer description | 5 | description: a longer description |
178 | 6 | icon: icon.png | ||
179 | 6 | 7 | ||
180 | 7 | parts: | 8 | parts: |
181 | 8 | bzr: | 9 | bzr: |
182 | 9 | 10 | ||
183 | === added file 'integration-tests/data/conflicts/icon.png' | |||
184 | 10 | Binary files integration-tests/data/conflicts/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/conflicts/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/conflicts/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/conflicts/icon.png 2015-08-28 00:36:51 +0000 differ |
185 | === modified file 'integration-tests/data/conflicts/snapcraft.yaml' | |||
186 | --- integration-tests/data/conflicts/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
187 | +++ integration-tests/data/conflicts/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
188 | @@ -3,6 +3,7 @@ | |||
189 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
190 | 4 | summary: one line summary | 4 | summary: one line summary |
191 | 5 | description: a longer description | 5 | description: a longer description |
192 | 6 | icon: icon.png | ||
193 | 6 | 7 | ||
194 | 7 | parts: | 8 | parts: |
195 | 8 | p1: | 9 | p1: |
196 | 9 | 10 | ||
197 | === added file 'integration-tests/data/dependencies/icon.png' | |||
198 | 10 | Binary files integration-tests/data/dependencies/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/dependencies/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/dependencies/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/dependencies/icon.png 2015-08-28 00:36:51 +0000 differ |
199 | === modified file 'integration-tests/data/dependencies/snapcraft.yaml' | |||
200 | --- integration-tests/data/dependencies/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
201 | +++ integration-tests/data/dependencies/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
202 | @@ -3,6 +3,7 @@ | |||
203 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
204 | 4 | summary: one line summary | 4 | summary: one line summary |
205 | 5 | description: a longer description | 5 | description: a longer description |
206 | 6 | icon: icon.png | ||
207 | 6 | 7 | ||
208 | 7 | parts: | 8 | parts: |
209 | 8 | p1: | 9 | p1: |
210 | 9 | 10 | ||
211 | === added file 'integration-tests/data/git-branch/icon.png' | |||
212 | 10 | Binary files integration-tests/data/git-branch/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/git-branch/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/git-branch/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/git-branch/icon.png 2015-08-28 00:36:51 +0000 differ |
213 | === modified file 'integration-tests/data/git-branch/snapcraft.yaml' | |||
214 | --- integration-tests/data/git-branch/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
215 | +++ integration-tests/data/git-branch/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
216 | @@ -3,6 +3,7 @@ | |||
217 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
218 | 4 | summary: one line summary | 4 | summary: one line summary |
219 | 5 | description: a longer description | 5 | description: a longer description |
220 | 6 | icon: icon.png | ||
221 | 6 | 7 | ||
222 | 7 | parts: | 8 | parts: |
223 | 8 | git: | 9 | git: |
224 | 9 | 10 | ||
225 | === added file 'integration-tests/data/git-head/icon.png' | |||
226 | 10 | Binary files integration-tests/data/git-head/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/git-head/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/git-head/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/git-head/icon.png 2015-08-28 00:36:51 +0000 differ |
227 | === modified file 'integration-tests/data/git-head/snapcraft.yaml' | |||
228 | --- integration-tests/data/git-head/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
229 | +++ integration-tests/data/git-head/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
230 | @@ -3,6 +3,7 @@ | |||
231 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
232 | 4 | summary: one line summary | 4 | summary: one line summary |
233 | 5 | description: a longer description | 5 | description: a longer description |
234 | 6 | icon: icon.png | ||
235 | 6 | 7 | ||
236 | 7 | parts: | 8 | parts: |
237 | 8 | git: | 9 | git: |
238 | 9 | 10 | ||
239 | === added file 'integration-tests/data/git-tag/icon.png' | |||
240 | 10 | Binary files integration-tests/data/git-tag/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/git-tag/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/git-tag/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/git-tag/icon.png 2015-08-28 00:36:51 +0000 differ |
241 | === modified file 'integration-tests/data/git-tag/snapcraft.yaml' | |||
242 | --- integration-tests/data/git-tag/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
243 | +++ integration-tests/data/git-tag/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
244 | @@ -3,6 +3,7 @@ | |||
245 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
246 | 4 | summary: one line summary | 4 | summary: one line summary |
247 | 5 | description: a longer description | 5 | description: a longer description |
248 | 6 | icon: icon.png | ||
249 | 6 | 7 | ||
250 | 7 | parts: | 8 | parts: |
251 | 8 | git: | 9 | git: |
252 | 9 | 10 | ||
253 | === added file 'integration-tests/data/hg-branch/icon.png' | |||
254 | 10 | Binary files integration-tests/data/hg-branch/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/hg-branch/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/hg-branch/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/hg-branch/icon.png 2015-08-28 00:36:51 +0000 differ |
255 | === modified file 'integration-tests/data/hg-branch/snapcraft.yaml' | |||
256 | --- integration-tests/data/hg-branch/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
257 | +++ integration-tests/data/hg-branch/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
258 | @@ -3,6 +3,7 @@ | |||
259 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
260 | 4 | summary: one line summary | 4 | summary: one line summary |
261 | 5 | description: a longer description | 5 | description: a longer description |
262 | 6 | icon: icon.png | ||
263 | 6 | 7 | ||
264 | 7 | parts: | 8 | parts: |
265 | 8 | mercurial: | 9 | mercurial: |
266 | 9 | 10 | ||
267 | === added file 'integration-tests/data/hg-head/icon.png' | |||
268 | 10 | Binary files integration-tests/data/hg-head/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/hg-head/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/hg-head/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/hg-head/icon.png 2015-08-28 00:36:51 +0000 differ |
269 | === modified file 'integration-tests/data/hg-head/snapcraft.yaml' | |||
270 | --- integration-tests/data/hg-head/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
271 | +++ integration-tests/data/hg-head/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
272 | @@ -3,6 +3,7 @@ | |||
273 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
274 | 4 | summary: one line summary | 4 | summary: one line summary |
275 | 5 | description: a longer description | 5 | description: a longer description |
276 | 6 | icon: icon.png | ||
277 | 6 | 7 | ||
278 | 7 | parts: | 8 | parts: |
279 | 8 | mercurial: | 9 | mercurial: |
280 | 9 | 10 | ||
281 | === added file 'integration-tests/data/hg-tag/icon.png' | |||
282 | 10 | Binary files integration-tests/data/hg-tag/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/hg-tag/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/hg-tag/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/hg-tag/icon.png 2015-08-28 00:36:51 +0000 differ |
283 | === modified file 'integration-tests/data/hg-tag/snapcraft.yaml' | |||
284 | --- integration-tests/data/hg-tag/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
285 | +++ integration-tests/data/hg-tag/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
286 | @@ -3,6 +3,7 @@ | |||
287 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
288 | 4 | summary: one line summary | 4 | summary: one line summary |
289 | 5 | description: a longer description | 5 | description: a longer description |
290 | 6 | icon: icon.png | ||
291 | 6 | 7 | ||
292 | 7 | parts: | 8 | parts: |
293 | 8 | mercurial: | 9 | mercurial: |
294 | 9 | 10 | ||
295 | === added file 'integration-tests/data/local-plugin/icon.png' | |||
296 | 10 | Binary files integration-tests/data/local-plugin/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/local-plugin/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/local-plugin/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/local-plugin/icon.png 2015-08-28 00:36:51 +0000 differ |
297 | === modified file 'integration-tests/data/local-plugin/snapcraft.yaml' | |||
298 | --- integration-tests/data/local-plugin/snapcraft.yaml 2015-08-25 20:40:26 +0000 | |||
299 | +++ integration-tests/data/local-plugin/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
300 | @@ -3,6 +3,7 @@ | |||
301 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
302 | 4 | summary: one line summary | 4 | summary: one line summary |
303 | 5 | description: a longer description | 5 | description: a longer description |
304 | 6 | icon: icon.png | ||
305 | 6 | 7 | ||
306 | 7 | parts: | 8 | parts: |
307 | 8 | x-local-plugin: | 9 | x-local-plugin: |
308 | 9 | 10 | ||
309 | === added file 'integration-tests/data/local-source/icon.png' | |||
310 | 10 | Binary files integration-tests/data/local-source/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/local-source/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/local-source/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/local-source/icon.png 2015-08-28 00:36:51 +0000 differ |
311 | === modified file 'integration-tests/data/local-source/snapcraft.yaml' | |||
312 | --- integration-tests/data/local-source/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
313 | +++ integration-tests/data/local-source/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
314 | @@ -3,6 +3,7 @@ | |||
315 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
316 | 4 | summary: one line summary | 4 | summary: one line summary |
317 | 5 | description: a longer description | 5 | description: a longer description |
318 | 6 | icon: icon.png | ||
319 | 6 | 7 | ||
320 | 7 | parts: | 8 | parts: |
321 | 8 | make-project: | 9 | make-project: |
322 | 9 | 10 | ||
323 | === added file 'integration-tests/data/simple-cmake/icon.png' | |||
324 | 10 | Binary files integration-tests/data/simple-cmake/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-cmake/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/simple-cmake/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-cmake/icon.png 2015-08-28 00:36:51 +0000 differ |
325 | === modified file 'integration-tests/data/simple-cmake/snapcraft.yaml' | |||
326 | --- integration-tests/data/simple-cmake/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
327 | +++ integration-tests/data/simple-cmake/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
328 | @@ -3,6 +3,7 @@ | |||
329 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
330 | 4 | summary: one line summary | 4 | summary: one line summary |
331 | 5 | description: a longer description | 5 | description: a longer description |
332 | 6 | icon: icon.png | ||
333 | 6 | 7 | ||
334 | 7 | parts: | 8 | parts: |
335 | 8 | cmake-project: | 9 | cmake-project: |
336 | 9 | 10 | ||
337 | === added file 'integration-tests/data/simple-copy/icon.png' | |||
338 | 10 | Binary files integration-tests/data/simple-copy/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-copy/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/simple-copy/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-copy/icon.png 2015-08-28 00:36:51 +0000 differ |
339 | === modified file 'integration-tests/data/simple-copy/snapcraft.yaml' | |||
340 | --- integration-tests/data/simple-copy/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
341 | +++ integration-tests/data/simple-copy/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
342 | @@ -3,6 +3,7 @@ | |||
343 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
344 | 4 | summary: one line summary | 4 | summary: one line summary |
345 | 5 | description: a longer description | 5 | description: a longer description |
346 | 6 | icon: icon.png | ||
347 | 6 | 7 | ||
348 | 7 | parts: | 8 | parts: |
349 | 8 | copy-example: | 9 | copy-example: |
350 | 9 | 10 | ||
351 | === added file 'integration-tests/data/simple-make/icon.png' | |||
352 | 10 | Binary files integration-tests/data/simple-make/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-make/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/simple-make/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-make/icon.png 2015-08-28 00:36:51 +0000 differ |
353 | === modified file 'integration-tests/data/simple-make/snapcraft.yaml' | |||
354 | --- integration-tests/data/simple-make/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
355 | +++ integration-tests/data/simple-make/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
356 | @@ -3,6 +3,7 @@ | |||
357 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
358 | 4 | summary: one line summary | 4 | summary: one line summary |
359 | 5 | description: a longer description | 5 | description: a longer description |
360 | 6 | icon: icon.png | ||
361 | 6 | 7 | ||
362 | 7 | parts: | 8 | parts: |
363 | 8 | make-project: | 9 | make-project: |
364 | 9 | 10 | ||
365 | === added file 'integration-tests/data/simple-tar/icon.png' | |||
366 | 10 | Binary files integration-tests/data/simple-tar/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-tar/icon.png 2015-08-28 00:36:51 +0000 differ | 11 | Binary files integration-tests/data/simple-tar/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/simple-tar/icon.png 2015-08-28 00:36:51 +0000 differ |
367 | === modified file 'integration-tests/data/simple-tar/snapcraft.yaml' | |||
368 | --- integration-tests/data/simple-tar/snapcraft.yaml 2015-08-24 18:27:50 +0000 | |||
369 | +++ integration-tests/data/simple-tar/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
370 | @@ -3,6 +3,7 @@ | |||
371 | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> | 3 | vendor: Sergio Schvezov <sergio.schvezov@canonical.com> |
372 | 4 | summary: one line summary | 4 | summary: one line summary |
373 | 5 | description: a longer description | 5 | description: a longer description |
374 | 6 | icon: icon.png | ||
375 | 6 | 7 | ||
376 | 7 | parts: | 8 | parts: |
377 | 8 | oneflat: | 9 | oneflat: |
378 | 9 | 10 | ||
379 | === modified file 'schema/snapcraft.yaml' | |||
380 | --- schema/snapcraft.yaml 2015-08-26 18:33:20 +0000 | |||
381 | +++ schema/snapcraft.yaml 2015-08-28 00:36:51 +0000 | |||
382 | @@ -15,6 +15,10 @@ | |||
383 | 15 | vendor: | 15 | vendor: |
384 | 16 | type: string | 16 | type: string |
385 | 17 | format: email | 17 | format: email |
386 | 18 | icon: | ||
387 | 19 | type: string | ||
388 | 20 | description: path to a 512x512 icon representing the package. | ||
389 | 21 | format: icon-path | ||
390 | 18 | summary: | 22 | summary: |
391 | 19 | type: string | 23 | type: string |
392 | 20 | description: one line summary for the package | 24 | description: one line summary for the package |
393 | @@ -86,4 +90,5 @@ | |||
394 | 86 | - vendor | 90 | - vendor |
395 | 87 | - summary | 91 | - summary |
396 | 88 | - description | 92 | - description |
397 | 93 | - icon | ||
398 | 89 | - parts | 94 | - parts |
399 | 90 | 95 | ||
400 | === modified file 'snapcraft/meta.py' | |||
401 | --- snapcraft/meta.py 2015-08-26 12:11:33 +0000 | |||
402 | +++ snapcraft/meta.py 2015-08-28 00:36:51 +0000 | |||
403 | @@ -17,6 +17,7 @@ | |||
404 | 17 | import os | 17 | import os |
405 | 18 | import logging | 18 | import logging |
406 | 19 | import shlex | 19 | import shlex |
407 | 20 | import shutil | ||
408 | 20 | import tempfile | 21 | import tempfile |
409 | 21 | import yaml | 22 | import yaml |
410 | 22 | 23 | ||
411 | @@ -29,6 +30,7 @@ | |||
412 | 29 | 'name', | 30 | 'name', |
413 | 30 | 'version', | 31 | 'version', |
414 | 31 | 'vendor', | 32 | 'vendor', |
415 | 33 | 'icon', | ||
416 | 32 | ] | 34 | ] |
417 | 33 | 35 | ||
418 | 34 | _OPTIONAL_PACKAGE_KEYS = [ | 36 | _OPTIONAL_PACKAGE_KEYS = [ |
419 | @@ -50,6 +52,8 @@ | |||
420 | 50 | meta_dir = os.path.join(common.get_snapdir(), 'meta') | 52 | meta_dir = os.path.join(common.get_snapdir(), 'meta') |
421 | 51 | os.makedirs(meta_dir, exist_ok=True) | 53 | os.makedirs(meta_dir, exist_ok=True) |
422 | 52 | 54 | ||
423 | 55 | config_data['icon'] = _copy_icon(meta_dir, config_data['icon']) | ||
424 | 56 | |||
425 | 53 | _write_package_yaml(meta_dir, config_data, arches) | 57 | _write_package_yaml(meta_dir, config_data, arches) |
426 | 54 | _write_readme_md(meta_dir, config_data) | 58 | _write_readme_md(meta_dir, config_data) |
427 | 55 | 59 | ||
428 | @@ -72,6 +76,13 @@ | |||
429 | 72 | f.write(readme_md) | 76 | f.write(readme_md) |
430 | 73 | 77 | ||
431 | 74 | 78 | ||
432 | 79 | def _copy_icon(meta_dir, icon_path): | ||
433 | 80 | new_icon_path = os.path.join(meta_dir, os.path.basename(icon_path)) | ||
434 | 81 | shutil.copyfile(icon_path, new_icon_path) | ||
435 | 82 | |||
436 | 83 | return os.path.join('meta', os.path.basename(icon_path)) | ||
437 | 84 | |||
438 | 85 | |||
439 | 75 | def _compose_package_yaml(config_data, arches): | 86 | def _compose_package_yaml(config_data, arches): |
440 | 76 | ''' | 87 | ''' |
441 | 77 | Creates a dictionary that can be used to yaml.dump a package.yaml using | 88 | Creates a dictionary that can be used to yaml.dump a package.yaml using |
442 | 78 | 89 | ||
443 | === modified file 'snapcraft/tests/test_meta.py' | |||
444 | --- snapcraft/tests/test_meta.py 2015-08-26 16:05:34 +0000 | |||
445 | +++ snapcraft/tests/test_meta.py 2015-08-28 00:36:51 +0000 | |||
446 | @@ -16,7 +16,6 @@ | |||
447 | 16 | 16 | ||
448 | 17 | import os | 17 | import os |
449 | 18 | from unittest.mock import ( | 18 | from unittest.mock import ( |
450 | 19 | Mock, | ||
451 | 20 | call, | 19 | call, |
452 | 21 | mock_open, | 20 | mock_open, |
453 | 22 | patch, | 21 | patch, |
454 | @@ -42,6 +41,7 @@ | |||
455 | 42 | 'name': 'my-package', | 41 | 'name': 'my-package', |
456 | 43 | 'version': '1.0', | 42 | 'version': '1.0', |
457 | 44 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 43 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
458 | 44 | 'icon': 'my-icon.png', | ||
459 | 45 | } | 45 | } |
460 | 46 | 46 | ||
461 | 47 | def test_plain_no_binaries_or_services(self): | 47 | def test_plain_no_binaries_or_services(self): |
462 | @@ -52,6 +52,7 @@ | |||
463 | 52 | 'name': 'my-package', | 52 | 'name': 'my-package', |
464 | 53 | 'version': '1.0', | 53 | 'version': '1.0', |
465 | 54 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 54 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
466 | 55 | 'icon': 'my-icon.png', | ||
467 | 55 | 'architectures': ['armhf', 'amd64'], | 56 | 'architectures': ['armhf', 'amd64'], |
468 | 56 | } | 57 | } |
469 | 57 | 58 | ||
470 | @@ -65,6 +66,7 @@ | |||
471 | 65 | 'name': 'my-package', | 66 | 'name': 'my-package', |
472 | 66 | 'version': '1.0', | 67 | 'version': '1.0', |
473 | 67 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 68 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
474 | 69 | 'icon': 'my-icon.png', | ||
475 | 68 | } | 70 | } |
476 | 69 | 71 | ||
477 | 70 | self.assertEqual(y, expected) | 72 | self.assertEqual(y, expected) |
478 | @@ -86,6 +88,7 @@ | |||
479 | 86 | 'name': 'my-package', | 88 | 'name': 'my-package', |
480 | 87 | 'version': '1.0', | 89 | 'version': '1.0', |
481 | 88 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 90 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
482 | 91 | 'icon': 'my-icon.png', | ||
483 | 89 | 'architectures': ['armhf', 'amd64'], | 92 | 'architectures': ['armhf', 'amd64'], |
484 | 90 | 'binaries': [ | 93 | 'binaries': [ |
485 | 91 | { | 94 | { |
486 | @@ -123,6 +126,7 @@ | |||
487 | 123 | 'name': 'my-package', | 126 | 'name': 'my-package', |
488 | 124 | 'version': '1.0', | 127 | 'version': '1.0', |
489 | 125 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 128 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
490 | 129 | 'icon': 'my-icon.png', | ||
491 | 126 | 'architectures': ['armhf', 'amd64'], | 130 | 'architectures': ['armhf', 'amd64'], |
492 | 127 | 'services': [ | 131 | 'services': [ |
493 | 128 | { | 132 | { |
494 | @@ -151,6 +155,7 @@ | |||
495 | 151 | 'name': 'my-package', | 155 | 'name': 'my-package', |
496 | 152 | 'version': '1.0', | 156 | 'version': '1.0', |
497 | 153 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 157 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
498 | 158 | 'icon': 'my-icon.png', | ||
499 | 154 | 'architectures': ['armhf', 'amd64'], | 159 | 'architectures': ['armhf', 'amd64'], |
500 | 155 | 'frameworks': ['mir', ], | 160 | 'frameworks': ['mir', ], |
501 | 156 | } | 161 | } |
502 | @@ -173,7 +178,13 @@ | |||
503 | 173 | 178 | ||
504 | 174 | def setUp(self): | 179 | def setUp(self): |
505 | 175 | super().setUp() | 180 | super().setUp() |
507 | 176 | self.orig_os_makedirs = os.makedirs | 181 | patcher_makedirs = patch('os.makedirs') |
508 | 182 | self.mock_makedirs = patcher_makedirs.start() | ||
509 | 183 | self.addCleanup(patcher_makedirs.stop) | ||
510 | 184 | |||
511 | 185 | patcher_copyfile = patch('shutil.copyfile') | ||
512 | 186 | self.mock_copyfile = patcher_copyfile.start() | ||
513 | 187 | self.addCleanup(patcher_copyfile.stop) | ||
514 | 177 | 188 | ||
515 | 178 | self.config_data = { | 189 | self.config_data = { |
516 | 179 | 'name': 'my-package', | 190 | 'name': 'my-package', |
517 | @@ -181,14 +192,10 @@ | |||
518 | 181 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', | 192 | 'vendor': 'Sergio Schvezov <sergio.schvezov@canonical.com>', |
519 | 182 | 'description': 'my description', | 193 | 'description': 'my description', |
520 | 183 | 'summary': 'my summary', | 194 | 'summary': 'my summary', |
521 | 195 | 'icon': 'my-icon.png', | ||
522 | 184 | } | 196 | } |
523 | 185 | 197 | ||
524 | 186 | def tearDown(self): | ||
525 | 187 | super().tearDown() | ||
526 | 188 | os.makedirs = self.orig_os_makedirs | ||
527 | 189 | |||
528 | 190 | def test_create_meta(self): | 198 | def test_create_meta(self): |
529 | 191 | os.makedirs = Mock() | ||
530 | 192 | mock_the_open = mock_open() | 199 | mock_the_open = mock_open() |
531 | 193 | 200 | ||
532 | 194 | with patch('snapcraft.meta.open', mock_the_open, create=True): | 201 | with patch('snapcraft.meta.open', mock_the_open, create=True): |
533 | @@ -196,7 +203,7 @@ | |||
534 | 196 | 203 | ||
535 | 197 | meta_dir = os.path.join(os.path.abspath(os.curdir), 'snap', 'meta') | 204 | meta_dir = os.path.join(os.path.abspath(os.curdir), 'snap', 'meta') |
536 | 198 | 205 | ||
538 | 199 | os.makedirs.assert_called_once_with(meta_dir, exist_ok=True) | 206 | self.mock_makedirs.assert_called_once_with(meta_dir, exist_ok=True) |
539 | 200 | 207 | ||
540 | 201 | mock_the_open.assert_has_calls([ | 208 | mock_the_open.assert_has_calls([ |
541 | 202 | call(os.path.join(meta_dir, 'package.yaml'), 'w'), | 209 | call(os.path.join(meta_dir, 'package.yaml'), 'w'), |
542 | @@ -208,6 +215,11 @@ | |||
543 | 208 | call().write(' '), | 215 | call().write(' '), |
544 | 209 | call().write('amd64'), | 216 | call().write('amd64'), |
545 | 210 | call().write('\n'), | 217 | call().write('\n'), |
546 | 218 | call().write('icon'), | ||
547 | 219 | call().write(':'), | ||
548 | 220 | call().write(' '), | ||
549 | 221 | call().write('meta/my-icon.png'), | ||
550 | 222 | call().write('\n'), | ||
551 | 211 | call().write('name'), | 223 | call().write('name'), |
552 | 212 | call().write(':'), | 224 | call().write(':'), |
553 | 213 | call().write(' '), | 225 | call().write(' '), |
554 | 214 | 226 | ||
555 | === modified file 'snapcraft/tests/test_yaml.py' | |||
556 | --- snapcraft/tests/test_yaml.py 2015-08-27 13:00:16 +0000 | |||
557 | +++ snapcraft/tests/test_yaml.py 2015-08-28 00:36:51 +0000 | |||
558 | @@ -31,6 +31,15 @@ | |||
559 | 31 | 31 | ||
560 | 32 | class TestYaml(TestCase): | 32 | class TestYaml(TestCase): |
561 | 33 | 33 | ||
562 | 34 | def setUp(self): | ||
563 | 35 | super().setUp() | ||
564 | 36 | dirs.setup_dirs() | ||
565 | 37 | |||
566 | 38 | patcher = unittest.mock.patch('os.path.exists') | ||
567 | 39 | mock_wrap_exe = patcher.start() | ||
568 | 40 | mock_wrap_exe.return_value = True | ||
569 | 41 | self.addCleanup(patcher.stop) | ||
570 | 42 | |||
571 | 34 | def make_snapcraft_yaml(self, content): | 43 | def make_snapcraft_yaml(self, content): |
572 | 35 | tempdirObj = tempfile.TemporaryDirectory() | 44 | tempdirObj = tempfile.TemporaryDirectory() |
573 | 36 | self.addCleanup(tempdirObj.cleanup) | 45 | self.addCleanup(tempdirObj.cleanup) |
574 | @@ -40,13 +49,12 @@ | |||
575 | 40 | 49 | ||
576 | 41 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') | 50 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') |
577 | 42 | def test_config_loads_plugins(self, mock_loadPlugin): | 51 | def test_config_loads_plugins(self, mock_loadPlugin): |
578 | 43 | dirs.setup_dirs() | ||
579 | 44 | |||
580 | 45 | self.make_snapcraft_yaml("""name: test | 52 | self.make_snapcraft_yaml("""name: test |
581 | 46 | version: "1" | 53 | version: "1" |
582 | 47 | vendor: me <me@me.com> | 54 | vendor: me <me@me.com> |
583 | 48 | summary: test | 55 | summary: test |
584 | 49 | description: test | 56 | description: test |
585 | 57 | icon: my-icon.png | ||
586 | 50 | 58 | ||
587 | 51 | parts: | 59 | parts: |
588 | 52 | ubuntu: | 60 | ubuntu: |
589 | @@ -72,8 +80,6 @@ | |||
590 | 72 | fake_logger.output) | 80 | fake_logger.output) |
591 | 73 | 81 | ||
592 | 74 | def test_config_loop(self): | 82 | def test_config_loop(self): |
593 | 75 | dirs.setup_dirs() | ||
594 | 76 | |||
595 | 77 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) | 83 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) |
596 | 78 | self.useFixture(fake_logger) | 84 | self.useFixture(fake_logger) |
597 | 79 | 85 | ||
598 | @@ -82,6 +88,7 @@ | |||
599 | 82 | vendor: me <me@me.com> | 88 | vendor: me <me@me.com> |
600 | 83 | summary: test | 89 | summary: test |
601 | 84 | description: test | 90 | description: test |
602 | 91 | icon: my-icon.png | ||
603 | 85 | 92 | ||
604 | 86 | parts: | 93 | parts: |
605 | 87 | p1: | 94 | p1: |
606 | @@ -99,8 +106,6 @@ | |||
607 | 99 | 106 | ||
608 | 100 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') | 107 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') |
609 | 101 | def test_invalid_yaml_missing_name(self, mock_loadPlugin): | 108 | def test_invalid_yaml_missing_name(self, mock_loadPlugin): |
610 | 102 | dirs.setup_dirs() | ||
611 | 103 | |||
612 | 104 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) | 109 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) |
613 | 105 | self.useFixture(fake_logger) | 110 | self.useFixture(fake_logger) |
614 | 106 | 111 | ||
615 | @@ -109,6 +114,7 @@ | |||
616 | 109 | vendor: me <me@me.com> | 114 | vendor: me <me@me.com> |
617 | 110 | summary: test | 115 | summary: test |
618 | 111 | description: nothing | 116 | description: nothing |
619 | 117 | icon: my-icon.png | ||
620 | 112 | 118 | ||
621 | 113 | parts: | 119 | parts: |
622 | 114 | ubuntu: | 120 | ubuntu: |
623 | @@ -124,8 +130,6 @@ | |||
624 | 124 | 130 | ||
625 | 125 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') | 131 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') |
626 | 126 | def test_invalid_yaml_invalid_name_as_number(self, mock_loadPlugin): | 132 | def test_invalid_yaml_invalid_name_as_number(self, mock_loadPlugin): |
627 | 127 | dirs.setup_dirs() | ||
628 | 128 | |||
629 | 129 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) | 133 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) |
630 | 130 | self.useFixture(fake_logger) | 134 | self.useFixture(fake_logger) |
631 | 131 | 135 | ||
632 | @@ -134,6 +138,7 @@ | |||
633 | 134 | vendor: me <me@me.com> | 138 | vendor: me <me@me.com> |
634 | 135 | summary: test | 139 | summary: test |
635 | 136 | description: nothing | 140 | description: nothing |
636 | 141 | icon: my-icon.png | ||
637 | 137 | 142 | ||
638 | 138 | parts: | 143 | parts: |
639 | 139 | ubuntu: | 144 | ubuntu: |
640 | @@ -149,8 +154,6 @@ | |||
641 | 149 | 154 | ||
642 | 150 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') | 155 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') |
643 | 151 | def test_invalid_yaml_invalid_name_chars(self, mock_loadPlugin): | 156 | def test_invalid_yaml_invalid_name_chars(self, mock_loadPlugin): |
644 | 152 | dirs.setup_dirs() | ||
645 | 153 | |||
646 | 154 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) | 157 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) |
647 | 155 | self.useFixture(fake_logger) | 158 | self.useFixture(fake_logger) |
648 | 156 | 159 | ||
649 | @@ -159,6 +162,7 @@ | |||
650 | 159 | vendor: me <me@me.com> | 162 | vendor: me <me@me.com> |
651 | 160 | summary: test | 163 | summary: test |
652 | 161 | description: nothing | 164 | description: nothing |
653 | 165 | icon: my-icon.png | ||
654 | 162 | 166 | ||
655 | 163 | parts: | 167 | parts: |
656 | 164 | ubuntu: | 168 | ubuntu: |
657 | @@ -174,8 +178,6 @@ | |||
658 | 174 | 178 | ||
659 | 175 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') | 179 | @unittest.mock.patch('snapcraft.yaml.Config.load_plugin') |
660 | 176 | def test_invalid_yaml_missing_description(self, mock_loadPlugin): | 180 | def test_invalid_yaml_missing_description(self, mock_loadPlugin): |
661 | 177 | dirs.setup_dirs() | ||
662 | 178 | |||
663 | 179 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) | 181 | fake_logger = fixtures.FakeLogger(level=logging.ERROR) |
664 | 180 | self.useFixture(fake_logger) | 182 | self.useFixture(fake_logger) |
665 | 181 | 183 | ||
666 | @@ -183,6 +185,7 @@ | |||
667 | 183 | version: "1" | 185 | version: "1" |
668 | 184 | vendor: me <me@me.com> | 186 | vendor: me <me@me.com> |
669 | 185 | summary: test | 187 | summary: test |
670 | 188 | icon: my-icon.png | ||
671 | 186 | 189 | ||
672 | 187 | parts: | 190 | parts: |
673 | 188 | ubuntu: | 191 | ubuntu: |
674 | @@ -203,12 +206,18 @@ | |||
675 | 203 | super().setUp() | 206 | super().setUp() |
676 | 204 | dirs.setup_dirs() | 207 | dirs.setup_dirs() |
677 | 205 | 208 | ||
678 | 209 | patcher = unittest.mock.patch('os.path.exists') | ||
679 | 210 | self.mock_path_exists = patcher.start() | ||
680 | 211 | self.mock_path_exists.return_value = True | ||
681 | 212 | self.addCleanup(patcher.stop) | ||
682 | 213 | |||
683 | 206 | self.data = { | 214 | self.data = { |
684 | 207 | 'name': 'my-package-1', | 215 | 'name': 'my-package-1', |
685 | 208 | 'version': '1.0-snapcraft1~ppa1', | 216 | 'version': '1.0-snapcraft1~ppa1', |
686 | 209 | 'vendor': 'Me <me@me.com>', | 217 | 'vendor': 'Me <me@me.com>', |
687 | 210 | 'summary': 'my summary less that 79 chars', | 218 | 'summary': 'my summary less that 79 chars', |
688 | 211 | 'description': 'description which can be pretty long', | 219 | 'description': 'description which can be pretty long', |
689 | 220 | 'icon': 'my-icon.png', | ||
690 | 212 | 'parts': { | 221 | 'parts': { |
691 | 213 | 'part1': { | 222 | 'part1': { |
692 | 214 | 'type': 'project', | 223 | 'type': 'project', |
693 | @@ -324,3 +333,12 @@ | |||
694 | 324 | mock_the_open.assert_called_once_with(expected_path) | 333 | mock_the_open.assert_called_once_with(expected_path) |
695 | 325 | expected_message = 'Schema is missing, could not validate snapcraft.yaml, check installation' | 334 | expected_message = 'Schema is missing, could not validate snapcraft.yaml, check installation' |
696 | 326 | self.assertEqual(raised.exception.message, expected_message) | 335 | self.assertEqual(raised.exception.message, expected_message) |
697 | 336 | |||
698 | 337 | def test_icon_missing(self): | ||
699 | 338 | self.mock_path_exists.return_value = False | ||
700 | 339 | |||
701 | 340 | with self.assertRaises(jsonschema.ValidationError) as raised: | ||
702 | 341 | snapcraft.yaml._validate_snapcraft_yaml(self.data) | ||
703 | 342 | |||
704 | 343 | expected_message = '\'my-icon.png\' is not a \'icon-path\'' | ||
705 | 344 | self.assertEqual(raised.exception.message, expected_message, msg=self.data) | ||
706 | 327 | 345 | ||
707 | === modified file 'snapcraft/yaml.py' | |||
708 | --- snapcraft/yaml.py 2015-08-27 16:37:32 +0000 | |||
709 | +++ snapcraft/yaml.py 2015-08-28 00:36:51 +0000 | |||
710 | @@ -20,6 +20,7 @@ | |||
711 | 20 | import yaml | 20 | import yaml |
712 | 21 | import jsonschema | 21 | import jsonschema |
713 | 22 | import os | 22 | import os |
714 | 23 | import os.path | ||
715 | 23 | 24 | ||
716 | 24 | import snapcraft.plugin | 25 | import snapcraft.plugin |
717 | 25 | from snapcraft import common | 26 | from snapcraft import common |
718 | @@ -28,6 +29,11 @@ | |||
719 | 28 | logger = logging.getLogger(__name__) | 29 | logger = logging.getLogger(__name__) |
720 | 29 | 30 | ||
721 | 30 | 31 | ||
722 | 32 | @jsonschema.FormatChecker.cls_checks('icon-path') | ||
723 | 33 | def _validate_file_exists(instance): | ||
724 | 34 | return os.path.exists(instance) | ||
725 | 35 | |||
726 | 36 | |||
727 | 31 | class SchemaNotFoundError(Exception): | 37 | class SchemaNotFoundError(Exception): |
728 | 32 | 38 | ||
729 | 33 | def __init__(self, message): | 39 | def __init__(self, message): |
730 | @@ -43,7 +49,8 @@ | |||
731 | 43 | except FileNotFoundError: | 49 | except FileNotFoundError: |
732 | 44 | raise SchemaNotFoundError('Schema is missing, could not validate snapcraft.yaml, check installation') | 50 | raise SchemaNotFoundError('Schema is missing, could not validate snapcraft.yaml, check installation') |
733 | 45 | 51 | ||
735 | 46 | jsonschema.validate(snapcraft_yaml, schema) | 52 | format_check = jsonschema.FormatChecker() |
736 | 53 | jsonschema.validate(snapcraft_yaml, schema, format_checker=format_check) | ||
737 | 47 | 54 | ||
738 | 48 | 55 | ||
739 | 49 | class Config: | 56 | class Config: |
You forgot to add the icon.png files for the integration-tests. They all fail with:
Issues while validating snapcraft.yaml: 'icon.png' is not a 'icon-path'
And you are missing the assertion on the copy call:
+ icon_path = os.path. join(meta_ dir, 'my-icon.png') copyfile. assert_ called_ once_with( 'my-icon. png', icon_path)
+ self.mock_