pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/py-lsp-server py-lsp-server: fix 5/7 failing tests.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bb6f47285c13
branches:  trunk
changeset: 768975:bb6f47285c13
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Fri Nov 05 15:58:23 2021 +0000

description:
py-lsp-server: fix 5/7 failing tests.

diffstat:

 lang/py-lsp-server/Makefile                                    |   8 ++-
 lang/py-lsp-server/distinfo                                    |   3 +-
 lang/py-lsp-server/patches/patch-pylsp_plugins_flake8__lint.py |  26 ++++++++++
 3 files changed, 35 insertions(+), 2 deletions(-)

diffs (63 lines):

diff -r 3f5e5c3d300d -r bb6f47285c13 lang/py-lsp-server/Makefile
--- a/lang/py-lsp-server/Makefile       Fri Nov 05 15:01:07 2021 +0000
+++ b/lang/py-lsp-server/Makefile       Fri Nov 05 15:58:23 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2021/11/05 13:18:00 adam Exp $
+# $NetBSD: Makefile,v 1.3 2021/11/05 15:58:23 wiz Exp $
 
 DISTNAME=      python-lsp-server-1.2.4
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/python-//}
@@ -34,6 +34,12 @@
 
 PYTHON_VERSIONS_INCOMPATIBLE=  27 # py-pylint, py-parso via py-jedi
 
+SUBST_CLASSES+=                pylint
+SUBST_FILES.pylint+=   test/plugins/test_pylint_lint.py
+SUBST_STAGE.pylint=    pre-build
+SUBST_MESSAGE.pylint=  Fix pylint executable name.
+SUBST_SED.pylint=      -e "s/'pylint'$$/'pylint-${PYVERSSUFFIX}'/"
+
 post-install:
        cd ${DESTDIR}${PREFIX}/bin && \
        ${MV} pylsp pylsp-${PYVERSSUFFIX} || ${TRUE}
diff -r 3f5e5c3d300d -r bb6f47285c13 lang/py-lsp-server/distinfo
--- a/lang/py-lsp-server/distinfo       Fri Nov 05 15:01:07 2021 +0000
+++ b/lang/py-lsp-server/distinfo       Fri Nov 05 15:58:23 2021 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.1 2021/11/05 12:36:15 wiz Exp $
+$NetBSD: distinfo,v 1.2 2021/11/05 15:58:23 wiz Exp $
 
 BLAKE2s (python-lsp-server-1.2.4.tar.gz) = 573b63907c47a50b0c3c4c257d9d2a75c4bf3af7af2ca9bb9b9a99092a51ba13
 SHA512 (python-lsp-server-1.2.4.tar.gz) = 862d59426c6e7c19f9d3d2766ec5f9ec818d29988ee72cde9553e4b1725fbbe4230ed2f6d7e8d08983c9ef1ced8d5afe42d6751ea529d3d8799c8930b1e10a26
 Size (python-lsp-server-1.2.4.tar.gz) = 62073 bytes
+SHA1 (patch-pylsp_plugins_flake8__lint.py) = 56907a886c2521ebb607654488fb456ae8f6b02c
diff -r 3f5e5c3d300d -r bb6f47285c13 lang/py-lsp-server/patches/patch-pylsp_plugins_flake8__lint.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/py-lsp-server/patches/patch-pylsp_plugins_flake8__lint.py    Fri Nov 05 15:58:23 2021 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-pylsp_plugins_flake8__lint.py,v 1.1 2021/11/05 15:58:23 wiz Exp $
+
+Fix unportable interpreter name.
+https://github.com/python-lsp/python-lsp-server/pull/111
+
+--- pylsp/plugins/flake8_lint.py.orig  2021-06-25 21:26:52.000000000 +0000
++++ pylsp/plugins/flake8_lint.py
+@@ -5,6 +5,7 @@
+ import logging
+ import os.path
+ import re
++import sys
+ from pathlib import PurePath
+ from subprocess import PIPE, Popen
+ 
+@@ -81,8 +82,8 @@ def run_flake8(flake8_executable, args, 
+         cmd.extend(args)
+         p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)  # pylint: disable=consider-using-with
+     except IOError:
+-        log.debug("Can't execute %s. Trying with 'python -m flake8'", flake8_executable)
+-        cmd = ['python', '-m', 'flake8']
++        log.debug("Can't execute %s. Trying with '" + sys.executable + " -m flake8'", flake8_executable)
++        cmd = [sys.executable, '-m', 'flake8']
+         cmd.extend(args)
+         p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)  # pylint: disable=consider-using-with
+     (stdout, stderr) = p.communicate(document.source.encode())



Home | Main Index | Thread Index | Old Index