Skip to content

Commit f60cc66

Browse files
Nikola HristovNikola Hristov
authored andcommitted
2 parents 3f6651a + 5433f5a commit f60cc66

File tree

16 files changed

+11537
-607
lines changed

16 files changed

+11537
-607
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 'Build VSIX'
2+
description: "Build the extension's VSIX"
3+
4+
inputs:
5+
node_version:
6+
description: 'Version of Node to install'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Install Node
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: ${{ inputs.node_version }}
16+
cache: 'npm'
17+
18+
# Minimum supported version is Python 3.9
19+
- name: Use Python 3.9
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.9
23+
24+
- name: Pip cache
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-build-vsix-${{ hashFiles('**/requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-build-vsix-
31+
32+
# For faster/better builds of sdists.
33+
- name: Update pip, install pipx and install wheel
34+
run: python -m pip install -U pip pipx wheel
35+
shell: bash
36+
37+
- name: Run npm ci
38+
run: npm ci --prefer-offline
39+
shell: bash
40+
41+
- name: Install bundled python libraries
42+
run: pipx run nox --session install_bundled_libs
43+
shell: bash
44+
45+
# Use the GITHUB_RUN_ID environment variable to update the build number.
46+
# GITHUB_RUN_ID is a unique number for each run within a repository.
47+
# This number does not change if you re-run the workflow run.
48+
- name: Update extension build number
49+
run: pipx run nox --session update_build_number -- $GITHUB_RUN_ID
50+
shell: bash
51+
52+
- name: Build VSIX
53+
run: npm run vsce-package
54+
shell: bash
55+
56+
- name: Upload VSIX
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: linter-package
60+
path: |
61+
**/*.vsix
62+
if-no-files-found: error
63+
retention-days: 7

.github/actions/lint/action.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 'Lint'
2+
description: 'Lint TypeScript and Python code'
3+
4+
inputs:
5+
node_version:
6+
description: 'Version of Node to install'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Install Node
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: ${{ inputs.node_version }}
16+
cache: 'npm'
17+
18+
- name: Install Node dependencies
19+
run: npm ci
20+
shell: bash
21+
22+
- name: Lint TypeScript code
23+
run: npm run lint
24+
shell: bash
25+
26+
- name: Check TypeScript format
27+
run: npm run format-check
28+
shell: bash
29+
30+
- name: Install Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.9'
34+
35+
- name: Pip cache
36+
uses: actions/cache@v4
37+
with:
38+
path: ~/.cache/pip
39+
key: ${{ runner.os }}-pip-lint-${{ hashFiles('**/requirements.txt') }}
40+
restore-keys: |
41+
${{ runner.os }}-pip-lint-
42+
43+
# For faster/better builds of sdists.
44+
- name: Update pip, install pipx and install wheel
45+
run: python -m pip install -U pip pipx wheel
46+
shell: bash
47+
48+
# This will install libraries to a target directory.
49+
- name: Install bundled python libraries
50+
run: pipx run nox --session install_bundled_libs
51+
shell: bash
52+
53+
- name: Check linting and formatting
54+
run: pipx run nox --session lint
55+
shell: bash

.github/workflows/pr-check.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
NODE_VERSION: 18.17.1
8+
TEST_RESULTS_DIRECTORY: .
9+
# Force a path with spaces and unicode chars to test extension works in these scenarios
10+
special-working-directory: './🐍 🐛'
11+
special-working-directory-relative: '🐍 🐛'
12+
13+
jobs:
14+
build-vsix:
15+
name: Create VSIX
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Build VSIX
22+
uses: ./.github/actions/build-vsix
23+
with:
24+
node_version: ${{ env.NODE_VERSION}}
25+
26+
lint:
27+
name: Lint
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Lint
34+
uses: ./.github/actions/lint
35+
with:
36+
node_version: ${{ env.NODE_VERSION }}
37+
38+
tests:
39+
name: Tests
40+
runs-on: ${{ matrix.os }}
41+
defaults:
42+
run:
43+
working-directory: ${{ env.special-working-directory }}
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
os: [ubuntu-latest, windows-latest]
48+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
49+
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
with:
54+
path: ${{ env.special-working-directory-relative }}
55+
56+
# Install bundled libs using 3.9 even though you test it on other versions.
57+
- name: Use Python 3.9
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: '3.9'
61+
62+
- name: Update pip, install pipx and install wheel
63+
run: python -m pip install -U pip pipx wheel
64+
shell: bash
65+
66+
# This will install libraries to a target directory.
67+
- name: Install bundled python libraries
68+
run: pipx run nox --session install_bundled_libs
69+
shell: bash
70+
71+
- name: Install Node
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: ${{ env.NODE_VERSION }}
75+
cache: 'npm'
76+
cache-dependency-path: ${{ env.special-working-directory-relative }}/package-lock.json
77+
78+
- name: Install dependencies (npm ci)
79+
run: npm ci
80+
81+
# Now that the bundle is installed to target using python 3.9
82+
# switch back the python we want to test with
83+
- name: Use Python ${{ matrix.python }}
84+
uses: actions/setup-python@v5
85+
with:
86+
python-version: ${{ matrix.python }}
87+
88+
# The new python may not have nox so install it again
89+
- name: Update pip, install pipx and install wheel (again)
90+
run: python -m pip install -U pip pipx wheel
91+
shell: bash
92+
93+
- name: Start xvfb on Linux
94+
run: |
95+
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
96+
echo "DISPLAY=:99" >> $GITHUB_ENV
97+
echo ">>> Started xvfb"
98+
if: ${{ runner.os }} == 'Linux'
99+
100+
- name: Run tests
101+
run: pipx run nox --session tests
102+
shell: bash
103+
env:
104+
DISPLAY: ${{ env.DISPLAY }}

.github/workflows/push-check.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Push Validation
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'release'
8+
- 'release/*'
9+
- 'release-*'
10+
11+
env:
12+
NODE_VERSION: 18.17.1
13+
TEST_RESULTS_DIRECTORY: .
14+
# Force a path with spaces and unicode chars to test extension works in these scenarios
15+
special-working-directory: './🐍 🐛'
16+
special-working-directory-relative: '🐍 🐛'
17+
18+
jobs:
19+
build-vsix:
20+
name: Create VSIX
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Build VSIX
27+
uses: ./.github/actions/build-vsix
28+
with:
29+
node_version: ${{ env.NODE_VERSION}}
30+
31+
lint:
32+
name: Lint
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Lint
39+
uses: ./.github/actions/lint
40+
with:
41+
node_version: ${{ env.NODE_VERSION }}
42+
43+
tests:
44+
name: Tests
45+
runs-on: ${{ matrix.os }}
46+
defaults:
47+
run:
48+
working-directory: ${{ env.special-working-directory }}
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
os: [ubuntu-latest, windows-latest]
53+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
with:
59+
path: ${{ env.special-working-directory-relative }}
60+
61+
# Install bundled libs using 3.9 even though you test it on other versions.
62+
- name: Use Python 3.9
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: '3.9'
66+
67+
- name: Update pip, install pipx and install wheel
68+
run: python -m pip install -U pip pipx wheel
69+
shell: bash
70+
71+
# This will install libraries to a target directory.
72+
- name: Install bundled python libraries
73+
run: pipx run nox --session install_bundled_libs
74+
shell: bash
75+
76+
- name: Install Node
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: ${{ env.NODE_VERSION }}
80+
cache: 'npm'
81+
cache-dependency-path: ${{ env.special-working-directory-relative }}/package-lock.json
82+
83+
- name: Install dependencies (npm ci)
84+
run: npm ci
85+
86+
# Now that the bundle is installed to target using python 3.9
87+
# switch back the python we want to test with
88+
- name: Use Python ${{ matrix.python }}
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: ${{ matrix.python }}
92+
93+
# The new python may not have nox so install it again
94+
- name: Update pip, install pipx and install wheel (again)
95+
run: python -m pip install -U pip pipx wheel
96+
shell: bash
97+
98+
- name: Start xvfb on Linux
99+
run: |
100+
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
101+
echo "DISPLAY=:99" >> $GITHUB_ENV
102+
echo ">>> Started xvfb"
103+
if: ${{ runner.os }} == 'Linux'
104+
105+
- name: Run tests
106+
run: pipx run nox --session tests
107+
shell: bash

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Python Debugger extension for Visual Studio Code
2+
3+
A [Visual Studio Code](https://code.visualstudio.com/) [extension](https://marketplace.visualstudio.com/VSCode) that supports Python debugging with debugpy. Python Debugger provides a seamless debugging experience by allowing you to set breakpoints, step through code, inspect variables, and perform other essential debugging tasks. The debugpy extension offers debugging support for various types of Python applications including scripts, web applications, remote processes, and multi-threaded processes.
4+
5+
Note:
6+
- The Python extension offers the python debugger extension as an optional installation, including it during the setup process.
7+
- This extension is supported for all [actively supported versions](https://devguide.python.org/#status-of-python-branches) of the Python language. See below for support on deprecated Python versions.
8+
9+
10+
## Purpose
11+
12+
The main intent of this extension is to offer:
13+
14+
1. **Independence and Compatibility:** The Python Debugger extension aims to separate the debugging functionality from the main Python extension to prevent compatibility issues. This ensures that even as the Python extension drops support for older Python versions (e.g., Python 3.7), you can continue debugging projects with those versions without downgrading your Python extension. This allows you to access new features and bug fixes while keeping your debugging capabilities intact.
15+
16+
2. **Platform-Specific Builds:** Unlike the main Python extension, which bundles all debugpy builds for various platforms into a single extension package, the Python Debugger extension provides a more streamlined approach: it delivers platform-specific builds, ensuring you only receive the components relevant to your specific operating system. This reduces download times and unnecessary overhead.
17+
18+
3. **Feature Parity and Ongoing Updates:** This extension replicates all the functionality available in the main Python extension, and more. Going forward, any new debugger features will be added to this extension. In the future, the Python extension will no longer offer debugging support on its own, and we will transition all debugging support to this extension for all debugging functionality.
19+
20+
21+
## Usage
22+
23+
Once installed in Visual Studio Code, python-debugger will be automatically activated when you open a Python file.
24+
25+
## Disabling the Python Debugger extension
26+
If you want to disable the Python Debugger extension, you can [disable this extension](https://code.visualstudio.com/docs/editor/extension-marketplace#_disable-an-extension) per workspace in Visual Studio Code.
27+
28+
## Commands
29+
30+
| Command | Description |
31+
| ---------------------- | --------------------------------- |
32+
| Python Debugger: viewOutput | Show the Python Debugger Extension output. |
33+
| Python Debugger: clearCacheAndReload | Allows you to clear the global values set in the extension. |
34+
| Python Debugger: debugInTerminal | Allows you to debug a simple Python file in the terminal. |
35+
36+
## Limited support for deprecated Python versions
37+
38+
Older versions of the Python Debugger extension are available for debugging Python projects that use outdated Python versions like Python 2.7 and Python 3.6. However, it’s important to note that our team is no longer maintaining these extension versions. We strongly advise you to update your project to a supported Python version if possible.
39+
40+
You can reference the table below to find the most recent Python Debugger extension version that offers debugging support for projects using deprecated Python versions, as well as the debugpy version that is shipped in each extension version.
41+
42+
> **Note**: If you do not see older extension versions to install (<=`2024.0.0`), try opting-in to pre-releases. You can do so on the extension page by clicking `Switch to Pre-Release Version`.
43+
44+
| Python version | Latest supported Python Debugger extension version | debugpy version |
45+
| -------------- | -------------------------------------------------- | ---------------- |
46+
| 2.7, >= 3.5 | 2023.1.XXX | 1.5.1 |
47+
| >= 3.7 | 2024.0.XXX | 1.7.0 |
48+
| >= 3.8 | 2024.2.XXX | 1.8.1 |
49+
| >= 3.9 | 2025.5.XXX | 1.8.13 |
50+
51+
52+
> **Note**: Once you install an older version of the Python Debugger extension in VS Code, you may want to disable auto update by changing the value of the `"extensions.autoUpdate"` setting in your `settings.json` file.
53+
54+
55+
## Data and telemetry
56+
The Debugpy Extension for Visual Studio Code collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](https://privacy.microsoft.com/privacystatement) to learn more. This extension respects the `telemetry.enableTelemetry` setting which you can learn more about at https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting.

0 commit comments

Comments
 (0)