GeezerVison is showing github.com — Add npm project for Python API (#21631) · Pythoneryeah/vscode-python@f38f6e5
File treeExpand file treeCollapse file tree Open diff view settings pythonEnvironments/creation
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .eslintignore +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +pythonExtensionApi/out/ | | 2 | + | 1 | 3 | # The following files were grandfathered out of eslint. They can be removed as time permits. | 2 | 4 |
| 3 | 5 | src/test/analysisEngineTest.ts | |
Collapse file Copy file name to clipboardExpand all lines: .gitignore +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -23,6 +23,7 @@ cucumber-report.json | 23 | 23 | port.txt | 24 | 24 | precommit.hook | 25 | 25 | pythonFiles/lib/** | | 26 | +pythonFiles/get_pip.py | 26 | 27 | debug_coverage*/** | 27 | 28 | languageServer/** | 28 | 29 | languageServer.*/** | |
Collapse file Copy file name to clipboard +56Lines changed: 56 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +############################################################################################### | | 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. | | 3 | +# Licensed under the MIT License. See License.txt in the project root for license information. | | 4 | +############################################################################################### | | 5 | +name: $(Date:yyyyMMdd)$(Rev:.r) | | 6 | + | | 7 | +pr: none | | 8 | + | | 9 | +resources: | | 10 | + repositories: | | 11 | + - repository: templates | | 12 | + type: github | | 13 | + name: microsoft/vscode-engineering | | 14 | + ref: main | | 15 | + endpoint: Monaco | | 16 | + | | 17 | +parameters: | | 18 | + - name: quality | | 19 | + displayName: Quality | | 20 | + type: string | | 21 | + default: latest | | 22 | + values: | | 23 | + - latest | | 24 | + - next | | 25 | + - name: publishPythonApi | | 26 | + displayName: 🚀 Publish pythonExtensionApi | | 27 | + type: boolean | | 28 | + default: false | | 29 | + | | 30 | +extends: | | 31 | + template: azure-pipelines/npm-package/pipeline.yml@templates | | 32 | + parameters: | | 33 | + npmPackages: | | 34 | + - name: pythonExtensionApi | | 35 | + testPlatforms: | | 36 | + - name: Linux | | 37 | + nodeVersions: | | 38 | + - 16.17.1 | | 39 | + - name: MacOS | | 40 | + nodeVersions: | | 41 | + - 16.17.1 | | 42 | + - name: Windows | | 43 | + nodeVersions: | | 44 | + - 16.17.1 | | 45 | + testSteps: | | 46 | + - template: /build/azure-pipelines/templates/test-steps.yml@self | | 47 | + parameters: | | 48 | + package: pythonExtensionApi | | 49 | + buildSteps: | | 50 | + - template: /build/azure-pipelines/templates/pack-steps.yml@self | | 51 | + parameters: | | 52 | + package: pythonExtensionApi | | 53 | + ghTagPrefix: release/pythonExtensionApi/ | | 54 | + tag: ${{ parameters.quality }} | | 55 | + publishPackage: ${{ parameters.publishPythonApi }} | | 56 | + workingDirectory: $(Build.SourcesDirectory)/pythonExtensionApi |
Collapse file Copy file name to clipboard +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +############################################################################################### | | 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. | | 3 | +# Licensed under the MIT License. See License.txt in the project root for license information. | | 4 | +############################################################################################### | | 5 | +parameters: | | 6 | +- name: package | | 7 | + | | 8 | +steps: | | 9 | + - script: npm install --root-only | | 10 | + workingDirectory: $(Build.SourcesDirectory) | | 11 | + displayName: Install root dependencies | | 12 | + - script: npm install | | 13 | + workingDirectory: $(Build.SourcesDirectory)/${{ parameters.package }} | | 14 | + displayName: Install package dependencies |
Collapse file Copy file name to clipboard +23Lines changed: 23 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +############################################################################################### | | 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. | | 3 | +# Licensed under the MIT License. See License.txt in the project root for license information. | | 4 | +############################################################################################### | | 5 | +parameters: | | 6 | +- name: package | | 7 | + type: string | | 8 | +- name: script | | 9 | + type: string | | 10 | + default: 'all:publish' | | 11 | + | | 12 | +steps: | | 13 | + - script: npm install --root-only | | 14 | + workingDirectory: $(Build.SourcesDirectory) | | 15 | + displayName: Install root dependencies | | 16 | + - bash: | | | 17 | + /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | | 18 | + echo ">>> Started xvfb" | | 19 | + displayName: Start xvfb | | 20 | + condition: eq(variables['Agent.OS'], 'Linux') | | 21 | + - script: npm run ${{ parameters.script }} | | 22 | + workingDirectory: $(Build.SourcesDirectory)/${{ parameters.package }} | | 23 | + displayName: Verify package |
Collapse file Copy file name to clipboard +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +/*--------------------------------------------------------------------------------------------- | | 2 | + * Copyright (c) Microsoft Corporation. All rights reserved. | | 3 | + * Licensed under the MIT License. See License.txt in the project root for license information. | | 4 | + *--------------------------------------------------------------------------------------------*/ | | 5 | + | | 6 | +process.exitCode = 1; |
Collapse file Copy file name to clipboardExpand all lines: gulpfile.js +17-1Lines changed: 17 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ const tsProject = ts.createProject('./tsconfig.json', { typescript }); | 27 | 27 |
| 28 | 28 | const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined; | 29 | 29 |
| 30 | | -gulp.task('compile', (done) => { | | 30 | +gulp.task('compileCore', (done) => { | 31 | 31 | let failed = false; | 32 | 32 | tsProject | 33 | 33 | .src() | @@ -39,6 +39,22 @@ gulp.task('compile', (done) => { | 39 | 39 | .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); | 40 | 40 | }); | 41 | 41 |
| | 42 | +const apiTsProject = ts.createProject('./pythonExtensionApi/tsconfig.json', { typescript }); | | 43 | + | | 44 | +gulp.task('compileApi', (done) => { | | 45 | + let failed = false; | | 46 | + apiTsProject | | 47 | + .src() | | 48 | + .pipe(apiTsProject()) | | 49 | + .on('error', () => { | | 50 | + failed = true; | | 51 | + }) | | 52 | + .js.pipe(gulp.dest('./pythonExtensionApi/out')) | | 53 | + .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); | | 54 | +}); | | 55 | + | | 56 | +gulp.task('compile', gulp.series('compileCore', 'compileApi')); | | 57 | + | 42 | 58 | gulp.task('precommit', (done) => run({ exitOnError: true, mode: 'staged' }, done)); | 43 | 59 |
| 44 | 60 | gulp.task('output:clean', () => del(['coverage'])); | |
Collapse file Copy file name to clipboardExpand all lines: package.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2064 | 2064 | "testSmoke": "cross-env INSTALL_JUPYTER_EXTENSION=true \"node ./out/test/smokeTest.js\"", | 2065 | 2065 | "testInsiders": "cross-env VSC_PYTHON_CI_TEST_VSC_CHANNEL=insiders INSTALL_PYLANCE_EXTENSION=true TEST_FILES_SUFFIX=insiders.test CODE_TESTS_WORKSPACE=src/testMultiRootWkspc/smokeTests \"node ./out/test/standardTest.js\"", | 2066 | 2066 | "lint-staged": "node gulpfile.js", | 2067 | | - "lint": "eslint --ext .ts,.js src build", | 2068 | | - "lint-fix": "eslint --fix --ext .ts,.js src build gulpfile.js", | | 2067 | + "lint": "eslint --ext .ts,.js src build pythonExtensionApi", | | 2068 | + "lint-fix": "eslint --fix --ext .ts,.js src build pythonExtensionApi gulpfile.js", | 2069 | 2069 | "format-check": "prettier --check 'src/**/*.ts' 'build/**/*.js' '.github/**/*.yml' gulpfile.js", | 2070 | 2070 | "format-fix": "prettier --write 'src/**/*.ts' 'build/**/*.js' '.github/**/*.yml' gulpfile.js", | 2071 | 2071 | "clean": "gulp clean", | |
Collapse file Copy file name to clipboard +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +example/** | | 2 | +dist/ | | 3 | +out/**/*.map | | 4 | +out/**/*.tsbuildInfo | | 5 | +src/ | | 6 | +.eslintrc* | | 7 | +.eslintignore | | 8 | +tsconfig*.json |
Collapse file Copy file name to clipboard +21Lines changed: 21 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Copyright (c) Microsoft Corporation. All rights reserved. | | 2 | + | | 3 | +MIT License | | 4 | + | | 5 | +Permission is hereby granted, free of charge, to any person obtaining a copy | | 6 | +of this software and associated documentation files (the "Software"), to deal | | 7 | +in the Software without restriction, including without limitation the rights | | 8 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | | 9 | +copies of the Software, and to permit persons to whom the Software is | | 10 | +furnished to do so, subject to the following conditions: | | 11 | + | | 12 | +The above copyright notice and this permission notice shall be included in all | | 13 | +copies or substantial portions of the Software. | | 14 | + | | 15 | +THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | | 16 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | | 17 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | | 18 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | | 19 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | | 20 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | | 21 | +SOFTWARE. |
|