Commit 65a7c63
Chris Patterson
plugins v2: quote python packages argument for pip (#3246)
If using a python package with conditionals, e.g.:
python-packages:
- ibm-db-sa; platform_machine == 'x86_64'
- ibm-db-sa; platform_machine == 'ppc64le'
- ibm-db-sa; platform_machine == 's390x'
Then snapcraft would pass the python packages unquoted to pip,
resulting in build errors. Ensure the packages are quoted
safely using shlex.quote() when building the command string.
Update existing python-package spread test and python-package
unit test to cover this case.
LP: #1884429
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>1 parent 409b8e8 commit 65a7c63
3 files changed
Lines changed: 7 additions & 4 deletions
File tree
- snapcraft/plugins/v2
- tests
- spread/plugins/v2/snaps/python-hello-with-python-package-dep/snap
- unit/plugins/v2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments