From 2be9e19bb0ac3821702cc141ff2d9fa42a1dcf58 Mon Sep 17 00:00:00 2001 From: Aaron Zuspan <50475791+aazuspan@users.noreply.github.com> Date: Wed, 14 Aug 2024 22:48:12 -0700 Subject: [PATCH] Support Python 3.8 (#21) --- .github/workflows/ci.yaml | 2 +- README.md | 4 ++++ pyproject.toml | 4 ++-- src/spinasm_lsp/docs/assemblers.py | 2 ++ src/spinasm_lsp/docs/instructions.py | 2 ++ src/spinasm_lsp/docs/markdown.py | 10 +++------- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 889e1b3..7f4e5f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,7 @@ jobs: test: strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] runs-on: ubuntu-latest diff --git a/README.md b/README.md index c6aa6af..47ab156 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # SPINAsm LSP Server +[![Build status](https://github.com/aazuspan/spinasm-lsp/actions/workflows/ci.yaml/badge.svg)](https://github.com/aazuspan/spinasm-lsp/actions/workflows/ci.yaml) +[![PyPI version](https://badge.fury.io/py/spinasm-lsp.svg)](https://badge.fury.io/py/spinasm-lsp) +[![Python versions](https://img.shields.io/pypi/pyversions/spinasm-lsp.svg)](https://pypi.python.org/pypi/spinasm-lsp) + A Language Server Protocol (LSP) server to provide language support for the [SPINAsm assembly language](http://www.spinsemi.com/Products/datasheets/spn1001-dev/SPINAsmUserManual.pdf). The LSP is built on an extended version of the [asfv1](https://github.com/ndf-zz/asfv1) parser. ## Features diff --git a/pyproject.toml b/pyproject.toml index 708d884..c643b99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "spinasm-lsp" dynamic = [ "version",] description = "A Language Server Protocol implementation for SPINAsm" readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.8" keywords = [] dependencies = [ "pygls", @@ -46,7 +46,7 @@ dependencies = [ "pytest", "pytest-cov", "mistletoe", "pytest-lsp" ] template = "test" [[tool.hatch.envs.test_matrix.matrix]] -python = ["3.9", "3.10", "3.11", "3.12"] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] [tool.ruff.lint.isort] known-first-party = [ "spinasm_lsp",] diff --git a/src/spinasm_lsp/docs/assemblers.py b/src/spinasm_lsp/docs/assemblers.py index 1085723..38f53d6 100644 --- a/src/spinasm_lsp/docs/assemblers.py +++ b/src/spinasm_lsp/docs/assemblers.py @@ -2,6 +2,8 @@ # ruff: noqa: E501 +from __future__ import annotations + from spinasm_lsp.docs.markdown import Assembler ASSEMBLERS: dict[str, Assembler] = { diff --git a/src/spinasm_lsp/docs/instructions.py b/src/spinasm_lsp/docs/instructions.py index 5ab0802..77bc4fb 100644 --- a/src/spinasm_lsp/docs/instructions.py +++ b/src/spinasm_lsp/docs/instructions.py @@ -2,6 +2,8 @@ # ruff: noqa: E501 +from __future__ import annotations + from spinasm_lsp.docs.markdown import Arg, ArgList, Instruction INSTRUCTIONS: dict[str, Instruction] = { diff --git a/src/spinasm_lsp/docs/markdown.py b/src/spinasm_lsp/docs/markdown.py index 88d1ee5..04d2e8d 100644 --- a/src/spinasm_lsp/docs/markdown.py +++ b/src/spinasm_lsp/docs/markdown.py @@ -3,10 +3,9 @@ from __future__ import annotations from abc import ABC, abstractmethod -from collections import UserList from dataclasses import dataclass from functools import cached_property -from typing import Literal +from typing import List, Literal class MarkdownGenerator(ABC): @@ -34,15 +33,12 @@ def markdown(self) -> str: return f"{self.name}: {' | '.join(self.formats)}" -@dataclass -class ArgList(MarkdownGenerator, UserList[Arg]): +class ArgList(MarkdownGenerator, List[Arg]): """A collection of arguments for a SPINAsm instruction.""" - data: list[Arg] - @property def markdown(self) -> str: - return ", ".join([arg.markdown for arg in self.data]) + return ", ".join([arg.markdown for arg in self]) @dataclass