Skip to content

Commit a31e659

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: Improve interpreter selection on different platforms (#517) Yarn and code coverage (#475)
2 parents a696f2a + 4372809 commit a31e659

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5969
-7040
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ node_modules
99
__pycache__
1010
npm-debug.log
1111
**/.mypy_cache/**
12+
!yarn.lock
13+
coverage/

.travis.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
language: python
22
cache: pip
33

4-
addons:
5-
apt:
6-
sources:
7-
- ubuntu-toolchain-r-test
8-
packages:
9-
- gcc-4.9
10-
- g++-4.9
11-
- gcc-4.9-multilib
12-
- g++-4.9-multilib
13-
- libgtk2.0-0
14-
- libx11-dev
15-
- libxkbfile-dev
16-
- libsecret-1-dev
17-
- python-dev
184
matrix:
195
include:
206
# # Use the built in venv for linux builds
@@ -43,17 +29,27 @@ before_install: |
4329
source ./.nvm/nvm.sh
4430
nvm install 8.9.1
4531
nvm use 8.9.1
46-
47-
npm config set python `which python`
4832
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
4933
pyenv install $PYTHON
5034
pyenv global $PYTHON
5135
fi
5236
export TRAVIS_PYTHON_PATH=`which python`
5337
install:
5438
- pip install --upgrade -r requirements.txt
55-
- npm install
56-
- npm run vscode:prepublish
39+
- yarn
5740

5841
script:
59-
- npm test --silent
42+
- yarn run clean
43+
- yarn run vscode:prepublish
44+
- yarn run cover:enable
45+
- yarn run testSingleWorkspace --silent
46+
- if [ $TRAVIS_UPLOAD_COVERAGE == "true" ]; then
47+
bash <(curl -s https://codecov.io/bash);
48+
fi
49+
- yarn run clean
50+
- yarn run vscode:prepublish
51+
- yarn run cover:enable
52+
- yarn run testMultiWorkspace --silent
53+
- if [ $TRAVIS_UPLOAD_COVERAGE == "true" ]; then
54+
bash <(curl -s https://codecov.io/bash);
55+
fi

.vscode/launch.json

Lines changed: 93 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,96 @@
11
// A launch configuration that compiles the extension and then opens it inside a new window
22
{
3-
"version": "0.1.0",
4-
"configurations": [
5-
{
6-
"name": "Launch Extension",
7-
"type": "extensionHost",
8-
"request": "launch",
9-
"runtimeExecutable": "${execPath}",
10-
"args": [
11-
"--extensionDevelopmentPath=${workspaceFolder}"
12-
],
13-
"stopOnEntry": false,
14-
"sourceMaps": true,
15-
"outFiles": [
16-
"${workspaceFolder}/out/**/*.js"
17-
],
18-
"preLaunchTask": "Compile"
19-
},
20-
{
21-
"name": "Launch Extension as debugServer", // https://code.visualstudio.com/docs/extensions/example-debuggers
22-
"type": "node",
23-
"request": "launch",
24-
"program": "${workspaceFolder}/out/client/debugger/Main.js",
25-
"stopOnEntry": false,
26-
"args": [
27-
"--server=4711"
28-
],
29-
"sourceMaps": true,
30-
"outFiles": [
31-
"${workspaceFolder}/out/client/**/*.js"
32-
],
33-
"cwd": "${workspaceFolder}",
34-
"preLaunchTask": "Compile"
35-
},
36-
{
37-
"name": "Launch Tests",
38-
"type": "extensionHost",
39-
"request": "launch",
40-
"runtimeExecutable": "${execPath}",
41-
"args": [
42-
"${workspaceFolder}/src/test",
43-
"--extensionDevelopmentPath=${workspaceFolder}",
44-
"--extensionTestsPath=${workspaceFolder}/out/test"
45-
],
46-
"stopOnEntry": false,
47-
"sourceMaps": true,
48-
"outFiles": [
49-
"${workspaceFolder}/out/**/*.js"
50-
],
51-
"preLaunchTask": "Compile"
52-
},
53-
{
54-
"name": "Launch Multiroot Tests",
55-
"type": "extensionHost",
56-
"request": "launch",
57-
"runtimeExecutable": "${execPath}",
58-
"args": [
59-
"${workspaceFolder}/src/testMultiRootWkspc/multi.code-workspace",
60-
"--extensionDevelopmentPath=${workspaceFolder}",
61-
"--extensionTestsPath=${workspaceFolder}/out/test"
62-
],
63-
"stopOnEntry": false,
64-
"sourceMaps": true,
65-
"outFiles": [
66-
"${workspaceFolder}/out/**/*.js"
67-
],
68-
"preLaunchTask": "Compile"
69-
}
70-
],
71-
"compounds": [
72-
{
73-
"name": "Extension + Debugger",
74-
"configurations": [
75-
"Launch Extension",
76-
"Launch Extension as debugServer"
77-
]
78-
}
79-
]
3+
"version": "0.1.0",
4+
"configurations": [
5+
{
6+
"name": "Launch Extension",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceFolder}"
12+
],
13+
"stopOnEntry": false,
14+
"sourceMaps": true,
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "Compile"
19+
},
20+
{
21+
"name": "Launch Extension as debugServer", // https://code.visualstudio.com/docs/extensions/example-debuggers
22+
"type": "node",
23+
"request": "launch",
24+
"program": "${workspaceFolder}/out/client/debugger/Main.js",
25+
"stopOnEntry": false,
26+
"args": [
27+
"--server=4711"
28+
],
29+
"sourceMaps": true,
30+
"outFiles": [
31+
"${workspaceFolder}/out/client/**/*.js"
32+
],
33+
"cwd": "${workspaceFolder}",
34+
"preLaunchTask": "Compile"
35+
},
36+
{
37+
"name": "Launch Tests",
38+
"type": "extensionHost",
39+
"request": "launch",
40+
"runtimeExecutable": "${execPath}",
41+
"args": [
42+
"${workspaceFolder}/src/test",
43+
"--extensionDevelopmentPath=${workspaceFolder}",
44+
"--extensionTestsPath=${workspaceFolder}/out/test"
45+
],
46+
"stopOnEntry": false,
47+
"sourceMaps": true,
48+
"outFiles": [
49+
"${workspaceFolder}/out/**/*.js"
50+
],
51+
"preLaunchTask": "Compile"
52+
},
53+
{
54+
"name": "Launch Multiroot Tests",
55+
"type": "extensionHost",
56+
"request": "launch",
57+
"runtimeExecutable": "${execPath}",
58+
"args": [
59+
"${workspaceFolder}/src/testMultiRootWkspc/multi.code-workspace",
60+
"--extensionDevelopmentPath=${workspaceFolder}",
61+
"--extensionTestsPath=${workspaceFolder}/out/test"
62+
],
63+
"stopOnEntry": false,
64+
"sourceMaps": true,
65+
"outFiles": [
66+
"${workspaceFolder}/out/**/*.js"
67+
],
68+
"preLaunchTask": "Compile"
69+
},
70+
{
71+
"name": "Launch Tests (with code coverage)",
72+
"type": "extensionHost",
73+
"request": "launch",
74+
"runtimeExecutable": "${execPath}",
75+
"args": [
76+
"${workspaceFolder}/src/test",
77+
"--extensionDevelopmentPath=${workspaceFolder}",
78+
"--extensionTestsPath=${workspaceFolder}/out/test"
79+
],
80+
"stopOnEntry": false,
81+
"sourceMaps": true,
82+
"outFiles": [
83+
"${workspaceFolder}/out/**/*.js"
84+
]
85+
}
86+
],
87+
"compounds": [
88+
{
89+
"name": "Extension + Debugger",
90+
"configurations": [
91+
"Launch Extension",
92+
"Launch Extension as debugServer"
93+
]
94+
}
95+
]
8096
}

.vscode/settings.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": true, // set this to true to hide the "out" folder with the compiled JS files
5-
"**/*.pyc": true,
6-
"**/__pycache__": true,
7-
"node_modules": true,
8-
".vscode-test": true,
9-
"**/.mypy_cache/**": true,
10-
"**/.ropeproject/**": true
11-
},
12-
"search.exclude": {
13-
"out": true // set this to false to include "out" folder in search results
14-
},
15-
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
16-
"tslint.enable": true,
17-
"python.linting.enabled": false,
18-
"python.unitTest.promptToConfigure": false,
19-
"python.workspaceSymbols.enabled": false,
3+
"files.exclude": {
4+
"out": true, // set this to true to hide the "out" folder with the compiled JS files
5+
"**/*.pyc": true,
6+
"**/__pycache__": true,
7+
"node_modules": true,
8+
".vscode-test": true,
9+
"**/.mypy_cache/**": true,
10+
"**/.ropeproject/**": true
11+
},
12+
"search.exclude": {
13+
"out": true, // set this to false to include "out" folder in search results
14+
"coverage": true
15+
},
16+
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
17+
"tslint.enable": true,
18+
"python.linting.enabled": false,
19+
"python.unitTest.promptToConfigure": false,
20+
"python.workspaceSymbols.enabled": false,
2021
"python.formatting.provider": "none",
2122
"files.insertFinalNewline": true
2223
}

.vscodeignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
.vscode/**
22
typings/**
33
out/test/**
4+
out/src/**
45
out/pythonFiles/**
6+
out/testMultiRootWkspc/**
57
test/**
68
src/**
79
scripts/**
810
**/*.map
911
.gitignore
1012
.gitmodules
13+
.editorconfig
14+
.eslintrc
15+
.gitattributes
1116
images/**/*.gif
1217
images/**/*.png
1318
tsconfig.json
1419
typings.json
20+
coverconfig.json
21+
tslint.json
22+
tsfmt.json
23+
gulpfile.js
1524
pythonFiles/**/*.pyc
1625
requirements.txt
1726
vsc-extension-quickstart.md
1827
.travis.yml
1928
webpack.config.js
29+
yarn.lock
30+
coverage/**
31+
CODE_OF_CONDUCT.md
32+
CODING_STANDARDS.md
33+
CONTRIBUTING.md
34+
ISSUE_TEMPLATE.md

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
```shell
1818
git clone https://github.com/microsoft/vscode-python
1919
cd vscode-python
20-
npm install
20+
yarn install
2121
```
2222

2323
### Incremental Build

coverconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"enabled": false,
3+
"relativeSourcePath": "../client",
4+
"relativeCoverageDir": "../../coverage",
5+
"ignorePatterns": [
6+
"**/node_modules/**"
7+
],
8+
"reports": [
9+
"text-summary",
10+
"json-summary",
11+
"json",
12+
"html",
13+
"lcov",
14+
"lcovonly"
15+
],
16+
"verbose": false
17+
}

gulpfile.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const colors = require('colors/safe');
1717
const gitmodified = require('gulp-gitmodified');
1818
const path = require('path');
1919
const debounce = require('debounce');
20+
const jeditor = require("gulp-json-editor");
21+
const del = require('del');
2022

2123
/**
2224
* Hygiene works by creating cascading subsets of all our files and
@@ -61,6 +63,29 @@ gulp.task('hygiene-watch', () => gulp.watch(all, debounce(() => run({ mode: 'cha
6163

6264
gulp.task('hygiene-modified', ['compile'], () => run({ mode: 'changes' }));
6365

66+
gulp.task('clean', ['output:clean', 'cover:clean'], () => { });
67+
68+
gulp.task('output:clean', () => del('coverage'));
69+
70+
gulp.task('cover:clean', () => del('coverage'));
71+
72+
gulp.task('cover:enable', () => {
73+
return gulp.src("./coverconfig.json")
74+
.pipe(jeditor((json) => {
75+
json.enabled = true;
76+
return json;
77+
}))
78+
.pipe(gulp.dest("./out", { 'overwrite': true }));
79+
});
80+
81+
gulp.task('cover:disable', () => {
82+
return gulp.src("./coverconfig.json")
83+
.pipe(jeditor((json) => {
84+
json.enabled = true;
85+
return json;
86+
}))
87+
.pipe(gulp.dest("./out", { 'overwrite': true }));
88+
});
6489

6590
/**
6691
* @typedef {Object} hygieneOptions - creates a new type named 'SpecialType'

0 commit comments

Comments
 (0)