From 0327ba1dfefb90bc82a27b23d9789ea015c1eccf Mon Sep 17 00:00:00 2001 From: Alec Scott Date: Tue, 1 Apr 2025 13:32:49 -0400 Subject: [PATCH] py-python-lsp-ruff: new package (#49764) * py-python-lsp-ruff: new package * Add git and main versions to both for development --- .../builtin/packages/py-lsprotocol/package.py | 28 +++++++++++++++ .../packages/py-python-lsp-ruff/package.py | 34 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-lsprotocol/package.py create mode 100644 var/spack/repos/builtin/packages/py-python-lsp-ruff/package.py diff --git a/var/spack/repos/builtin/packages/py-lsprotocol/package.py b/var/spack/repos/builtin/packages/py-lsprotocol/package.py new file mode 100644 index 00000000000..60b8b4ab5b6 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-lsprotocol/package.py @@ -0,0 +1,28 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyLsprotocol(PythonPackage): + """Code generator and generated types for Language Server Protocol.""" + + homepage = "https://github.com/microsoft/lsprotocol" + pypi = "lsprotocol/lsprotocol-2023.0.1.tar.gz" + git = "https://github.com/microsoft/lsprotocol.git" + + maintainers("alecbcs") + + license("MIT") + + version("main", branch="main") + version("2023.0.1", sha256="cc5c15130d2403c18b734304339e51242d3018a05c4f7d0f198ad6e0cd21861d") + + depends_on("python@3.8:", type=("build", "run")) + depends_on("py-flit-core", type="build") + + depends_on("py-attrs@21.3.0:", type=("build", "run")) + depends_on("py-cattrs", type=("build", "run")) + + conflicts("^py-cattrs@23.2.1", when="@2023.0.1") diff --git a/var/spack/repos/builtin/packages/py-python-lsp-ruff/package.py b/var/spack/repos/builtin/packages/py-python-lsp-ruff/package.py new file mode 100644 index 00000000000..051a9051d55 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-python-lsp-ruff/package.py @@ -0,0 +1,34 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyPythonLspRuff(PythonPackage): + """A plugin for python-lsp-server that adds linting, code action and + formatting capabilities that are provided by ruff, an extremely fast Python + linter and formatter written in Rust. + """ + + homepage = "https://github.com/python-lsp/python-lsp-ruff" + pypi = "python_lsp_ruff/python_lsp_ruff-2.2.2.tar.gz" + git = "https://github.com/python-lsp/python-lsp-ruff.git" + + maintainers("alecbcs") + + license("MIT") + + version("main", branch="main") + version("2.2.2", sha256="3f80bdb0b4a8ee24624596a1cff60b28cc37771773730f9bf7d946ddff9f0cac") + + depends_on("python@3.8:", type=("build", "run")) + depends_on("py-setuptools", type="build") + + depends_on("py-ruff@0.2.0:", type=("build", "run")) + depends_on("py-cattrs", type=("build", "run")) + depends_on("py-python-lsp-server", type=("build", "run")) + depends_on("py-lsprotocol@2023.0.1:", type=("build", "run")) + depends_on("py-tomli@1.1.0:", type=("build", "run"), when="^python@:3.10") + + conflicts("^py-cattrs@23.2.1", when="@2.2.2")