-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The py-language-server port is deprecated as the upstream project is unmaintained. This port provides the maintained, community fork.
- Loading branch information
Showing
13 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | ||
|
||
PortSystem 1.0 | ||
PortGroup python 1.0 | ||
|
||
name py-python-lsp-jsonrpc | ||
version 1.0.0 | ||
revision 0 | ||
|
||
platforms darwin | ||
supported_archs noarch | ||
license MIT | ||
maintainers {gpanders.com:greg @gpanders} openmaintainer | ||
|
||
description A Python server implementation of the JSON RPC 2.0 protocol | ||
long_description Fork of the python-jsonrpc-server project, maintained by the Spyder \ | ||
IDE team and the community. | ||
|
||
homepage https://github.com/python-lsp/python-lsp-jsonrpc | ||
|
||
checksums rmd160 290706b2d58803c9d12c27207118271286c498d0 \ | ||
sha256 7bec170733db628d3506ea3a5288ff76aa33c70215ed223abdb0d95e957660bd \ | ||
size 10011 | ||
|
||
python.versions 36 37 38 39 | ||
|
||
if {${name} ne ${subport}} { | ||
depends_build-append \ | ||
port:py${python.version}-setuptools | ||
|
||
depends_lib-append port:py${python.version}-ujson | ||
|
||
depends_test-append port:py${python.version}-pytest \ | ||
port:py${python.version}-mock | ||
|
||
test.run yes | ||
test.cmd py.test-${python.branch} | ||
test.args -o addopts='' | ||
test.target | ||
test.env PYTHONPATH=${worksrcpath}/build/lib | ||
|
||
livecheck.type none | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | ||
|
||
PortSystem 1.0 | ||
PortGroup github 1.0 | ||
PortGroup python 1.0 | ||
PortGroup select 1.0 | ||
|
||
name py-python-lsp-server | ||
github.setup python-lsp python-lsp-server 1.1.0 v | ||
github.tarball_from archive | ||
revision 0 | ||
|
||
categories-append devel | ||
platforms darwin | ||
supported_archs noarch | ||
license MIT | ||
maintainers {gpanders.com:greg @gpanders} openmaintainer | ||
|
||
description A Python implementation of the Language Server Protocol | ||
long_description Fork of the python-language-server project, maintained by the Spyder \ | ||
IDE team and the community. | ||
|
||
checksums rmd160 ed800ce49f963cd61cc239f3d1ecb8169af298ee \ | ||
sha256 987eb87073fca65bd1b0d32e408935f2146a98d33ae06d716d00969fc8c935b3 \ | ||
size 57851 | ||
|
||
python.versions 36 37 38 39 | ||
|
||
if {${subport} ne ${name}} { | ||
depends_lib-append \ | ||
port:py${python.version}-autopep8 \ | ||
port:py${python.version}-codestyle \ | ||
port:py${python.version}-docstyle \ | ||
port:py${python.version}-flake8 \ | ||
port:py${python.version}-flake8-mccabe \ | ||
port:py${python.version}-jedi \ | ||
port:py${python.version}-pluggy \ | ||
port:py${python.version}-pyflakes \ | ||
port:py${python.version}-pylint \ | ||
port:py${python.version}-python-lsp-jsonrpc \ | ||
port:py${python.version}-rope \ | ||
port:py${python.version}-setuptools \ | ||
port:py${python.version}-ujson \ | ||
port:py${python.version}-yapf | ||
|
||
patchfiles-append patch-pylsp_plugins_flake8_lint.py.diff \ | ||
patch-test_plugins_flake8_lint.py.diff | ||
|
||
post-patch { | ||
reinplace "s|@@FLAKE8_BIN@@|flake8-${python.branch}|g" ${worksrcpath}/pylsp/plugins/flake8_lint.py | ||
reinplace "s|@@FLAKE8_BIN@@|flake8-${python.branch}|g" ${worksrcpath}/test/plugins/test_flake8_lint.py | ||
reinplace "s|@@PYTHON_BIN@@|${python.bin}|g" ${worksrcpath}/pylsp/plugins/flake8_lint.py | ||
} | ||
|
||
depends_test-append \ | ||
port:py${python.version}-pytest \ | ||
port:py${python.version}-mock \ | ||
port:py${python.version}-flaky | ||
|
||
test.run yes | ||
test.cmd py.test-${python.branch} | ||
test.args -o addopts='' | ||
test.target | ||
test.env PYTHONPATH=${worksrcpath}/build/lib | ||
|
||
depends_run-append \ | ||
port:python-lsp-server_select | ||
|
||
select.group python-lsp-server | ||
select.file ${filespath}/py${python.version}-pylsp | ||
|
||
notes " | ||
To make the Python ${python.branch} version of python-lsp-server the one \ | ||
that is run when you execute the commands without a version suffix, e.g. \ | ||
'pylsp', run: | ||
port select --set ${select.group} [file tail ${select.file}] | ||
" | ||
|
||
livecheck.type none | ||
} |
20 changes: 20 additions & 0 deletions
20
python/py-python-lsp-server/files/patch-pylsp_plugins_flake8_lint.py.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- pylsp/plugins/flake8_lint.py | ||
+++ pylsp/plugins/flake8_lint.py | ||
@@ -54,7 +54,7 @@ def pylsp_lint(workspace, document): | ||
log.debug("using flake8 with config: %s", opts['config']) | ||
|
||
# Call the flake8 utility then parse diagnostics from stdout | ||
- flake8_executable = settings.get('executable', 'flake8') | ||
+ flake8_executable = settings.get('executable', '@@FLAKE8_BIN@@') | ||
|
||
args = build_args(opts) | ||
output = run_flake8(flake8_executable, args, document) | ||
@@ -82,7 +82,7 @@ def run_flake8(flake8_executable, args, document): | ||
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'] | ||
+ cmd = ['@@PYTHON_BIN@@', '-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()) |
20 changes: 20 additions & 0 deletions
20
python/py-python-lsp-server/files/patch-test_plugins_flake8_lint.py.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- test/plugins/test_flake8_lint.py | ||
+++ test/plugins/test_flake8_lint.py | ||
@@ -68,7 +68,7 @@ def test_flake8_config_param(workspace): | ||
_name, doc = temp_document(DOC, workspace) | ||
flake8_lint.pylsp_lint(workspace, doc) | ||
(call_args,) = popen_mock.call_args[0] | ||
- assert 'flake8' in call_args | ||
+ assert '@@FLAKE8_BIN@@' in call_args | ||
assert '--config={}'.format(flake8_conf) in call_args | ||
|
||
|
||
@@ -126,7 +126,7 @@ exclude = | ||
flake8_lint.pylsp_lint(workspace, doc) | ||
|
||
call_args = popen_mock.call_args[0][0] | ||
- assert call_args == ["flake8", "-", "--exclude=blah/,file_2.py"] | ||
+ assert call_args == ["@@FLAKE8_BIN@@", "-", "--exclude=blah/,file_2.py"] | ||
|
||
os.unlink(os.path.join(workspace.root_path, "setup.cfg")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${frameworks_dir}/Python.framework/Versions/3.6/bin/pylsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${frameworks_dir}/Python.framework/Versions/3.7/bin/pylsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${frameworks_dir}/Python.framework/Versions/3.8/bin/pylsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${frameworks_dir}/Python.framework/Versions/3.9/bin/pylsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | ||
|
||
PortSystem 1.0 | ||
PortGroup select 1.0 | ||
|
||
name python-lsp-server_select | ||
version 0.1 | ||
revision 0 | ||
categories python | ||
license BSD | ||
|
||
maintainers nomaintainer | ||
|
||
description common files for selecting default pylsp version | ||
long_description \ | ||
This port installs files that allow 'port select' to be used to \ | ||
create links to the preferred default version of pylsp. | ||
|
||
platforms darwin | ||
supported_archs noarch | ||
|
||
homepage https://www.macports.org/ | ||
|
||
distfiles | ||
|
||
use_configure no | ||
build {} | ||
destroot { | ||
select::install python-lsp-server ${filespath}/base | ||
select::install python-lsp-server ${filespath}/none | ||
} | ||
|
||
livecheck.type none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin/pylsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- |