Skip to content

Commit 00e4803

Browse files
committed
Merge remote-tracking branch 'origin/master' into ds/custom_editor
2 parents 7c81cfc + bd9615a commit 00e4803

File tree

354 files changed

+6060
-24165
lines changed

Some content is hidden

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

354 files changed

+6060
-24165
lines changed

.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 134 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ env:
1414
# Key for the cache created at the end of the the 'Cache ./pythonFiles/lib/python' step.
1515
CACHE_PYTHONFILES: cache-pvsc-pythonFiles
1616
ARTIFACT_NAME_VSIX: ms-python-insiders-vsix
17+
COVERAGE_REPORTS: tests-coverage-reports
1718
TEST_RESULTS_DIRECTORY: .
19+
LKG_TAG: ci-lkg
1820

1921
jobs:
2022
### Initialization: retrieve, install and cache dependencies
@@ -161,6 +163,12 @@ jobs:
161163
- name: Clean directory
162164
run: npm run clean
163165

166+
# Use the GITHUB_RUN_ID environment variable to update the build number.
167+
# GITHUB_RUN_ID is a unique number for each run within a repository.
168+
# This number does not change if you re-run the workflow run.
169+
- name: Update build number
170+
run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID
171+
164172
- name: Package the VSIX
165173
run: npm run package
166174

@@ -180,7 +188,7 @@ jobs:
180188
matrix:
181189
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
182190
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
183-
os: [ubuntu-latest]
191+
os: [ubuntu-latest, windows-latest]
184192
# Run the tests on the oldest and most recent versions of Python.
185193
python: [2.7, 3.8]
186194
test-suite: [ts-unit, python-unit, venv, single-workspace, multi-workspace, debugger, functional]
@@ -305,12 +313,19 @@ jobs:
305313
run: npm run test:unittests:cover
306314
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, 3.)
307315

308-
# Run the Python IPython tests in our codebase.
309-
# Produce JUnit-style log files that will be uploaded after all tests are complete.
316+
# Upload unit test coverage reports for later use in the "reports" job.
317+
- name: Upload unit test coverage reports
318+
uses: actions/upload-artifact@v1
319+
with:
320+
name: ${{runner.os}}-${{env.COVERAGE_REPORTS}}
321+
path: .nyc_output
322+
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, 3.)
323+
324+
# Run the Python and IPython tests in our codebase.
310325
- name: Run Python and IPython unit tests
311326
run: |
312-
python pythonFiles/tests/run_all.py --junit-xml=${{env.TEST_RESULTS_DIRECTORY}}/python-tests-junit.xml
313-
python -m IPython pythonFiles/tests/run_all.py -- --junit-xml=${{env.TEST_RESULTS_DIRECTORY}}/ipython-tests-junit.xml
327+
python pythonFiles/tests/run_all.py
328+
python -m IPython pythonFiles/tests/run_all.py
314329
if: matrix.test-suite == 'python-unit'
315330

316331
# The virtual environment based tests use the `testSingleWorkspace` set of tests
@@ -346,3 +361,117 @@ jobs:
346361
- name: Run functional tests
347362
run: npm run test:functional
348363
if: matrix.test-suite == 'functional'
364+
365+
smoke-tests:
366+
name: Smoke tests
367+
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
368+
runs-on: ${{ matrix.os }}
369+
needs: [build-vsix]
370+
if: github.repository == 'microsoft/vscode-python'
371+
strategy:
372+
matrix:
373+
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
374+
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
375+
os: [ubuntu-latest, windows-latest]
376+
python: [3.8]
377+
steps:
378+
- name: Checkout
379+
uses: actions/checkout@v2
380+
381+
- name: Retrieve cached npm files
382+
uses: actions/cache@v1
383+
with:
384+
path: ~/.npm
385+
key: ${{runner.os}}-${{env.CACHE_NPM_DEPS}}-${{hashFiles('package-lock.json')}}
386+
387+
- name: Install dependencies (npm ci)
388+
run: npm ci --prefer-offline
389+
390+
- name: Download VSIX
391+
uses: actions/download-artifact@v1
392+
with:
393+
name: ${{env.ARTIFACT_NAME_VSIX}}
394+
395+
# Extract the artifact from its download folder (./${{env.ARTIFACT_NAME_VSIX}}) to the repo root,
396+
# then delete the download folder and compile the source code.
397+
- name: Prepare for smoke tests
398+
run: |
399+
mv ${{env.ARTIFACT_NAME_VSIX}}/* .
400+
rm -r ${{env.ARTIFACT_NAME_VSIX}}
401+
npx tsc -p ./
402+
shell: bash
403+
404+
- name: Run smoke tests
405+
env:
406+
DISPLAY: 10
407+
uses: GabrielBB/[email protected]
408+
with:
409+
run: node ./out/test/smokeTest.js
410+
411+
coverage:
412+
name: Coverage reports upload
413+
runs-on: ubuntu-latest
414+
if: github.repository == 'microsoft/vscode-python'
415+
needs: [tests, smoke-tests]
416+
steps:
417+
- name: Checkout
418+
uses: actions/checkout@v2
419+
420+
- name: Retrieve cached npm files
421+
uses: actions/cache@v1
422+
with:
423+
path: ~/.npm
424+
key: ${{runner.os}}-${{env.CACHE_NPM_DEPS}}-${{hashFiles('package-lock.json')}}
425+
426+
- name: Install dependencies (npm ci)
427+
run: npm ci --prefer-offline
428+
429+
# It isn't possible to specify a regex for artifact names, so we have to download each artifact manually.
430+
# The name pattern is ${{runner.os}}-${{env.COVERAGE_REPORTS}}, and possible values for runner.os are `Linux`, `Windows`, or `macOS`.
431+
# See https://help.github.com/en/actions/reference/contexts-and-expression-syntax-for-github-actions#runner-context
432+
- name: Download Ubuntu test coverage artifacts
433+
uses: actions/download-artifact@v1
434+
with:
435+
name: Linux-${{env.COVERAGE_REPORTS}}
436+
437+
- name: Extract Ubuntu coverage artifacts to ./nyc_output
438+
run: |
439+
mkdir .nyc_output
440+
mv Linux-${{env.COVERAGE_REPORTS}}/* .nyc_output
441+
rm -r Linux-${{env.COVERAGE_REPORTS}}
442+
443+
- name: Generate coverage reports
444+
run: npm run test:cover:report
445+
continue-on-error: true
446+
447+
- name: Upload coverage to codecov
448+
uses: codecov/codecov-action@v1
449+
with:
450+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
451+
file: ./coverage/cobertura-coverage.xml
452+
453+
lkg-tag:
454+
# LKG = last known good
455+
name: Tag successful build as CI LKG
456+
runs-on: ubuntu-latest
457+
needs: [tests, smoke-tests]
458+
if: github.repository == 'microsoft/vscode-python'
459+
steps:
460+
- name: Delete existing tag
461+
run: |
462+
curl -s -X DELETE https://api.github.com/repos/microsoft/vscode-python/git/refs/tags/${{env.LKG_TAG}} \
463+
-H "Authorization: token ${{secrets.GITHUB_TOKEN}}"
464+
465+
# We only need to create a tag reference for lightweight tags.
466+
# See https://developer.github.com/v3/git/tags/#create-a-tag-object
467+
# And https://developer.github.com/v3/git/refs/#create-a-reference
468+
- name: Create a tag reference
469+
run: |
470+
curl -s -X POST "https://api.github.com/repos/microsoft/vscode-python/git/refs" \
471+
-H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
472+
-d @- << EOF
473+
{
474+
"ref": "refs/tags/${{env.LKG_TAG}}",
475+
"sha": "${{github.sha}}"
476+
}
477+
EOF

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@ pythonFiles/lib/**
2727
debug_coverage*/**
2828
languageServer/**
2929
languageServer.*/**
30-
!uitests/features/languageServer/**
31-
!uitests/src/languageServer/**
32-
!uitests/code/**/languageServer/**
3330
bin/**
3431
obj/**
3532
.pytest_cache
3633
tmp/**
3734
.python-version
3835
.vs/
3936
test-results.xml
40-
uitests/out/**
4137
!build/
4238
debug*.log
4339
ptvsd*.log

.vscode/launch.json

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -265,23 +265,6 @@
265265
"skipFiles": [
266266
"<node_internals>/**"
267267
]
268-
},
269-
{
270-
"name": "Behave Smoke Tests",
271-
"type": "python",
272-
"request": "launch",
273-
"program": "${workspaceFolder}/uitests/__main__.py",
274-
"args": [
275-
"test",
276-
"--",
277-
"--format",
278-
"progress3",
279-
// Change the tag `@wip` to what ever you want to run.
280-
// Default is assumed to be somethign that's a work in progress (wip).
281-
"--tags=@wip"
282-
],
283-
"justMyCode": false,
284-
"console": "internalConsole"
285268
}
286269
],
287270
"compounds": [

.vscode/settings.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"files.exclude": {
44
"out": true, // set this to true to hide the "out" folder with the compiled JS files
5-
"uitests/out": true,
65
"**/*.pyc": true,
76
".nyc_output": true,
87
"obj": true,
@@ -16,7 +15,6 @@
1615
},
1716
"search.exclude": {
1817
"out": true, // set this to false to include "out" folder in search results
19-
"uitests/out": true,
2018
"**/node_modules": true,
2119
"coverage": true,
2220
"languageServer*/**": true,
@@ -41,7 +39,7 @@
4139
"typescript.preferences.quoteStyle": "single",
4240
"javascript.preferences.quoteStyle": "single",
4341
"typescriptHero.imports.stringQuoteStyle": "'",
44-
"prettier.printWidth": 180,
42+
"prettier.printWidth": 120,
4543
"prettier.singleQuote": true,
4644
"editor.codeActionsOnSave": {
4745
"source.fixAll.eslint": true,
@@ -54,7 +52,8 @@
5452
"python.linting.flake8Enabled": true,
5553
"cucumberautocomplete.skipDocStringsFormat": true,
5654
"python.linting.flake8Args": [
57-
"--max-line-length=120"
55+
// Match what black does.
56+
"--max-line-length=88"
5857
],
5958
"typescript.preferences.importModuleSpecifier": "relative"
6059
}

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,3 @@ tmp/**
106106
tpn/**
107107
typings/**
108108
types/**
109-
uitests/**

PYTHON_INTERACTIVE_TROUBLESHOOTING.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Trouble shooting the Python Interactive Window
1+
# Troubleshooting Jupyter issues in the Python Interactive Window or Notebook Editor
22

3-
This document is intended to help troubleshoot problems in the Python Interactive Window.
3+
This document is intended to help troubleshoot problems with starting Jupyter in the Python Interactive Window or Notebook Editor.
44

55
---
66
## Jupyter Not Starting
@@ -10,12 +10,21 @@ This error can happen when
1010
* Jupyter is not installed
1111
* You picked the wrong Python environment (one that doesn't have Jupyter installed).
1212

13-
### The first step is to verify you are running the Python environment you want.
13+
### The first step is to verify you are running the Python environment that you have Jupyter installed into.
1414

15-
The Python you're using is picked with the selection dropdown on the bottom left of the VS Code window:
15+
The first time that you start the Interactive Window or the Notebook Editor VS Code will attempt to locate a Python environment that has Jupyter installed in it and can start a notebook.
16+
17+
The first Python interpreter to check will be the one selected with the selection dropdown on the bottom left of the VS Code window:
1618

1719
![selector](resources/PythonSelector.png)
1820

21+
Once a suitable interpreter with Jupyter has been located, VS Code will continue to use that interpreter for starting up Jupyter servers.
22+
If no interpreters are found with Jupyter installed a popup message will ask if you would like to install Jupyter into the current interpreter.
23+
24+
![install Jupyter](resources/InstallJupyter.png)
25+
26+
If you would like to change from using the saved Python interpreter to a new interpreter for launching Jupyter just use the "Python: Select interpreter to start Jupyter server" VS Code command to change it.
27+
1928
### The second step is to check that jupyter isn't giving any errors on startup.
2029

2130
Run the following command from an environment that matches the Python you selected:

0 commit comments

Comments
 (0)