Skip to content

Commit

Permalink
Support Python 3.8 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
aazuspan authored Aug 15, 2024
1 parent 9ee1799 commit 2be9e19
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",]
Expand Down
2 changes: 2 additions & 0 deletions src/spinasm_lsp/docs/assemblers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# ruff: noqa: E501

from __future__ import annotations

from spinasm_lsp.docs.markdown import Assembler

ASSEMBLERS: dict[str, Assembler] = {
Expand Down
2 changes: 2 additions & 0 deletions src/spinasm_lsp/docs/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# ruff: noqa: E501

from __future__ import annotations

from spinasm_lsp.docs.markdown import Arg, ArgList, Instruction

INSTRUCTIONS: dict[str, Instruction] = {
Expand Down
10 changes: 3 additions & 7 deletions src/spinasm_lsp/docs/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2be9e19

Please sign in to comment.