11{
2- // These test, build and deploy tasks are targeted at a venv
2+ // PyGPSClient VSCode workflow.
3+ //
4+ // These build, install and test tasks are targeted at a venv
35 // called 'pygpsclient' located in the user's home directory.
46 // Set your workspace default VSCode Python interpreter to
57 // this venv, i.e.
6- // "${userHome }/pygpsclient/bin/python3" on linux/macos
7- // "${userHome}/pygpsclient/Scripts/python" on windows
8+ // "${userHome }/pygpsclient/bin/python3" on Linux/MacOS
9+ // "C:/Users/user/pygpsclient/Scripts/python.exe" on Windows
10+ //
11+ // The "Test" task will initialise the venv and execute all
12+ // necessary build and installation precursors.
13+ //
814 "version" : " 2.0.0" ,
915 "tasks" : [
16+ {
17+ "label" : " Delete Venv" ,
18+ "type" : " shell" ,
19+ "command" : " rm" ,
20+ "args" : [
21+ " -rf" ,
22+ " ${config:venv}" ,
23+ ],
24+ "problemMatcher" : []
25+ },
1026 {
1127 "label" : " Create Venv" ,
1228 "type" : " process" ,
13- "command" : " ${config:python.defaultInterpreterPath }" ,
29+ "command" : " ${config:python.systemPath }" ,
1430 "args" : [
1531 " -m" ,
1632 " venv" ,
1733 " ${config:venv}" ,
18- //"--system-site-packages"
1934 ],
20- "problemMatcher" : []
35+ "problemMatcher" : [],
36+ "dependsOrder" : " sequence" ,
37+ "dependsOn" : [
38+ " Delete Venv" ,
39+ ],
2140 },
2241 {
23- "label" : " Run Local Version " ,
42+ "label" : " Install Deploy Dependencies " ,
2443 "type" : " process" ,
2544 "command" : " ${config:python.defaultInterpreterPath}" ,
2645 "args" : [
2746 " -m" ,
28- " pygpsclient" ,
29- " --ntripcasteruser" ,
30- " semuadmin" ,
31- " --ntripcasterpassword" ,
32- " testpassword" ,
33- " --verbosity" ,
34- " 3"
47+ " pip" ,
48+ " install" ,
49+ " --upgrade" ,
50+ " --group" ,
51+ " deploy"
3552 ],
36- "options" : {
37- "cwd" : " src"
38- },
39- "problemMatcher" : []
53+ "problemMatcher" : [],
4054 },
4155 {
42- "label" : " Install Deploy Dependencies" ,
56+ "label" : " Install Optional Dependencies" ,
4357 "type" : " process" ,
4458 "command" : " ${config:python.defaultInterpreterPath}" ,
4559 "args" : [
4660 " -m" ,
4761 " pip" ,
4862 " install" ,
63+ " --upgrade" ,
4964 " --group" ,
50- " deploy "
65+ " optional "
5166 ],
52- "problemMatcher" : []
67+ "problemMatcher" : [],
5368 },
5469 {
5570 "label" : " Clean" ,
6479 " ${config:modulename}.egg-info" ,
6580 ],
6681 "windows" : {
67- "command" : " rm " ,
82+ "command" : " Remove-Item " ,
6883 "args" : [
69- " -R" ,
70- " -Path" ,
71- " 'src/${config:modulename}.egg-info','build','dist','htmlcov','docs/_build'" ,
84+ " -Recurse" ,
85+ " -Force" ,
7286 " -ErrorAction" ,
73- " SilentlyContinue" // doesn't work! - stops on exit code 1 anyway
87+ " SilentlyContinue" , // doesn't work! - stops on exit code 1 anyway
88+ " -Path" ,
89+ " 'build','dist','htmlcov','docs/_build','src/${config:modulename}.egg-info'" ,
7490 ]
7591 },
7692 "options" : {
126142 "problemMatcher" : []
127143 },
128144 {
129- "label" : " Test " ,
145+ "label" : " Build " ,
130146 "type" : " process" ,
131147 "command" : " ${config:python.defaultInterpreterPath}" ,
132148 "args" : [
133149 " -m" ,
134- " pytest"
150+ " build" ,
151+ " ." ,
152+ " --wheel" ,
153+ " --sdist" ,
135154 ],
136155 "problemMatcher" : [],
156+ "dependsOrder" : " sequence" ,
157+ "dependsOn" : [
158+ " Create Venv" ,
159+ " Install Deploy Dependencies" ,
160+ " Install Optional Dependencies" ,
161+ " Clean" ,
162+ " Sort Imports" ,
163+ " Format" ,
164+ ],
137165 "group" : {
138- "kind" : " test " ,
166+ "kind" : " build " ,
139167 "isDefault" : true
140168 }
141169 },
142170 {
143- "label" : " Build " ,
171+ "label" : " Install " , // into venv
144172 "type" : " process" ,
145173 "command" : " ${config:python.defaultInterpreterPath}" ,
146174 "args" : [
147175 " -m" ,
148- " build" ,
149- " ." ,
150- " --wheel" ,
151- " --sdist" ,
176+ " pip" ,
177+ " install" ,
178+ " --upgrade" ,
179+ " --force-reinstall" ,
180+ " --find-links=${workspaceFolder}/dist" ,
181+ " ${workspaceFolderBasename}" ,
182+ ],
183+ "problemMatcher" : [],
184+ },
185+ {
186+ "label" : " Test" ,
187+ "type" : " process" ,
188+ "command" : " ${config:python.defaultInterpreterPath}" ,
189+ "args" : [
190+ " -m" ,
191+ " pytest"
152192 ],
153193 "problemMatcher" : [],
154194 "dependsOrder" : " sequence" ,
155195 "dependsOn" : [
156- " Clean" ,
157- " Security" ,
158- " Sort Imports" ,
159- " Format" ,
196+ " Build" ,
197+ " Install" , // have to install before running pylint
160198 " Pylint" ,
161- " Test " ,
199+ " Security " ,
162200 ],
163201 "group" : {
164- "kind" : " build " ,
202+ "kind" : " test " ,
165203 "isDefault" : true
166204 }
167205 },
200238 "problemMatcher" : []
201239 },
202240 {
203- "label" : " Sphinx Deploy to S3 " , // needs AWS credentials
241+ "label" : " Sphinx Deploy" , // needs AWS S3 credentials
204242 "type" : " process" ,
205243 "command" : " aws" ,
206244 "args" : [
217255 "problemMatcher" : []
218256 },
219257 {
220- "label" : " Install Locally " ,
258+ "label" : " Run Installed Version " ,
221259 "type" : " process" ,
222260 "command" : " ${config:python.defaultInterpreterPath}" ,
223261 "args" : [
224262 " -m" ,
225- " pip" ,
226- " install" ,
227- " --upgrade" ,
228- " --force-reinstall" ,
229- " --find-links=${workspaceFolder}/dist" ,
230- " ${workspaceFolderBasename}" ,
231- // "--target",
232- // "${config:venv}/Lib/site-packages"
233- ],
234- "options" : {
235- "cwd" : " dist"
236- },
237- "dependsOrder" : " sequence" ,
238- "dependsOn" : [
239- " Build" ,
240- " Sphinx HTML"
263+ " pygpsclient" ,
264+ //"--verbosity",
265+ //"3"
241266 ],
242267 "problemMatcher" : []
243- }
268+ },
244269 ]
245270}
0 commit comments