Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hatch for packaging #114

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions docs/lsp-devtools/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

```{include} ../../lib/lsp-devtools/CHANGES.md
:relative-images:
```
4 changes: 0 additions & 4 deletions docs/lsp-devtools/changelog.rst

This file was deleted.

66 changes: 66 additions & 0 deletions lib/lsp-devtools/CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## v0.2.0 - 2023-10-06

### Features

- **Experimental** Add proof of concept `lsp-devtools client` command that builds on textual's `TextArea` widget to offer an interactive language server client. ([#83](https://github.com/swyddfa/lsp-devtools/issues/83))

### Fixes

- The `lsp-devtools agent` command no longer fails to exit once an LSP session closes. ([#17](https://github.com/swyddfa/lsp-devtools/issues/17))
- `lsp-devtools record` no longer emits a `ResourceWarning` ([#28](https://github.com/swyddfa/lsp-devtools/issues/28))
- As a consequence of the new architecture, commands like `lsp-devtools record` no longer miss the start of an LSP session ([#29](https://github.com/swyddfa/lsp-devtools/issues/29))
- `lsp-devtools agent` no longer emits `Unable to send data, no available transport!` messages ([#38](https://github.com/swyddfa/lsp-devtools/issues/38))

### Misc

- The `lsp-devtools agent` now uses a TCP connection, which should make distribution easier ([#37](https://github.com/swyddfa/lsp-devtools/issues/37))

- Drop Python 3.7 support ([#77](https://github.com/swyddfa/lsp-devtools/issues/77))

- The `lsp-devtools capabilities` command has been removed in favour of `lsp-devtools record`

The `lsp-devtools tui` command has been renamed to `lsp-devtools inspect` ([#83](https://github.com/swyddfa/lsp-devtools/issues/83))

## v0.1.1 - 2023-01-14

### Fixes

- Fix PyPi packaging ([#33](https://github.com/alcarney/lsp-devtools/issues/33))

## v0.1.0 - 2023-01-10

### Features

- Updated `record` command.

It is now capable of live streaming messages sent between a client and server to stdout, plain text files or a SQLite database.

It also offers a number of filters for selecting the messages you wish to record, as well as a (WIP!) format string syntax for controlling how messages are formatted. ([#26](https://github.com/alcarney/lsp-devtools/issues/26))

- Add `tui` command.

A proof of concept devtools TUI implemented in textual, that live updates with the LSP messages sent between client and server!

Requires the server be wrapped in an `agent`. ([#27](https://github.com/alcarney/lsp-devtools/issues/27))

### Misc

- Migrated to `v1.0` ([#26](https://github.com/alcarney/lsp-devtools/issues/26))

## v0.0.3 - 2022-07-17

### Misc

- Remove upper bound on required `pygls` version ([#14](https://github.com/alcarney/lsp-devtools/issues/14))

## v0.0.2 - 2022-05-06

### Fixes

- Fix `mypy` errors. ([#7](https://github.com/alcarney/lsp-devtools/issues/7))

## v0.0.1 - 2022-04-29

### Misc

- Initial release ([#6](https://github.com/alcarney/lsp-devtools/issues/6))
87 changes: 0 additions & 87 deletions lib/lsp-devtools/CHANGES.rst

This file was deleted.

9 changes: 9 additions & 0 deletions lib/lsp-devtools/hatch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[version]
path = "lsp_devtools/__init__.py"
validate-bump = false

[build.targets.sdist]
include = ["lsp_devtools", "tests", "CHANGES.md"]

[build.targets.wheel]
packages = ["lsp_devtools"]
49 changes: 0 additions & 49 deletions lib/lsp-devtools/lsp_devtools/handlers/prometheus.py

This file was deleted.

Loading