Skip to content

Commit

Permalink
Merge pull request #115 from swyddfa/develop
Browse files Browse the repository at this point in the history
New Release
  • Loading branch information
alcarney authored Nov 13, 2023
2 parents 777e87d + 6173004 commit 84c9dbe
Show file tree
Hide file tree
Showing 132 changed files with 4,506 additions and 5,544 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/capabilities-nvim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Neovim Capabilities
on:
workflow_dispatch:
inputs:
version:
description: 'Version to capture capabilities for'
required: true
type: string

jobs:
capture:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- run: |
gh release download ${{ inputs.version }} -p '*.appimage' -R neovim/neovim
ls -l
chmod +x nvim.appimage
./nvim.appimage --appimage-extract
./squashfs-root/usr/bin/nvim -l scripts/nvim-capabilities.lua
mv neovim_v*.json lib/pytest-lsp/pytest_lsp/clients/
ls -l
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git checkout -b neovim-${{ inputs.version }}-capabilities
git add lib/pytest-lsp/pytest_lsp/clients/
git commit -m "Add client capabilities for Neovim ${{ inputs.version }}"
git push -u origin neovim-${{ inputs.version }}-capabilities
gh pr create --base develop --fill
name: Capture Neovim Capailities
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 changes: 38 additions & 28 deletions .github/workflows/lsp-devtools-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lsp-devtools PR
name: 'PR: lsp-devtools'
on:
pull_request:
branches:
Expand All @@ -8,12 +8,40 @@ on:
- 'lib/lsp-devtools/**'

jobs:
lsp-devtools:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: lib/lsp-devtools/pyproject.toml

- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade hatch towncrier
name: Setup Environment
- run: |
set -e
./scripts/make_release.py lsp-devtools
name: Set Version
- uses: hynek/build-and-inspect-python-package@v1
with:
path: lib/lsp-devtools

test:
name: "Python v${{ matrix.python-version }} -- ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]

steps:
Expand All @@ -22,39 +50,21 @@ jobs:
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
allow-prereleases: true
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: lib/lsp-devtools/pyproject.toml

- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade build tox bump2version
python -m pip install --upgrade tox
name: Setup Environment
- run: |
set -e
# Despite the script's name, this is only used to obtain a
# dev version number e.g. v1.2.3-dev4
./scripts/make-release.sh lsp-devtools
name: Set Version
if: matrix.python-version == '3.10'
- run: |
cd lib/lsp-devtools
version=$(echo ${{ matrix.python-version }} | tr -d .)
python -m tox -e `tox -l | grep $version | tr '\n' ','`
name: Test
- name: Package
run: |
cd lib/lsp-devtools
python -m build
if: always() && matrix.python-version == '3.10'

- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: 'dist'
path: lib/lsp-devtools/dist
if: always() && matrix.python-version == '3.10'
python -m tox run -f "py${version}"
shell: bash
name: Run Tests
9 changes: 3 additions & 6 deletions .github/workflows/lsp-devtools-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- run: |
sudo apt update
sudo apt install pandoc
python --version
python -m pip install --upgrade pip
python -m pip install build bump2version towncrier docutils
python -m pip install hatch towncrier docutils
name: Install Build Tools
- run: |
Expand All @@ -44,7 +41,7 @@ jobs:
- name: Package
run: |
cd lib/lsp-devtools
python -m build
hatch build
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
Expand Down
62 changes: 35 additions & 27 deletions .github/workflows/pytest-lsp-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pytest-lsp PR
name: 'PR: pytest-lsp'
on:
pull_request:
branches:
Expand All @@ -8,10 +8,38 @@ on:
- 'lib/pytest-lsp/**'

jobs:
pytest-lsp:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: lib/pytest-lsp/pyproject.toml

- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade hatch towncrier
name: Setup Environment
- run: |
set -e
./scripts/make_release.py pytest-lsp
name: Set Version
- uses: hynek/build-and-inspect-python-package@v1
with:
path: lib/pytest-lsp

test:
name: "Python v${{ matrix.python-version }} -- ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest]
Expand All @@ -22,41 +50,21 @@ jobs:
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: lib/pytest-lsp/pyproject.toml

- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade build tox bump2version
python -m pip install --upgrade tox
name: Setup Environment
- run: |
set -e
# Despite the script's name, this is only used to obtain a
# dev version number e.g. v1.2.3-dev4
./scripts/make-release.sh pytest-lsp
name: Set Version
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
- run: |
cd lib/pytest-lsp
version=$(echo ${{ matrix.python-version }} | tr -d .)
python -m tox run -f "py${version}"
shell: bash
name: Test
- name: Package
run: |
cd lib/pytest-lsp
python -m build
if: always() && matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'

- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: 'dist'
path: lib/pytest-lsp/dist
if: always() && matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
name: Run Tests
14 changes: 5 additions & 9 deletions .github/workflows/pytest-lsp-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,29 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- run: |
sudo apt update
sudo apt install pandoc
python --version
python -m pip install --upgrade pip
python -m pip install build bump2version towncrier docutils
name: Install Build Tools
python -m pip install tox hatch towncrier docutils
name: Setup Environment
- run: |
set -e
./scripts/make-release.sh pytest-lsp
./scripts/make_release.py pytest-lsp
name: Set Version
id: info
- name: Package
run: |
cd lib/pytest-lsp
python -m build
hatch build
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
Expand Down
17 changes: 14 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ exclude: '.bumpversion.cfg$'
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: 'lib/pytest-lsp/pytest_lsp/clients/.*\.json'
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.11.0
hooks:
- id: black
exclude: 'lib/pytest-lsp/pytest_lsp/gen.py'
Expand All @@ -35,7 +36,7 @@ repos:
exclude: 'lib/pytest-lsp/pytest_lsp/gen.py'

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.5.1'
rev: 'v1.7.0'
hooks:
- id: mypy
name: mypy (pytest-lsp)
Expand All @@ -62,3 +63,13 @@ repos:
- textual
- websockets
files: 'lib/lsp-devtools/lsp_devtools/.*\.py'

- repo: local
hooks:
- id: check-capabilities
name: check-capabilities
language: python
additional_dependencies:
- lsprotocol
files: 'lib/pytest-lsp/pytest_lsp/clients/.*\.json'
entry: python scripts/check_capabilities.py
14 changes: 13 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,17 @@
"**/*.egg-info": true,
"**/.pytest_cache": true,
"**/.mypy_cache": true,
}
},
"esbonio.sphinx.buildCommand": [
"sphinx-build",
"-M",
"html",
"docs",
"docs/_build"
],
"python.testing.pytestArgs": [
"lib/pytest-lsp/tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
}
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,3 @@ async def test_completion(client: LanguageClient):

assert len(result.items) > 0
```

## `app/` - Prototype Devtools Web UI

![UI Screenshot](https://user-images.githubusercontent.com/2675694/191863035-5bb5d1c9-00b6-40de-b3e2-f81cdb9eb375.png)

This is little more than a proof of concept, currently setup to communicate with an agent over websockets.
Hopefully, this can eventually be repurposed/extended to be used on lsp servers hosted entirely in the browser e.g. pyodide.
Loading

0 comments on commit 84c9dbe

Please sign in to comment.