From nobody Sat Jan 14 08:26:52 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NvBGN5r45z2r7m0; Sat, 14 Jan 2023 08:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NvBGN5Dbdz41B2; Sat, 14 Jan 2023 08:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673684812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WwwHE/PLmlYp/30hXPlW2vWo1PcrPCPkiAiiYfzg1g4=; b=ma8n45QCy2QudNWJYQKxKiJzwKZVx3h9NoRK80Jawphcw3B6BLeiVnCtYFqa3G+wcwtdTu ByWUEQ4OE4SVOOT+yqud/H7X2AgDVq+r6EHvXyyklELLk3wHLvqArUd6s6+FUM9WPRwdos 88EJIUH1pABgIeqwhHOz02W+PbicLvAWboqszvaJUZlN+lyzdxfme2jwMo0qLZVIoQFbvQ WB6MvUL5cxFRINVhTRVNu5Id8yTcIxHRRoeUh3CtSUZbYrsuLj5AYdRMn8uuiu4CqcQGN4 Ze2ha94HcDx6wF8DcbhiFtpILNwTSH0uVqMoTtPCmA5J7VK2UYi3kwR4n7M7Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673684812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WwwHE/PLmlYp/30hXPlW2vWo1PcrPCPkiAiiYfzg1g4=; b=n+937jkskoK/up9Ea8As/WSGKKDVauEE8ktWZ/IjJAo//xyAQ06x4WeD7usILIO7nSJhUZ 5rh25eK87ZZwP7420QWxUPrK5X7SjkJJspTl6g0yJM52062ZfBasDGld7AQYgOnRqAFnkJ 1PFVnhc/qOOsCVSx2A3ITYKegw0pEMEb8PkWKD3/bu7mvUxpfEPFH7nzqcWySXTfkz4QcW GknwNpM3+6d2esAhxXjBTUYFRznvjS6kRGSavkBpYfXCz+Vi0Y1jcTJTHc+PTlBdg1mqX2 OB9LJMJJrp9DuQ9U1FDq/eN3Lq3s38ORW55AQWw3qZI9GaYh4hVtRoK/vKDAAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673684812; a=rsa-sha256; cv=none; b=BYEBz2vV2EmxskwkQNYddDqcGJgo2RHFfo/V7aj9GYPrQt6iSydio/artag+1AUVjRdZv+ i2+Szp5QQfQLoxMujcFsM0rDE9czvw7zj4/COyTbXvexCkHw80IMrLuh+zfCZRRfzQukjw wKG6jn0L9kCOdKxtNGlYO4NCTwGQqT5aIXa3xLMQCXngGCX3BDfunQO7NgJCnFMwpsneVc R16uP3rXpXBEjl19XqcN+7ZZW+OUqdSIJJru2gln6v2plNeA1YtEASSL//3nLLVdFCAn3V SstmIrwKR5YiVUpfs7xtpVhH9FWQhgXP4/YTFij+7hLh9vQjaF5vCsTDdnu3Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NvBGN49lvzh46; Sat, 14 Jan 2023 08:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30E8QqeU085093; Sat, 14 Jan 2023 08:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30E8QqgS085092; Sat, 14 Jan 2023 08:26:52 GMT (envelope-from git) Date: Sat, 14 Jan 2023 08:26:52 GMT Message-Id: <202301140826.30E8QqgS085092@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Rainer Hurling Subject: git: 4b0bcfb68e9f - main - devel/py-pyls-black: Use python-lsp-server List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rhurlin X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b0bcfb68e9f96e3ace2f359ef99a539b229ee13 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rhurlin: URL: https://cgit.FreeBSD.org/ports/commit/?id=4b0bcfb68e9f96e3ace2f359ef99a539b229ee13 commit 4b0bcfb68e9f96e3ace2f359ef99a539b229ee13 Author: Rainer Hurling AuthorDate: 2023-01-14 08:16:28 +0000 Commit: Rainer Hurling CommitDate: 2023-01-14 08:16:28 +0000 devel/py-pyls-black: Use python-lsp-server Conversion from python-language-server (deprecated) to python-lsp-server by cherry picking from Github[1][2]. No conversion to PEP517, since 2023Q1 does not contain it. This will be done in a follow up commit. [1] https://github.com/rupert/pyls-black/pull/37 [2] https://github.com/rupert/pyls-black/pull/41 PR: 268342 Reported by: p5B2EA84B3@t-online.de MFH: 2023Q1 --- devel/py-pyls-black/Makefile | 2 ++ devel/py-pyls-black/files/patch-README.md | 14 ++++++++ .../files/patch-pyls__black_plugin.py | 41 ++++++++++++++++++++++ devel/py-pyls-black/files/patch-setup.cfg | 11 ++++++ 4 files changed, 68 insertions(+) diff --git a/devel/py-pyls-black/Makefile b/devel/py-pyls-black/Makefile index cf5c6a50a88c..ecf13fcf6ce9 100644 --- a/devel/py-pyls-black/Makefile +++ b/devel/py-pyls-black/Makefile @@ -1,5 +1,6 @@ PORTNAME= pyls-black PORTVERSION= 0.4.7 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,6 +13,7 @@ LICENSE= MIT RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}black>0:devel/py-black@${PY_FLAVOR} +# No tests because they are not in the release tarball USES= python:3.6+ USE_PYTHON= autoplist concurrent distutils diff --git a/devel/py-pyls-black/files/patch-README.md b/devel/py-pyls-black/files/patch-README.md new file mode 100644 index 000000000000..cb37e192584b --- /dev/null +++ b/devel/py-pyls-black/files/patch-README.md @@ -0,0 +1,14 @@ +--- README.md.orig 2021-06-04 22:43:13 UTC ++++ README.md +@@ -2,9 +2,9 @@ + + [![PyPI](https://img.shields.io/pypi/v/pyls-black.svg)](https://pypi.org/project/pyls-black/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) + +-> [Black](https://github.com/ambv/black) plugin for the [Python Language Server](https://github.com/palantir/python-language-server). ++> [Black](https://github.com/ambv/black) plugin for the [Python LSP Server](https://github.com/python-lsp/python-lsp-server). + +-In the same `virtualenv` as `python-language-server`: ++In the same `virtualenv` as `python-lsp-server`: + + ```shell + pip3 install pyls-black diff --git a/devel/py-pyls-black/files/patch-pyls__black_plugin.py b/devel/py-pyls-black/files/patch-pyls__black_plugin.py new file mode 100644 index 000000000000..45cb5e2bddd2 --- /dev/null +++ b/devel/py-pyls-black/files/patch-pyls__black_plugin.py @@ -0,0 +1,41 @@ +--- pyls_black/plugin.py.orig 2021-06-04 22:43:13 UTC ++++ pyls_black/plugin.py +@@ -2,18 +2,18 @@ import toml + + import black + import toml +-from pyls import hookimpl ++from pylsp import hookimpl + + _PY36_VERSIONS = {black.TargetVersion[v] for v in ["PY36", "PY37", "PY38", "PY39"]} + + + @hookimpl(tryfirst=True) +-def pyls_format_document(document): ++def pylsp_format_document(document): + return format_document(document) + + + @hookimpl(tryfirst=True) +-def pyls_format_range(document, range): ++def pylsp_format_range(document, range): + range["start"]["character"] = 0 + range["end"]["line"] += 1 + range["end"]["character"] = 0 +@@ -73,8 +73,14 @@ def load_config(filename: str) -> Dict: + + root = black.find_project_root((filename,)) + +- pyproject_filename = root / "pyproject.toml" +- ++ # Note: find_project_root returns a tuple in 22.1.0+ ++ try: ++ # Keeping this to not break backward compatibility. ++ pyproject_filename = root / "pyproject.toml" ++ except TypeError: ++ _root, _ = root ++ pyproject_filename = _root / "pyproject.toml" ++ + if not pyproject_filename.is_file(): + return defaults + diff --git a/devel/py-pyls-black/files/patch-setup.cfg b/devel/py-pyls-black/files/patch-setup.cfg new file mode 100644 index 000000000000..a6685da7e681 --- /dev/null +++ b/devel/py-pyls-black/files/patch-setup.cfg @@ -0,0 +1,11 @@ +--- setup.cfg.orig 2021-06-04 23:01:09 UTC ++++ setup.cfg +@@ -14,7 +14,7 @@ packages = find: + + [options] + packages = find: +-install_requires = python-language-server; black>=19.3b0; toml ++install_requires = python-lsp-server; black>=19.3b0; toml + python_requires = >= 3.6 + + [options.entry_points]