Merge lp:~sergiusens/snapcraft/1501496 into lp:~snappy-dev/snapcraft/core
- 1501496
- Merge into core
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Sergio Schvezov | ||||
Approved revision: | 226 | ||||
Merged at revision: | 225 | ||||
Proposed branch: | lp:~sergiusens/snapcraft/1501496 | ||||
Merge into: | lp:~snappy-dev/snapcraft/core | ||||
Diff against target: |
648 lines (+94/-67) 24 files modified
docs/snapcraft-advanced-features.md (+30/-30) docs/your-first-snap.md (+5/-5) examples/downloader-with-wiki-parts/snapcraft.yaml (+1/-1) examples/godd/snapcraft.yaml (+2/-2) examples/gopaste/snapcraft.yaml (+1/-1) examples/java-hello-world/snapcraft.yaml (+2/-2) examples/libpipeline/snapcraft.yaml (+2/-2) examples/py2-project/snapcraft.yaml (+1/-1) examples/py3-project/snapcraft.yaml (+1/-1) examples/tomcat-maven-webapp/snapcraft.yaml (+2/-2) integration-tests/data/dependencies/snapcraft.yaml (+3/-3) integration-tests/data/simple-scons/snapcraft.yaml (+1/-1) plugins/go.yaml (+0/-2) plugins/readline.yaml (+1/-1) snapcraft/plugins/ant.py (+1/-1) snapcraft/plugins/autotools.py (+1/-1) snapcraft/plugins/cmake.py (+1/-1) snapcraft/plugins/go.py (+8/-1) snapcraft/plugins/python2.py (+1/-1) snapcraft/plugins/python3.py (+1/-1) snapcraft/tests/test_wiki.py (+2/-2) snapcraft/tests/test_yaml.py (+4/-2) snapcraft/wiki.py (+2/-0) snapcraft/yaml.py (+21/-3) |
||||
To merge this branch: | bzr merge lp:~sergiusens/snapcraft/1501496 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John Lenton (community) | Approve | ||
Review via email: mp+273027@code.launchpad.net |
Commit message
Remove the -project from plugin names that have been released and add a deprecation message
Description of the change
John Lenton (chipaca) : | # |
Snappy Tarmac (snappydevtarmac) wrote : | # |
Snappy Tarmac (snappydevtarmac) wrote : | # |
The attempt to merge lp:~sergiusens/snapcraft/1501496 into lp:snapcraft failed. Below is the output from the failed tests.
[1;31mThe project has gotten complex[0m.
Here's the list of units exceeding 10:
- snapcraft/cmds.py:
286:1: 'cmd' 13
name: # the name of the snap
version: # the version of the snap
# The vendor for the snap (replace 'Vendor <email address hidden>')
vendor: Vendor <email address hidden>
summary: # 79 char long summary
description: # A longer description for the snap
icon: # A path to an icon for the package
cp --preserve=all -R zzz /tmp/tmpib37ar1
cp --preserve=all -R src /tmp/tmpd55xvtp
cp --preserve=all -R src /tmp/tmprcfoplg
.......
.......
=======
FAIL: test_get_part (snapcraft.
-------
Traceback (most recent call last):
File "/tmp/tarmac/
self.
AssertionError: {} != {'type': 'go'}
- {}
+ {'type': 'go'}
-------
Ran 103 tests in 2.850s
FAILED (failures=1)
- 226. By Sergio Schvezov
-
Fix wiki unit test
Preview Diff
1 | === modified file 'docs/snapcraft-advanced-features.md' |
2 | --- docs/snapcraft-advanced-features.md 2015-09-29 17:31:08 +0000 |
3 | +++ docs/snapcraft-advanced-features.md 2015-10-01 11:50:35 +0000 |
4 | @@ -1,20 +1,20 @@ |
5 | # Snapcraft: Advanced features |
6 | |
7 | Once you have built [your first snap](your-first-snap.md), you will probably |
8 | -want to learn more about snapcraft's more advanced features. Having a look at |
9 | -our selection of examples is a good idea, as we want it to be a good showcase |
10 | +want to learn more about snapcraft's more advanced features. Having a look at |
11 | +our selection of examples is a good idea, as we want it to be a good showcase |
12 | of what is possible and generally relevant. |
13 | |
14 | ## Examples |
15 | |
16 | -Our showcase can be found in the actual source of `snapcraft` itself. Check |
17 | +Our showcase can be found in the actual source of `snapcraft` itself. Check |
18 | it out by simply running: |
19 | |
20 | bzr branch lp:snapcraft |
21 | cd snapcraft/examples |
22 | |
23 | -Inspecting the source locally will make easier to build the examples and |
24 | -play around with them. (You can |
25 | +Inspecting the source locally will make easier to build the examples and |
26 | +play around with them. (You can |
27 | [view them online](https://bazaar.launchpad.net/~snappy-dev/snapcraft/core/files/head:/examples/) |
28 | as well.) |
29 | |
30 | @@ -34,7 +34,7 @@ |
31 | (like description, vendor information and everything else), naming |
32 | the individual parts will define the stucture of your `snapcraft.yaml` file. |
33 | Think of parts as individual components of your snap: Where do you pull them |
34 | -from? How are they built? |
35 | +from? How are they built? |
36 | |
37 | ### Prerequisites during the build |
38 | |
39 | @@ -44,7 +44,7 @@ |
40 | build-packages: [libssl-dev] |
41 | |
42 | The above will install the `libssl-dev` package from the Ubuntu archive before |
43 | -an attempted build. If you need a specific version of libssl-dev or a custom |
44 | +an attempted build. If you need a specific version of libssl-dev or a custom |
45 | build, you will need to specify a separate part. |
46 | |
47 | Also note that the above will not define which libraries are shipped with the |
48 | @@ -54,34 +54,35 @@ |
49 | ### Pulling and building |
50 | |
51 | If you just intend to pull and build the source, take a look at the `gopaste` |
52 | -example. In its `snapcraft.yaml` file you can find just this one `parts` |
53 | +example. In its `snapcraft.yaml` file you can find just this one `parts` |
54 | paragraph: |
55 | |
56 | parts: |
57 | gopaste: |
58 | - plugin: go-project |
59 | + plugin: go |
60 | source: git://github.com/wisnij/gopaste/gopasted |
61 | |
62 | It starts off with the name of the specific part (`gopaste` here), the origin |
63 | -of the part (it's a `git` URL) and how to build it (plugin: `go-project`). |
64 | +of the part (it's a `git` URL) and how to build it (plugin: `go`). |
65 | Other possible scenarios would be Bazaar or Mercurial branches, or local |
66 | directories. |
67 | |
68 | ### Mixing and matching plugins |
69 | |
70 | An interesting example is `py2-project` because it defines only one part |
71 | -(`spongeshaker`), but uses two different plugins (`python2-project` and |
72 | -`make-project) to assemble and build the snap: |
73 | +(`spongeshaker`), but uses two different plugins (`python2` and `make`) to |
74 | +assemble and build the snap: |
75 | |
76 | parts: |
77 | - spongeshaker: |
78 | - plugin: python2-project |
79 | + spongeshaker: |
80 | + plugin: python2 |
81 | source: git://github.com/markokr/spongeshaker.git |
82 | make-project: |
83 | + plugin: make |
84 | source: . |
85 | |
86 | The example above mixes and matches parts of different origin. Locally it |
87 | -provides a binary we intend to ship (the `sha3sum.py` script) and a |
88 | +provides a binary we intend to ship (the `sha3sum.py` script) and a |
89 | `Makefile` (to install our script in the right place). |
90 | |
91 | `spongeshaker` is a python library we will need to pull from git, build as |
92 | @@ -91,33 +92,33 @@ |
93 | binary which you maintain, but require a library you need to build from git |
94 | as opposed to simply including it from the Ubuntu archives. |
95 | |
96 | -What's happening during the `snapcraft` run is: |
97 | +What's happening during the `snapcraft` run is: |
98 | |
99 | 1. Get `spongeshaker` from `git`. |
100 | -1. Build it as a python project (which will include installing the python |
101 | +1. Build it as a python project (which will include installing the python |
102 | library in the right place). |
103 | -1. Running `make` (from the local `Makefile`) and thus installing our |
104 | +1. Running `make` (from the local `Makefile`) and thus installing our |
105 | `sha3sum.py` script in the right place. |
106 | |
107 | ### Putting your parts in order |
108 | |
109 | -If your app is comprised of multiple parts, it might be necessary to build |
110 | +If your app is comprised of multiple parts, it might be necessary to build |
111 | and stage parts in a particular order. This can be done by using the `after` |
112 | keyword: |
113 | |
114 | parts: |
115 | pipelinetest: |
116 | - plugin: make-project |
117 | + plugin: make |
118 | source: lp:~mterry/+junk/pipelinetest |
119 | after: |
120 | - libpipeline |
121 | libpipeline: |
122 | - plugin: autotools-project |
123 | + plugin: autotools |
124 | source: lp:~mterry/libpipeline/printf |
125 | |
126 | |
127 | In the case of the `libpipeline` example above, the part named `pipelinetest` |
128 | -will be built after `libpipeline`. Especially if you need specific |
129 | +will be built after `libpipeline`. Especially if you need specific |
130 | functionality during a build or as part of checks during the `snap` phase, |
131 | this will be handy. |
132 | |
133 | @@ -126,14 +127,14 @@ |
134 | With snapcraft we want to make it easy to learn from other app vendors and |
135 | re-use parts which have worked well for them. |
136 | |
137 | -In the `downloader-with-wiki-parts` example, you can see that the `main` |
138 | +In the `downloader-with-wiki-parts` example, you can see that the `main` |
139 | part is built: |
140 | |
141 | after: |
142 | - curl |
143 | |
144 | As we never define the `curl` part in the above example, `snapcraft` will |
145 | -check the Ubuntu Wiki, which is where we currently host examples of |
146 | +check the Ubuntu Wiki, which is where we currently host examples of |
147 | successful snapcraft parts. The build order in this case would be `curl`, |
148 | then `main`. |
149 | |
150 | @@ -143,7 +144,7 @@ |
151 | ### Individual files |
152 | |
153 | If you are planning to provide binaries and services to the users of your |
154 | -apps, you need to specify them in your definition first. It's just a matter |
155 | +apps, you need to specify them in your definition first. It's just a matter |
156 | of enumerating them. |
157 | |
158 | The `godd` example has one binary: |
159 | @@ -162,17 +163,17 @@ |
160 | description: "gopaste" |
161 | start: bin/gopasted |
162 | |
163 | -You define a name for the service, describe it (so log messages are more |
164 | -descriptive), declare how to run the service and that's it. For more |
165 | +You define a name for the service, describe it (so log messages are more |
166 | +descriptive), declare how to run the service and that's it. For more |
167 | thoughts on services and their security, visit the |
168 | [snappy policy](https://developer.ubuntu.com/en/snappy/guides/security-policy/). |
169 | |
170 | |
171 | ### Limiting the number of installed files |
172 | |
173 | -To check the list of files included in your snap, you can use `dpkg -c` on |
174 | +To check the list of files included in your snap, you can use `dpkg -c` on |
175 | the resulting `.snap` file. If you find that certain files should not be |
176 | -shipped to the user (download size being just one factor), you can |
177 | +shipped to the user (download size being just one factor), you can |
178 | explicitly tell `snapcraft` which files to snap: |
179 | |
180 | snap: |
181 | @@ -185,4 +186,3 @@ |
182 | during the `snap` phase. As you can see above, globs (using asterisks as |
183 | wildcard characters) are a good way of handling complexities within the |
184 | directory structure. |
185 | - |
186 | |
187 | === modified file 'docs/your-first-snap.md' |
188 | --- docs/your-first-snap.md 2015-09-29 13:36:43 +0000 |
189 | +++ docs/your-first-snap.md 2015-10-01 11:50:35 +0000 |
190 | @@ -104,7 +104,7 @@ |
191 | |
192 | parts: |
193 | cam: |
194 | - plugin: go-project |
195 | + plugin: go |
196 | source: git://github.com/mikix/golang-static-http |
197 | |
198 | You've just defined a `part` inside `parts` named `cam`, but you |
199 | @@ -138,7 +138,7 @@ |
200 | |
201 | parts: |
202 | cam: |
203 | - plugin: go-project |
204 | + plugin: go |
205 | source: git://github.com/mikix/golang-static-http |
206 | stage-packages: |
207 | - fswebcam |
208 | @@ -185,7 +185,7 @@ |
209 | |
210 | parts: |
211 | cam: |
212 | - plugin: go-project |
213 | + plugin: go |
214 | source: git://github.com/mikix/golang-static-http |
215 | stage-packages: |
216 | - fswebcam |
217 | @@ -219,7 +219,7 @@ |
218 | |
219 | parts: |
220 | cam: |
221 | - plugin: go-project |
222 | + plugin: go |
223 | source: git://github.com/mikix/golang-static-http |
224 | stage-packages: |
225 | - fswebcam |
226 | @@ -273,7 +273,7 @@ |
227 | |
228 | parts: |
229 | golang-static-http: |
230 | - plugin: go-project |
231 | + plugin: go |
232 | source: git://github.com/mikix/golang-static-http |
233 | fswebcam: |
234 | plugin: ubuntu |
235 | |
236 | === modified file 'examples/downloader-with-wiki-parts/snapcraft.yaml' |
237 | --- examples/downloader-with-wiki-parts/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
238 | +++ examples/downloader-with-wiki-parts/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
239 | @@ -10,7 +10,7 @@ |
240 | |
241 | parts: |
242 | main: |
243 | - plugin: make-project |
244 | + plugin: make |
245 | source: . |
246 | after: |
247 | - curl |
248 | |
249 | === modified file 'examples/godd/snapcraft.yaml' |
250 | --- examples/godd/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
251 | +++ examples/godd/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
252 | @@ -10,11 +10,11 @@ |
253 | |
254 | parts: |
255 | godd: |
256 | - plugin: go-project |
257 | + plugin: go |
258 | source: git://github.com/mvo5/godd |
259 | stage-packages: [libgudev-1.0-dev] |
260 | snap: |
261 | - usr/lib/x86_64-linux-gnu/libgudev-1.0.so* |
262 | - usr/lib/x86_64-linux-gnu/libobject-2.0.so* |
263 | - usr/lib/x86_64-linux-gnu/libglib-2.0.so* |
264 | - - bin/godd* |
265 | \ No newline at end of file |
266 | + - bin/godd* |
267 | |
268 | === modified file 'examples/gopaste/snapcraft.yaml' |
269 | --- examples/gopaste/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
270 | +++ examples/gopaste/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
271 | @@ -11,5 +11,5 @@ |
272 | |
273 | parts: |
274 | gopaste: |
275 | - plugin: go-project |
276 | + plugin: go |
277 | source: git://github.com/wisnij/gopaste/gopasted |
278 | |
279 | === modified file 'examples/java-hello-world/snapcraft.yaml' |
280 | --- examples/java-hello-world/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
281 | +++ examples/java-hello-world/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
282 | @@ -10,8 +10,8 @@ |
283 | |
284 | parts: |
285 | local: |
286 | - plugin: ant-project |
287 | + plugin: ant |
288 | source: . |
289 | wrapper: |
290 | - plugin: make-project |
291 | + plugin: make |
292 | source: . |
293 | |
294 | === modified file 'examples/libpipeline/snapcraft.yaml' |
295 | --- examples/libpipeline/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
296 | +++ examples/libpipeline/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
297 | @@ -10,10 +10,10 @@ |
298 | |
299 | parts: |
300 | pipelinetest: |
301 | - plugin: make-project |
302 | + plugin: make |
303 | source: lp:~mterry/+junk/pipelinetest |
304 | after: |
305 | - libpipeline |
306 | libpipeline: |
307 | - plugin: autotools-project |
308 | + plugin: autotools |
309 | source: lp:~mterry/libpipeline/printf |
310 | |
311 | === modified file 'examples/py2-project/snapcraft.yaml' |
312 | --- examples/py2-project/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
313 | +++ examples/py2-project/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
314 | @@ -10,7 +10,7 @@ |
315 | |
316 | parts: |
317 | spongeshaker: |
318 | - plugin: python2-project |
319 | + plugin: python2 |
320 | source: git://github.com/markokr/spongeshaker.git |
321 | make-project: |
322 | source: . |
323 | |
324 | === modified file 'examples/py3-project/snapcraft.yaml' |
325 | --- examples/py3-project/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
326 | +++ examples/py3-project/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
327 | @@ -10,7 +10,7 @@ |
328 | |
329 | parts: |
330 | spongeshaker: |
331 | - plugin: python3-project |
332 | + plugin: python3 |
333 | source: git://github.com/markokr/spongeshaker.git |
334 | sha3: |
335 | plugin: copy |
336 | |
337 | === modified file 'examples/tomcat-maven-webapp/snapcraft.yaml' |
338 | --- examples/tomcat-maven-webapp/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
339 | +++ examples/tomcat-maven-webapp/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
340 | @@ -15,11 +15,11 @@ |
341 | |
342 | parts: |
343 | webapp: |
344 | - plugin: maven-project |
345 | + plugin: maven |
346 | source: git://github.com/lool/snappy-mvn-demo.git |
347 | tomcat: |
348 | plugin: tar-content |
349 | source: http://mirrors.ircam.fr/pub/apache/tomcat/tomcat-8/v8.0.26/bin/apache-tomcat-8.0.26.tar.gz |
350 | local-files: |
351 | - plugin: make-project |
352 | + plugin: make |
353 | source: . |
354 | |
355 | === modified file 'integration-tests/data/dependencies/snapcraft.yaml' |
356 | --- integration-tests/data/dependencies/snapcraft.yaml 2015-09-29 13:36:43 +0000 |
357 | +++ integration-tests/data/dependencies/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
358 | @@ -7,13 +7,13 @@ |
359 | |
360 | parts: |
361 | p1: |
362 | - plugin: make-project |
363 | + plugin: make |
364 | source: p1 |
365 | p2: |
366 | - plugin: make-project |
367 | + plugin: make |
368 | source: p2 |
369 | after: [p1] |
370 | p3: |
371 | - plugin: make-project |
372 | + plugin: make |
373 | source: p3 |
374 | after: [p2] |
375 | |
376 | === modified file 'integration-tests/data/simple-scons/snapcraft.yaml' |
377 | --- integration-tests/data/simple-scons/snapcraft.yaml 2015-09-29 19:41:21 +0000 |
378 | +++ integration-tests/data/simple-scons/snapcraft.yaml 2015-10-01 11:50:35 +0000 |
379 | @@ -9,5 +9,5 @@ |
380 | scons-project: |
381 | scons-options: |
382 | - --prefix=/opt |
383 | - plugin: scons-project |
384 | + plugin: scons |
385 | source: . |
386 | |
387 | === renamed file 'plugins/ant-project.yaml' => 'plugins/ant.yaml' |
388 | === renamed file 'plugins/autotools-project.yaml' => 'plugins/autotools.yaml' |
389 | === renamed file 'plugins/cmake-project.yaml' => 'plugins/cmake.yaml' |
390 | === renamed file 'plugins/go-project.yaml' => 'plugins/go.yaml' |
391 | --- plugins/go-project.yaml 2015-09-22 03:08:07 +0000 |
392 | +++ plugins/go.yaml 2015-10-01 11:50:35 +0000 |
393 | @@ -1,5 +1,5 @@ |
394 | -requires: |
395 | - - go |
396 | +build-packages: |
397 | + - golang-go |
398 | options: |
399 | source: |
400 | required: true |
401 | |
402 | === removed file 'plugins/go.yaml' |
403 | --- plugins/go.yaml 2015-09-18 14:53:03 +0000 |
404 | +++ plugins/go.yaml 1970-01-01 00:00:00 +0000 |
405 | @@ -1,2 +0,0 @@ |
406 | -build-packages: |
407 | - - golang-go |
408 | |
409 | === renamed file 'plugins/make-project.yaml' => 'plugins/make.yaml' |
410 | === renamed file 'plugins/maven-project.yaml' => 'plugins/maven.yaml' |
411 | === renamed file 'plugins/python2-project.yaml' => 'plugins/python2.yaml' |
412 | === renamed file 'plugins/python3-project.yaml' => 'plugins/python3.yaml' |
413 | === modified file 'plugins/readline.yaml' |
414 | --- plugins/readline.yaml 2015-07-02 17:04:34 +0000 |
415 | +++ plugins/readline.yaml 2015-10-01 11:50:35 +0000 |
416 | @@ -1,3 +1,3 @@ |
417 | source: git://git.sv.gnu.org/readline.git |
418 | requires: |
419 | - - autotools-project |
420 | + - autotools |
421 | |
422 | === renamed file 'plugins/scons-project.yaml' => 'plugins/scons.yaml' |
423 | === renamed file 'snapcraft/plugins/ant_project.py' => 'snapcraft/plugins/ant.py' |
424 | --- snapcraft/plugins/ant_project.py 2015-08-26 08:52:09 +0000 |
425 | +++ snapcraft/plugins/ant.py 2015-10-01 11:50:35 +0000 |
426 | @@ -26,7 +26,7 @@ |
427 | logger = logging.getLogger(__name__) |
428 | |
429 | |
430 | -class AntProjectPlugin(snapcraft.BasePlugin): |
431 | +class AntPlugin(snapcraft.BasePlugin): |
432 | |
433 | def pull(self): |
434 | return self.handle_source_options() |
435 | |
436 | === renamed file 'snapcraft/plugins/autotools_project.py' => 'snapcraft/plugins/autotools.py' |
437 | --- snapcraft/plugins/autotools_project.py 2015-07-22 18:23:16 +0000 |
438 | +++ snapcraft/plugins/autotools.py 2015-10-01 11:50:35 +0000 |
439 | @@ -15,7 +15,7 @@ |
440 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
441 | |
442 | import os |
443 | -from snapcraft.plugins.make_project import MakePlugin |
444 | +from snapcraft.plugins.make import MakePlugin |
445 | |
446 | |
447 | class AutotoolsPlugin(MakePlugin): |
448 | |
449 | === renamed file 'snapcraft/plugins/cmake_project.py' => 'snapcraft/plugins/cmake.py' |
450 | --- snapcraft/plugins/cmake_project.py 2015-07-22 18:23:16 +0000 |
451 | +++ snapcraft/plugins/cmake.py 2015-10-01 11:50:35 +0000 |
452 | @@ -14,7 +14,7 @@ |
453 | # You should have received a copy of the GNU General Public License |
454 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
455 | |
456 | -from snapcraft.plugins.make_project import MakePlugin |
457 | +from snapcraft.plugins.make import MakePlugin |
458 | |
459 | |
460 | class CMakePlugin(MakePlugin): |
461 | |
462 | === removed file 'snapcraft/plugins/go.py' |
463 | --- snapcraft/plugins/go.py 2015-09-08 21:06:47 +0000 |
464 | +++ snapcraft/plugins/go.py 1970-01-01 00:00:00 +0000 |
465 | @@ -1,26 +0,0 @@ |
466 | -# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- |
467 | -# |
468 | -# Copyright (C) 2015 Canonical Ltd |
469 | -# |
470 | -# This program is free software: you can redistribute it and/or modify |
471 | -# it under the terms of the GNU General Public License version 3 as |
472 | -# published by the Free Software Foundation. |
473 | -# |
474 | -# This program is distributed in the hope that it will be useful, |
475 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
476 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
477 | -# GNU General Public License for more details. |
478 | -# |
479 | -# You should have received a copy of the GNU General Public License |
480 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
481 | - |
482 | -import snapcraft |
483 | - |
484 | - |
485 | -class GoPlugin(snapcraft.BasePlugin): |
486 | - |
487 | - def env(self, root): |
488 | - # usr/lib/go/bin on newer Ubuntus, usr/bin on trusty |
489 | - return [ |
490 | - "GOPATH={}/go".format(root), |
491 | - ] |
492 | |
493 | === renamed file 'snapcraft/plugins/go_project.py' => 'snapcraft/plugins/go.py' |
494 | --- snapcraft/plugins/go_project.py 2015-09-23 11:07:45 +0000 |
495 | +++ snapcraft/plugins/go.py 2015-10-01 11:50:35 +0000 |
496 | @@ -18,7 +18,8 @@ |
497 | import snapcraft |
498 | |
499 | |
500 | -class GoProjectPlugin(snapcraft.BasePlugin): |
501 | +class GoPlugin(snapcraft.BasePlugin): |
502 | + |
503 | def __init__(self, name, options): |
504 | super().__init__(name, options) |
505 | if self.options.source.startswith("lp:"): |
506 | @@ -26,6 +27,12 @@ |
507 | else: |
508 | self.fullname = self.options.source.split("://")[1] |
509 | |
510 | + def env(self, root): |
511 | + # usr/lib/go/bin on newer Ubuntus, usr/bin on trusty |
512 | + return [ |
513 | + "GOPATH={}/go".format(root), |
514 | + ] |
515 | + |
516 | def pull(self): |
517 | # use -d to only download (build will happen later) |
518 | # use -t to also get the test-deps |
519 | |
520 | === renamed file 'snapcraft/plugins/make_project.py' => 'snapcraft/plugins/make.py' |
521 | === renamed file 'snapcraft/plugins/maven_project.py' => 'snapcraft/plugins/maven.py' |
522 | === renamed file 'snapcraft/plugins/python2_project.py' => 'snapcraft/plugins/python2.py' |
523 | --- snapcraft/plugins/python2_project.py 2015-09-23 12:19:45 +0000 |
524 | +++ snapcraft/plugins/python2.py 2015-10-01 11:50:35 +0000 |
525 | @@ -20,7 +20,7 @@ |
526 | import snapcraft |
527 | |
528 | |
529 | -class Python2ProjectPlugin(snapcraft.BasePlugin): |
530 | +class Python2Plugin(snapcraft.BasePlugin): |
531 | |
532 | _PLUGIN_STAGE_PACKAGES = [ |
533 | 'python-dev', |
534 | |
535 | === renamed file 'snapcraft/plugins/python3_project.py' => 'snapcraft/plugins/python3.py' |
536 | --- snapcraft/plugins/python3_project.py 2015-09-23 12:19:45 +0000 |
537 | +++ snapcraft/plugins/python3.py 2015-10-01 11:50:35 +0000 |
538 | @@ -20,7 +20,7 @@ |
539 | import snapcraft |
540 | |
541 | |
542 | -class Python3ProjectPlugin(snapcraft.BasePlugin): |
543 | +class Python3Plugin(snapcraft.BasePlugin): |
544 | |
545 | _PLUGIN_STAGE_PACKAGES = [ |
546 | 'python3-dev', |
547 | |
548 | === renamed file 'snapcraft/plugins/scons_project.py' => 'snapcraft/plugins/scons.py' |
549 | === modified file 'snapcraft/tests/test_wiki.py' |
550 | --- snapcraft/tests/test_wiki.py 2015-09-16 20:59:15 +0000 |
551 | +++ snapcraft/tests/test_wiki.py 2015-10-01 11:50:35 +0000 |
552 | @@ -31,7 +31,7 @@ |
553 | @property |
554 | def text(self): |
555 | return '''{{{part1: |
556 | - type: go |
557 | + plugin: go |
558 | }}}''' |
559 | |
560 | patcher = unittest.mock.patch('requests.get') |
561 | @@ -42,7 +42,7 @@ |
562 | def test_get_part(self): |
563 | w = snapcraft.wiki.Wiki() |
564 | |
565 | - self.assertEqual(w.get_part('part1'), {'type': 'go'}) |
566 | + self.assertEqual(w.get_part('part1'), {'plugin': 'go'}) |
567 | self.assertEqual(w.get_part('part2'), None) |
568 | |
569 | self.mock_requests.assert_called_once_with( |
570 | |
571 | === modified file 'snapcraft/tests/test_yaml.py' |
572 | --- snapcraft/tests/test_yaml.py 2015-09-30 20:28:59 +0000 |
573 | +++ snapcraft/tests/test_yaml.py 2015-10-01 11:50:35 +0000 |
574 | @@ -119,10 +119,12 @@ |
575 | |
576 | parts: |
577 | p1: |
578 | - plugin: go |
579 | + plugin: tar-content |
580 | + source: . |
581 | after: [p2] |
582 | p2: |
583 | - plugin: go |
584 | + plugin: tar-content |
585 | + source: . |
586 | after: [p1] |
587 | """) |
588 | with self.assertRaises(snapcraft.yaml.SnapcraftLogicError) as raised: |
589 | |
590 | === modified file 'snapcraft/wiki.py' |
591 | --- snapcraft/wiki.py 2015-09-16 20:59:15 +0000 |
592 | +++ snapcraft/wiki.py 2015-10-01 11:50:35 +0000 |
593 | @@ -46,4 +46,6 @@ |
594 | self._fetch() |
595 | |
596 | if name in self.wiki_parts: |
597 | + if 'plugin' and 'type' in self.wiki_parts[name]: |
598 | + del self.wiki_parts[name]['type'] |
599 | return self.wiki_parts[name] |
600 | |
601 | === modified file 'snapcraft/yaml.py' |
602 | --- snapcraft/yaml.py 2015-09-30 20:28:59 +0000 |
603 | +++ snapcraft/yaml.py 2015-10-01 11:50:35 +0000 |
604 | @@ -29,6 +29,18 @@ |
605 | logger = logging.getLogger(__name__) |
606 | |
607 | |
608 | +_DEPRECATION_LIST = [ |
609 | + 'ant-project', |
610 | + 'autotools-project', |
611 | + 'cmake-project', |
612 | + 'go-project', |
613 | + 'make-project', |
614 | + 'maven-project', |
615 | + 'python2-project', |
616 | + 'python3-project', |
617 | +] |
618 | + |
619 | + |
620 | @jsonschema.FormatChecker.cls_checks('file-path') |
621 | @jsonschema.FormatChecker.cls_checks('icon-path') |
622 | def _validate_file_exists(instance): |
623 | @@ -93,9 +105,15 @@ |
624 | if not plugin_name: |
625 | raise PluginNotDefinedError |
626 | |
627 | + if plugin_name in _DEPRECATION_LIST: |
628 | + plugin_name = plugin_name.rsplit('-project')[0] |
629 | + logger.warning( |
630 | + 'DEPRECATED: plugin names ending in -project are ' |
631 | + 'deprecated. Using {0} instead of {0}-project'.format( |
632 | + plugin_name)) |
633 | + |
634 | if "after" in properties: |
635 | - after_requests[part_name] = properties["after"] |
636 | - del properties["after"] |
637 | + after_requests[part_name] = properties.pop('after') |
638 | |
639 | properties['stage'] = _expand_filesets_for('stage', properties) |
640 | properties['snap'] = _expand_filesets_for('snap', properties) |
641 | @@ -140,7 +158,7 @@ |
642 | wiki_part = w.get_part(dep) |
643 | found = True if wiki_part else False |
644 | if found: |
645 | - part.deps.append(self.load_plugin(dep, wiki_part['type'], wiki_part)) |
646 | + part.deps.append(self.load_plugin(dep, wiki_part['plugin'], wiki_part)) |
647 | if not found: |
648 | raise SnapcraftLogicError('part name missing {}'.format(dep)) |
649 |
The attempt to merge lp:~sergiusens/snapcraft/1501496 into lp:snapcraft failed. Below is the output from the failed tests.
[1;31mThe project has gotten complex[0m.
Here's the list of units exceeding 10:
- snapcraft/cmds.py:
286:1: 'cmd' 13
name: # the name of the snap eq4ia4/ parts/copy/ install/ zzz z/parts/ copy/install/ dst k/parts/ copy/install/ dir/dst
version: # the version of the snap
# The vendor for the snap (replace 'Vendor <email address hidden>')
vendor: Vendor <email address hidden>
summary: # 79 char long summary
description: # A longer description for the snap
icon: # A path to an icon for the package
cp --preserve=all -R zzz /tmp/tmp4_
cp --preserve=all -R src /tmp/tmp5v8g2di
cp --preserve=all -R src /tmp/tmpvnlkjdh
....... ....... ....... ....... ....... Warning: unable to find "test_relexepath" in the path ....... ....... ....... ....... ....... F...... ....... ....... ..... ======= ======= ======= ======= ======= ======= ======= ======= ======= tests.test_ wiki.TestYaml) ------- ------- ------- ------- ------- ------- ------- ------- ------- branch. mpuFsv/ snapcraft/ tests/test_ wiki.py" , line 45, in test_get_part assertEqual( w.get_part( 'part1' ), {'type': 'go'})
.......
=======
FAIL: test_get_part (snapcraft.
-------
Traceback (most recent call last):
File "/tmp/tarmac/
self.
AssertionError: {} != {'type': 'go'}
- {}
+ {'type': 'go'}
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 103 tests in 2.887s
FAILED (failures=1)