From a18e5a918b85d7ebf63924f56ce075bb918ddbe1 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 4 May 2021 01:19:44 -0700 Subject: [PATCH 1/4] Ensure using python 3.6 when building VSIX with JediLSP --- .github/actions/build-vsix/action.yml | 44 +++++++++++++++++++-------- .github/workflows/build.yml | 1 + news/2 Fixes/16119.md | 1 + 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 news/2 Fixes/16119.md diff --git a/.github/actions/build-vsix/action.yml b/.github/actions/build-vsix/action.yml index 318dd5b8da15..17aa0204f61f 100644 --- a/.github/actions/build-vsix/action.yml +++ b/.github/actions/build-vsix/action.yml @@ -10,35 +10,55 @@ runs: using: 'composite' steps: # For faster/better builds of sdists. - - run: python -m pip install wheel + - name: Install build pre-requisite + run: python -m pip install wheel shell: bash - - run: python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt + - name: Install python dependencies + run: python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt shell: bash - - run: | - python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py --platform any --abi none --no-deps --only-binary :all: --upgrade -r jedils_requirements.txt - shell: bash - - - run: | + - name: Install debugpy + run: | python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt python ./pythonFiles/install_debugpy.py shell: bash - - run: npm ci --prefer-offline + # Jedi LS depends on dataclasses which was a pypi install in 3.6 + - name: Use Python Python 3.6 for JediLSP + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - name: Install Jedi LSP + run: | + python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py --platform any --abi none --no-deps --only-binary :all: --upgrade -r jedils_requirements.txt + shell: bash + + - name: Use Python ${{env.PYTHON_VERSION}} + uses: actions/setup-python@v2 + with: + python-version: ${{env.PYTHON_VERSION}} + + - name: Run npm ci + run: npm ci --prefer-offline shell: bash # Use the GITHUB_RUN_ID environment variable to update the build number. # GITHUB_RUN_ID is a unique number for each run within a repository. # This number does not change if you re-run the workflow run. - - run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID + - name: Update extension build number + run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID shell: bash - - run: npm run addExtensionDependencies + - name: Update extension dependencies + run: npm run addExtensionDependencies shell: bash - - run: npm run addExtensionPackDependencies + - name: Update Optional extension dependencies + run: npm run addExtensionPackDependencies shell: bash - - run: npm run package + - name: Build VSIX + run: npm run package shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c8cdd91f8db..eee87fbc85d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: - 'release-*' env: + PYTHON_VERSION: 3.9 NODE_VERSION: 12.15.0 # Force a path with spaces and to test extension works in these scenarios # Unicode characters are causing 2.7 failures so skip that for now. diff --git a/news/2 Fixes/16119.md b/news/2 Fixes/16119.md new file mode 100644 index 000000000000..a9876f43b29b --- /dev/null +++ b/news/2 Fixes/16119.md @@ -0,0 +1 @@ +Ensure that `dataclasses` is installed when using Jedi LSP. From df8ecbdfbf4e00af4c3de47cf8b13ff7b6811672 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 4 May 2021 09:55:47 -0700 Subject: [PATCH 2/4] Fix builds --- .github/actions/build-vsix/action.yml | 15 ++++----------- .github/workflows/build.yml | 16 +++++++++++----- .github/workflows/pr-check.yml | 14 ++++++++++---- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/actions/build-vsix/action.yml b/.github/actions/build-vsix/action.yml index 17aa0204f61f..537013baea63 100644 --- a/.github/actions/build-vsix/action.yml +++ b/.github/actions/build-vsix/action.yml @@ -9,6 +9,10 @@ outputs: runs: using: 'composite' steps: + - name: Upgrade Pip + run: python -m pip install -U pip + shell: bash + # For faster/better builds of sdists. - name: Install build pre-requisite run: python -m pip install wheel @@ -24,22 +28,11 @@ runs: python ./pythonFiles/install_debugpy.py shell: bash - # Jedi LS depends on dataclasses which was a pypi install in 3.6 - - name: Use Python Python 3.6 for JediLSP - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - name: Install Jedi LSP run: | python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py --platform any --abi none --no-deps --only-binary :all: --upgrade -r jedils_requirements.txt shell: bash - - name: Use Python ${{env.PYTHON_VERSION}} - uses: actions/setup-python@v2 - with: - python-version: ${{env.PYTHON_VERSION}} - - name: Run npm ci run: npm ci --prefer-offline shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eee87fbc85d9..05d2ad534bcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,18 +56,24 @@ jobs: with: node-version: ${{env.NODE_VERSION}} - - name: Use Python 3.x + # Jedi LS depends on dataclasses which was a pypi install in 3.6 + - name: Use Python Python 3.6 for JediLSP uses: actions/setup-python@v2 with: - python-version: 3.x - - - name: Upgrade pip - run: python -m pip install -U pip + python-version: 3.6 - name: Build VSIX uses: ./.github/actions/build-vsix id: build-vsix + - name: Use Python ${{env.PYTHON_VERSION}} + uses: actions/setup-python@v2 + with: + python-version: ${{env.PYTHON_VERSION}} + + - name: Upgrade pip + run: python -m pip install -U pip + - name: Rename VSIX if: steps.build-vsix.outputs.path != needs.setup.outputs.vsix_name run: mv ${{ steps.build-vsix.outputs.path }} ${{ needs.setup.outputs.vsix_name }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 5ff156bf2134..5ab3728f4b7e 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -32,6 +32,16 @@ jobs: with: node-version: ${{env.NODE_VERSION}} + # Jedi LS depends on dataclasses which was a pypi install in 3.6 + - name: Use Python Python 3.6 for JediLSP + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - name: Build VSIX + uses: ./.github/actions/build-vsix + id: build-vsix + - name: Use Python ${{env.PYTHON_VERSION}} uses: actions/setup-python@v2 with: @@ -40,10 +50,6 @@ jobs: - name: Upgrade pip run: python -m pip install -U pip - - name: Build VSIX - uses: ./.github/actions/build-vsix - id: build-vsix - - name: Rename VSIX if: steps.build-vsix.outputs.path != env.VSIX_NAME run: mv ${{ steps.build-vsix.outputs.path }} ${{ env.VSIX_NAME }} From 384d9d445b826e6b6bdbaeb07c40027d7f12511a Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 4 May 2021 13:47:56 -0700 Subject: [PATCH 3/4] Fix pr-check --- .github/workflows/pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 5ab3728f4b7e..6d779af94fa9 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -36,7 +36,7 @@ jobs: - name: Use Python Python 3.6 for JediLSP uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: 3.6 - name: Build VSIX uses: ./.github/actions/build-vsix From acffd9e5a6b4e65dba68225428f6ec2837156d76 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 4 May 2021 20:08:08 -0700 Subject: [PATCH 4/4] Clean up --- .github/workflows/build.yml | 11 +---------- .github/workflows/pr-check.yml | 10 +--------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05d2ad534bcc..7a301c6ee180 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,6 @@ on: - 'release-*' env: - PYTHON_VERSION: 3.9 NODE_VERSION: 12.15.0 # Force a path with spaces and to test extension works in these scenarios # Unicode characters are causing 2.7 failures so skip that for now. @@ -57,7 +56,7 @@ jobs: node-version: ${{env.NODE_VERSION}} # Jedi LS depends on dataclasses which was a pypi install in 3.6 - - name: Use Python Python 3.6 for JediLSP + - name: Use Python 3.6 for JediLSP uses: actions/setup-python@v2 with: python-version: 3.6 @@ -66,14 +65,6 @@ jobs: uses: ./.github/actions/build-vsix id: build-vsix - - name: Use Python ${{env.PYTHON_VERSION}} - uses: actions/setup-python@v2 - with: - python-version: ${{env.PYTHON_VERSION}} - - - name: Upgrade pip - run: python -m pip install -U pip - - name: Rename VSIX if: steps.build-vsix.outputs.path != needs.setup.outputs.vsix_name run: mv ${{ steps.build-vsix.outputs.path }} ${{ needs.setup.outputs.vsix_name }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 6d779af94fa9..ad54e3152b40 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -33,7 +33,7 @@ jobs: node-version: ${{env.NODE_VERSION}} # Jedi LS depends on dataclasses which was a pypi install in 3.6 - - name: Use Python Python 3.6 for JediLSP + - name: Use Python 3.6 for JediLSP uses: actions/setup-python@v2 with: python-version: 3.6 @@ -42,14 +42,6 @@ jobs: uses: ./.github/actions/build-vsix id: build-vsix - - name: Use Python ${{env.PYTHON_VERSION}} - uses: actions/setup-python@v2 - with: - python-version: ${{env.PYTHON_VERSION}} - - - name: Upgrade pip - run: python -m pip install -U pip - - name: Rename VSIX if: steps.build-vsix.outputs.path != env.VSIX_NAME run: mv ${{ steps.build-vsix.outputs.path }} ${{ env.VSIX_NAME }}