|
1 | 1 | { |
2 | 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 |
3 | 3 | // for the documentation about the tasks.json format |
4 | | - // These Python project tasks assume you have installed and configured: |
5 | | - // build, wheel, black, pylint, pytest, pytest-cov, Sphinx, sphinx-rtd-theme |
6 | | - // Use the Update Toolchain task to install the necessary packages. |
| 4 | + // |
| 5 | + // This VSCode development workflow is intended to work on |
| 6 | + // MacOS, Linux and Windows (with Powershell>=5.1). |
| 7 | + // |
| 8 | + // Use the Install Deploy Dependencies tasks to install the necessary |
| 9 | + // build and test packages into the system environment. |
| 10 | + // |
| 11 | + // Use the Create Venv task to create a virtual environment in the |
| 12 | + // designated directory. Select this environment using Select |
| 13 | + // Interpreter to auto-activate it via New Terminal. |
| 14 | + // |
| 15 | + // Remember to include any global Python bin (Scripts on Windows) in PATH. |
7 | 16 | "version": "2.0.0", |
8 | 17 | "tasks": [ |
9 | 18 | { |
10 | | - "label": "Install Dependencies", |
| 19 | + "label": "Create Venv", |
11 | 20 | "type": "process", |
12 | 21 | "command": "${config:python.defaultInterpreterPath}", |
13 | 22 | "args": [ |
14 | 23 | "-m", |
15 | | - "pip", |
16 | | - "install", |
17 | | - "--group", |
18 | | - "deploy", |
| 24 | + "venv", |
| 25 | + "${config:venv}", |
| 26 | + //"--system-site-packages" |
19 | 27 | ], |
20 | 28 | "problemMatcher": [] |
21 | 29 | }, |
|
38 | 46 | }, |
39 | 47 | "problemMatcher": [] |
40 | 48 | }, |
| 49 | + { |
| 50 | + "label": "Install Deploy Dependencies", |
| 51 | + "type": "process", |
| 52 | + "command": "${config:python.defaultInterpreterPath}", |
| 53 | + "args": [ |
| 54 | + "-m", |
| 55 | + "pip", |
| 56 | + "install", |
| 57 | + "--group", |
| 58 | + "deploy" |
| 59 | + ], |
| 60 | + "problemMatcher": [] |
| 61 | + }, |
41 | 62 | { |
42 | 63 | "label": "Clean", |
43 | 64 | "type": "shell", |
|
48 | 69 | "dist", |
49 | 70 | "htmlcov", |
50 | 71 | "docs/_build", |
51 | | - "${config:modulename}.egg-info" |
| 72 | + "${config:modulename}.egg-info", |
52 | 73 | ], |
53 | 74 | "windows": { |
54 | | - "command": "Get-ChildItem", |
| 75 | + "command": "rm", |
55 | 76 | "args": [ |
| 77 | + "-R", |
56 | 78 | "-Path", |
57 | | - "build\\,", |
58 | | - "dist\\,", |
59 | | - "docs\\_build,", |
60 | | - "${config:modulename}.egg-info", |
61 | | - "-Recurse", |
62 | | - "|", |
63 | | - "Remove-Item", |
64 | | - "-Recurse", |
65 | | - "-Confirm:$false", |
66 | | - "-Force" |
| 79 | + "'src/${config:modulename}.egg-info','build','dist','htmlcov','docs/_build'", |
| 80 | + "-ErrorAction", |
| 81 | + "SilentlyContinue" // doesn't work! - stops on exit code 1 anyway |
67 | 82 | ] |
68 | 83 | }, |
69 | 84 | "options": { |
|
116 | 131 | "-c", |
117 | 132 | "pyproject.toml", |
118 | 133 | "-r", |
119 | | - "--exit-zero", |
120 | 134 | "." |
121 | 135 | ], |
122 | 136 | "problemMatcher": [] |
123 | 137 | }, |
124 | 138 | { |
125 | | - "label": "Build", |
| 139 | + "label": "Test", |
126 | 140 | "type": "process", |
127 | 141 | "command": "${config:python.defaultInterpreterPath}", |
128 | 142 | "args": [ |
129 | 143 | "-m", |
130 | | - "build", |
131 | | - ".", |
132 | | - "--wheel", |
133 | | - "--sdist" |
| 144 | + "pytest" |
134 | 145 | ], |
135 | 146 | "problemMatcher": [], |
136 | 147 | "group": { |
137 | | - "kind": "build", |
| 148 | + "kind": "test", |
138 | 149 | "isDefault": true |
139 | 150 | } |
140 | 151 | }, |
141 | 152 | { |
142 | | - "label": "Test", |
| 153 | + "label": "Build", |
143 | 154 | "type": "process", |
144 | 155 | "command": "${config:python.defaultInterpreterPath}", |
145 | 156 | "args": [ |
146 | 157 | "-m", |
147 | | - "pytest" |
| 158 | + "build", |
| 159 | + ".", |
| 160 | + "--wheel", |
| 161 | + "--sdist", |
148 | 162 | ], |
149 | | - "problemMatcher": [] |
| 163 | + "problemMatcher": [], |
| 164 | + "dependsOrder": "sequence", |
| 165 | + "dependsOn": [ |
| 166 | + "Clean", |
| 167 | + "Security", |
| 168 | + "Sort Imports", |
| 169 | + "Format", |
| 170 | + "Pylint", |
| 171 | + "Test", |
| 172 | + ], |
| 173 | + "group": { |
| 174 | + "kind": "build", |
| 175 | + "isDefault": true |
| 176 | + } |
150 | 177 | }, |
151 | 178 | { |
152 | 179 | "label": "Sphinx", |
|
183 | 210 | "problemMatcher": [] |
184 | 211 | }, |
185 | 212 | { |
186 | | - "label": "Sphinx Deploy to S3", |
| 213 | + "label": "Sphinx Deploy to S3", // needs AWS credentials |
187 | 214 | "type": "process", |
188 | 215 | "command": "aws", |
189 | 216 | "args": [ |
|
200 | 227 | "problemMatcher": [] |
201 | 228 | }, |
202 | 229 | { |
203 | | - "label": "Install Wheel", |
204 | | - "type": "shell", |
| 230 | + "label": "Install Locally", |
| 231 | + "type": "process", |
205 | 232 | "command": "${config:python.defaultInterpreterPath}", |
206 | 233 | "args": [ |
207 | 234 | "-m", |
208 | 235 | "pip", |
209 | 236 | "install", |
210 | | - "--user", |
| 237 | + "--upgrade", |
211 | 238 | "--force-reinstall", |
212 | | - "*.whl" |
| 239 | + "--find-links=${workspaceFolder}/dist", |
| 240 | + "${workspaceFolderBasename}", |
| 241 | + // "--target", |
| 242 | + // "${config:venv}/Lib/site-packages" |
213 | 243 | ], |
214 | 244 | "options": { |
215 | 245 | "cwd": "dist" |
216 | 246 | }, |
217 | | - "problemMatcher": [] |
218 | | - }, |
219 | | - { |
220 | | - "label": "Install Locally", |
221 | | - "type": "shell", |
222 | | - "command": "${config:python.defaultInterpreterPath}", |
223 | | - "args": [ |
224 | | - "-m", |
225 | | - "pip", |
226 | | - "install", |
227 | | - //"--user", |
228 | | - "--force-reinstall", |
229 | | - "*.whl" |
230 | | - ], |
231 | 247 | "dependsOrder": "sequence", |
232 | 248 | "dependsOn": [ |
233 | | - "Clean", |
234 | | - "Security", |
235 | | - "Sort Imports", |
236 | | - "Format", |
237 | | - "Pylint", |
238 | | - "Test", |
239 | 249 | "Build", |
240 | 250 | "Sphinx HTML" |
241 | 251 | ], |
242 | | - "options": { |
243 | | - "cwd": "dist" |
244 | | - }, |
245 | 252 | "problemMatcher": [] |
246 | 253 | } |
247 | 254 | ] |
|
0 commit comments