| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bd12464 commit 258c28c
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,6 @@ jobs: | |||
| 46 | 46 | run: | | |
| 47 | 47 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt | |
| 48 | 48 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2' | |
| 49 | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 50 | 49 | ||
| 51 | 50 | - name: Install debugpy wheels | |
| 52 | 51 | run: | | |
@@ -259,9 +258,8 @@ jobs: | |||
| 259 | 258 | run: | | |
| 260 | 259 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt | |
| 261 | 260 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2' | |
| 262 | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 263 | - # We need to have debugpy available in wheels/ so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase. | ||
| 264 | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 261 | + # We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase. | ||
| 262 | + python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 265 | 263 | ||
| 266 | 264 | - name: Install test requirements | |
| 267 | 265 | run: python -m pip install --upgrade -r build/test-requirements.txt | |
@@ -272,14 +270,20 @@ jobs: | |||
| 272 | 270 | python -m pip install --upgrade -r ./build/ipython-test-requirements.txt | |
| 273 | 271 | if: matrix.test-suite == 'python-unit' | |
| 274 | 272 | ||
| 275 | - - name: Install debugpy wheels | ||
| 273 | + - name: Install debugpy wheels (python 3.8) | ||
| 276 | 274 | run: | | |
| 277 | 275 | python -m pip install wheel | |
| 278 | 276 | python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt | |
| 279 | 277 | python ./pythonFiles/install_debugpy.py | |
| 280 | 278 | shell: bash | |
| 281 | 279 | if: matrix.test-suite == 'debugger' && matrix.python == 3.8 | |
| 282 | 280 | ||
| 281 | + - name: Install debugpy (python 2.7) | ||
| 282 | + run: | | ||
| 283 | + python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 284 | + shell: bash | ||
| 285 | + if: matrix.test-suite == 'debugger' && matrix.python == 2.7 | ||
| 286 | + | ||
| 283 | 287 | - name: Install functional test requirements | |
| 284 | 288 | run: | | |
| 285 | 289 | python -m pip install numpy | |
@@ -454,7 +458,7 @@ jobs: | |||
| 454 | 458 | python -m pip install --upgrade -r build/test-requirements.txt | |
| 455 | 459 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt | |
| 456 | 460 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2' | |
| 457 | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 461 | + python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 458 | 462 | shell: bash | |
| 459 | 463 | ||
| 460 | 464 | - name: pip install ipython requirements | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -301,7 +301,9 @@ Steps to build the extension on your machine once you've cloned the repo: | |||
| 301 | 301 | > npm ci | |
| 302 | 302 | > python3 -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt | |
| 303 | 303 | > python3 -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2' | |
| 304 | - > python3 -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 304 | + # For python 3.6 and lower use this command to install the debugger | ||
| 305 | + > python3 -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 306 | + # For python 3.7 and greater use this command to install the debugger | ||
| 305 | 307 | > python3 -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt | |
| 306 | 308 | > python3 ./pythonFiles/install_debugpy.py | |
| 307 | 309 | > npm run clean | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,6 @@ steps: | |||
| 21 | 21 | - bash: | | |
| 22 | 22 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt | |
| 23 | 23 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2' | |
| 24 | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 25 | 24 | failOnStderr: true | |
| 26 | 25 | displayName: 'pip install requirements' | |
| 27 | 26 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,7 +94,7 @@ steps: | |||
| 94 | 94 | python -m pip install --upgrade -r build/test-requirements.txt | |
| 95 | 95 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt | |
| 96 | 96 | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2' | |
| 97 | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 97 | + python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
| 98 | 98 | displayName: 'pip install system test requirements' | |
| 99 | 99 | condition: and(succeeded(), eq(variables['NeedsPythonTestReqs'], 'true')) | |
| 100 | 100 | ||
@@ -161,7 +161,7 @@ steps: | |||
| 161 | 161 | # Run the pip installs in the 3 environments (windows) | |
| 162 | 162 | - script: | | |
| 163 | 163 | call activate base | |
| 164 | - conda install --quiet -y --file build/ci/conda_base.yml | ||
| 164 | + conda install --quiet -y --file build/ci/conda_base.yml | ||
| 165 | 165 | python -m pip install --upgrade -r build/conda-functional-requirements.txt | |
| 166 | 166 | call activate conda_env_1 | |
| 167 | 167 | python -m pip install --upgrade -r build/conda-functional-requirements.txt | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -405,37 +405,6 @@ gulp.task('installNewDebugpy', async () => { | |||
| 405 | 405 | } | |
| 406 | 406 | ||
| 407 | 407 | rmrf.sync('./pythonFiles/lib/temp'); | |
| 408 | - | ||
| 409 | - // Install source only version of new DEBUGPY for use with all other python versions. | ||
| 410 | - const args = [ | ||
| 411 | - '-m', | ||
| 412 | - 'pip', | ||
| 413 | - '--disable-pip-version-check', | ||
| 414 | - 'install', | ||
| 415 | - '-t', | ||
| 416 | - './pythonFiles/lib/python/debugpy/no_wheels', | ||
| 417 | - '--no-cache-dir', | ||
| 418 | - '--implementation', | ||
| 419 | - 'py', | ||
| 420 | - '--no-deps', | ||
| 421 | - '--upgrade', | ||
| 422 | - '--pre', | ||
| 423 | - 'debugpy' | ||
| 424 | - ]; | ||
| 425 | - const successWithoutWheels = await spawnAsync(process.env.CI_PYTHON_PATH || 'python3', args, undefined, true) | ||
| 426 | - .then(() => true) | ||
| 427 | - .catch((ex) => { | ||
| 428 | - console.error("Failed to install DEBUGPY using 'python3'", ex); | ||
| 429 | - return false; | ||
| 430 | - }); | ||
| 431 | - if (!successWithoutWheels) { | ||
| 432 | - console.info( | ||
| 433 | - "Failed to install source only version of new DEBUGPY using 'python3', attempting to install using 'python'" | ||
| 434 | - ); | ||
| 435 | - await spawnAsync('python', args).catch((ex) => | ||
| 436 | - console.error("Failed to install source only DEBUGPY using 'python'", ex) | ||
| 437 | - ); | ||
| 438 | - } | ||
| 439 | 408 | }); | |
| 440 | 409 | ||
| 441 | 410 | // Install the last stable version of old PTVSD (which includes a middle layer adapter and requires ptvsd_launcher.py) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Fixes issue with importing `debupy` in interactive window. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,9 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| 10 | - DEBUGGER_DEST = os.path.join( | ||
| 11 | - EXTENSION_ROOT, "pythonFiles", "lib", "python", "debugpy", "wheels" | ||
| 12 | - ) | ||
| 10 | + DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python") | ||
| 13 | 11 | DEBUGGER_PACKAGE = "debugpy" | |
| 14 | 12 | DEBUGGER_PYTHON_VERSIONS = ("cp37",) | |
| 15 | 13 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,20 +238,13 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener { | |||
| 238 | 238 | * @returns {Promise<string>} | |
| 239 | 239 | * @memberof JupyterDebugger | |
| 240 | 240 | */ | |
| 241 | - private async getDebuggerPath(notebook: INotebook): Promise<string> { | ||
| 241 | + private async getDebuggerPath(_notebook: INotebook): Promise<string> { | ||
| 242 | 242 | if (this.debuggerPackage === 'ptvsd') { | |
| 243 | 243 | return path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'old_ptvsd'); | |
| 244 | 244 | } | |
| 245 | - const pythonVersion = await this.getKernelPythonVersion(notebook); | ||
| 246 | - // The new debug adapter with wheels is only supported in 3.7 | ||
| 247 | - // Code can be found here (src/client/debugger/extension/adapter/factory.ts). | ||
| 248 | - if (pythonVersion && pythonVersion.major === 3 && pythonVersion.minor === 7) { | ||
| 249 | - // Return debugger with wheels | ||
| 250 | - return path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy', 'wheels'); | ||
| 251 | - } | ||
| 252 | 245 | ||
| 253 | 246 | // We are here so this is NOT python 3.7, return debugger without wheels | |
| 254 | - return path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy', 'no_wheels'); | ||
| 247 | + return path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python'); | ||
| 255 | 248 | } | |
| 256 | 249 | private async calculateDebuggerPathList(notebook: INotebook): Promise<string | undefined> { | |
| 257 | 250 | const extraPaths: string[] = []; | |
@@ -328,11 +321,6 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener { | |||
| 328 | 321 | return notebook.execute(code, Identifiers.EmptyFileName, 0, uuid(), undefined, true); | |
| 329 | 322 | } | |
| 330 | 323 | ||
| 331 | - private async getKernelPythonVersion(notebook: INotebook): Promise<Version | undefined> { | ||
| 332 | - const execResults = await this.executeSilently(notebook, 'import sys;print(sys.version)'); | ||
| 333 | - return this.parseVersionInfo(execResults, 'pythonVersionInfo'); | ||
| 334 | - } | ||
| 335 | - | ||
| 336 | 324 | private async debuggerCheck(notebook: INotebook): Promise<Version | undefined> { | |
| 337 | 325 | // We don't want to actually import the debugger to check version so run | |
| 338 | 326 | // python instead. If we import an old version it's hard to get rid of on | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,23 +75,17 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac | |||
| 75 | 75 | return new DebugAdapterExecutable(pythonPath, [configuration.debugAdapterPath, ...logArgs]); | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | - const debuggerPathToUse = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python', 'debugpy'); | ||
| 79 | - | ||
| 80 | - if (await this.useNewDebugger(pythonPath)) { | ||
| 81 | - sendTelemetryEvent(EventName.DEBUG_ADAPTER_USING_WHEELS_PATH, undefined, { usingWheels: true }); | ||
| 82 | - return new DebugAdapterExecutable(pythonPath, [ | ||
| 83 | - path.join(debuggerPathToUse, 'wheels', 'debugpy', 'adapter'), | ||
| 84 | - ...logArgs | ||
| 85 | - ]); | ||
| 86 | - } else { | ||
| 87 | - sendTelemetryEvent(EventName.DEBUG_ADAPTER_USING_WHEELS_PATH, undefined, { | ||
| 88 | - usingWheels: false | ||
| 89 | - }); | ||
| 90 | - return new DebugAdapterExecutable(pythonPath, [ | ||
| 91 | - path.join(debuggerPathToUse, 'no_wheels', 'debugpy', 'adapter'), | ||
| 92 | - ...logArgs | ||
| 93 | - ]); | ||
| 94 | - } | ||
| 78 | + const debuggerAdapterPathToUse = path.join( | ||
| 79 | + EXTENSION_ROOT_DIR, | ||
| 80 | + 'pythonFiles', | ||
| 81 | + 'lib', | ||
| 82 | + 'python', | ||
| 83 | + 'debugpy', | ||
| 84 | + 'adapter' | ||
| 85 | + ); | ||
| 86 | + | ||
| 87 | + sendTelemetryEvent(EventName.DEBUG_ADAPTER_USING_WHEELS_PATH, undefined, { usingWheels: true }); | ||
| 88 | + return new DebugAdapterExecutable(pythonPath, [debuggerAdapterPathToUse, ...logArgs]); | ||
| 95 | 89 | } | |
| 96 | 90 | } else { | |
| 97 | 91 | this.experimentsManager.sendTelemetryIfInExperiment(DebugAdapterNewPtvsd.control); | |
@@ -105,22 +99,6 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac | |||
| 105 | 99 | throw new Error('Debug Adapter Executable not provided'); | |
| 106 | 100 | } | |
| 107 | 101 | ||
| 108 | - /** | ||
| 109 | - * Check and return whether the user should and can use the new Debugger wheels or not. | ||
| 110 | - * | ||
| 111 | - * @param {string} pythonPath Path to the python executable used to launch the Python Debug Adapter (result of `this.getPythonPath()`) | ||
| 112 | - * @returns {Promise<boolean>} Whether the user should and can use the new Debugger wheels or not. | ||
| 113 | - * @memberof DebugAdapterDescriptorFactory | ||
| 114 | - */ | ||
| 115 | - private async useNewDebugger(pythonPath: string): Promise<boolean> { | ||
| 116 | - const interpreterInfo = await this.interpreterService.getInterpreterDetails(pythonPath); | ||
| 117 | - if (!interpreterInfo || !interpreterInfo.version || !interpreterInfo.version.raw.startsWith('3.7')) { | ||
| 118 | - return false; | ||
| 119 | - } | ||
| 120 | - | ||
| 121 | - return true; | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | 102 | /** | |
| 125 | 103 | * Get the python executable used to launch the Python Debug Adapter. | |
| 126 | 104 | * In the case of `attach` scenarios, just use the workspace interpreter, else first available one. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ import '../../../common/extensions'; | |||
| 9 | 9 | ||
| 10 | 10 | const pathToPythonLibDir = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python'); | |
| 11 | 11 | const pathToScript = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'ptvsd_launcher.py'); | |
| 12 | - const pathToDebugger = path.join(pathToPythonLibDir, 'debugpy', 'no_wheels', 'debugpy'); | ||
| 12 | + const pathToDebugger = path.join(pathToPythonLibDir, 'debugpy'); | ||
| 13 | 13 | ||
| 14 | 14 | export type RemoteDebugOptions = { | |
| 15 | 15 | host: string; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments