Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-python-lsp-server for openSUSE:Factory checked in at 2022-04-10 00:42:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-lsp-server (Old) and /work/SRC/openSUSE:Factory/.python-python-lsp-server.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-lsp-server" Sun Apr 10 00:42:18 2022 rev:13 rq:968058 version:1.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-lsp-server/python-python-lsp-server.changes 2022-03-25 21:55:22.374318151 +0100 +++ /work/SRC/openSUSE:Factory/.python-python-lsp-server.new.1900/python-python-lsp-server.changes 2022-04-10 00:42:31.088704275 +0200 @@ -1,0 +2,6 @@ +Sat Apr 9 20:44:49 UTC 2022 - Ben Greiner <c...@bnavigator.de> + +- Update to 1.4.1 + * Fixes Yapf formatting with CRLF line endings. + +------------------------------------------------------------------- Old: ---- python-lsp-server-1.4.0.tar.gz New: ---- python-lsp-server-1.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-lsp-server.spec ++++++ --- /var/tmp/diff_new_pack.MIkWMC/_old 2022-04-10 00:42:31.656697958 +0200 +++ /var/tmp/diff_new_pack.MIkWMC/_new 2022-04-10 00:42:31.660697914 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-python-lsp-server -Version: 1.4.0 +Version: 1.4.1 Release: 0 Summary: Python Language Server for the Language Server Protocol License: MIT ++++++ python-lsp-server-1.4.0.tar.gz -> python-lsp-server-1.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/CHANGELOG.md new/python-lsp-server-1.4.1/CHANGELOG.md --- old/python-lsp-server-1.4.0/CHANGELOG.md 2022-03-11 16:09:19.000000000 +0100 +++ new/python-lsp-server-1.4.1/CHANGELOG.md 2022-03-27 08:03:00.000000000 +0200 @@ -1,5 +1,16 @@ # History of changes +## Version 1.4.1 (2022/03/27) + +### Pull Requests Merged + +* [PR 179](https://github.com/python-lsp/python-lsp-server/pull/179) - Fix Yapf formatting with CRLF line endings, by [@ccordoba12](https://github.com/ccordoba12) +* [PR 174](https://github.com/python-lsp/python-lsp-server/pull/174) - Improved documentation regarding configuration, by [@spookylukey](https://github.com/spookylukey) + +In this release 2 pull requests were closed. + +---- + ### New features * Support pycodestyle indent-size option diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/PKG-INFO new/python-lsp-server-1.4.1/PKG-INFO --- old/python-lsp-server-1.4.0/PKG-INFO 2022-03-11 16:12:52.527091500 +0100 +++ new/python-lsp-server-1.4.1/PKG-INFO 2022-03-27 08:05:20.353420500 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python-lsp-server -Version: 1.4.0 +Version: 1.4.1 Summary: Python Language Server for the Language Server Protocol Home-page: https://github.com/python-lsp/python-lsp-server Author: Python Language Server Contributors @@ -82,19 +82,34 @@ ## Configuration -Configuration is loaded from zero or more configuration sources. Currently implemented are: +Like all language servers, configuration can be passed from the client that talks to this server (i.e. your editor/IDE or other tool that has the same purpose). The details of how this is done depend on the editor or plugin that you are using to communicate with `python-lsp-server`. The configuration options available at that level are documented in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). -- pycodestyle: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. -- flake8: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` +`python-lsp-server` depends on other tools, like flake8 and pycodestyle. These tools can be configured via settings passed from the client (as above), or alternatively from other configuration sources. The following sources are available: -The default configuration source is pycodestyle. Change the `pylsp.configurationSources` setting to `['flake8']` in order to respect flake8 configuration instead. +- `pycodestyle`: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. +- `flake8`: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` + +The default configuration source is `pycodestyle`. Change the `pylsp.configurationSources` setting (in the value passed in from your client) to `['flake8']` in order to use the flake8 configuration instead. + +The configuration options available in these config files (`setup.cfg` etc) are documented in the relevant tools: + +- [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) +- [pycodestyle configuration](https://pycodestyle.pycqa.org/en/latest/intro.html#configuration) Overall configuration is computed first from user configuration (in home directory), overridden by configuration passed in by the language client, and then overridden by configuration discovered in the workspace. -To enable pydocstyle for linting docstrings add the following setting in your LSP configuration: -`"pylsp.plugins.pydocstyle.enabled": true` +As an example, to change the list of errors that pycodestyle will ignore, assuming you are using the `pycodestyle` configuration source (the default), you can: + +1. Add the following to your ~/.config/pycodestyle: + + ``` + [pycodestyle] + ignore = E226,E302,E41 + ``` + +2. Set the `pylsp.plugins.pycodestyle.ignore` config value from your editor +3. Same as 1, but add to `setup.cfg` file in the root of the project. -All configuration options are described in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). ## LSP Server Features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/README.md new/python-lsp-server-1.4.1/README.md --- old/python-lsp-server-1.4.0/README.md 2022-03-11 15:43:11.000000000 +0100 +++ new/python-lsp-server-1.4.1/README.md 2022-03-27 07:48:46.000000000 +0200 @@ -59,19 +59,34 @@ ## Configuration -Configuration is loaded from zero or more configuration sources. Currently implemented are: +Like all language servers, configuration can be passed from the client that talks to this server (i.e. your editor/IDE or other tool that has the same purpose). The details of how this is done depend on the editor or plugin that you are using to communicate with `python-lsp-server`. The configuration options available at that level are documented in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). -- pycodestyle: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. -- flake8: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` +`python-lsp-server` depends on other tools, like flake8 and pycodestyle. These tools can be configured via settings passed from the client (as above), or alternatively from other configuration sources. The following sources are available: -The default configuration source is pycodestyle. Change the `pylsp.configurationSources` setting to `['flake8']` in order to respect flake8 configuration instead. +- `pycodestyle`: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. +- `flake8`: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` + +The default configuration source is `pycodestyle`. Change the `pylsp.configurationSources` setting (in the value passed in from your client) to `['flake8']` in order to use the flake8 configuration instead. + +The configuration options available in these config files (`setup.cfg` etc) are documented in the relevant tools: + +- [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) +- [pycodestyle configuration](https://pycodestyle.pycqa.org/en/latest/intro.html#configuration) Overall configuration is computed first from user configuration (in home directory), overridden by configuration passed in by the language client, and then overridden by configuration discovered in the workspace. -To enable pydocstyle for linting docstrings add the following setting in your LSP configuration: -`"pylsp.plugins.pydocstyle.enabled": true` +As an example, to change the list of errors that pycodestyle will ignore, assuming you are using the `pycodestyle` configuration source (the default), you can: + +1. Add the following to your ~/.config/pycodestyle: + + ``` + [pycodestyle] + ignore = E226,E302,E41 + ``` + +2. Set the `pylsp.plugins.pycodestyle.ignore` config value from your editor +3. Same as 1, but add to `setup.cfg` file in the root of the project. -All configuration options are described in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). ## LSP Server Features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/RELEASE.md new/python-lsp-server-1.4.1/RELEASE.md --- old/python-lsp-server-1.4.0/RELEASE.md 2022-03-11 16:09:19.000000000 +0100 +++ new/python-lsp-server-1.4.1/RELEASE.md 2022-03-27 08:03:00.000000000 +0200 @@ -2,7 +2,7 @@ 1. Create pull request to update CHANGELOG.md with * `loghub python-lsp/python-lsp-server -m vX.X.X` - * git add -A && git commit -m "Update Changelog" + * git add -A && git commit -m "Update changelog for X.X.X" This is necessary to run our tests before the release, so we can be sure everything is in order. @@ -16,5 +16,4 @@ 6. python setup.py bdist_wheel 7. twine check dist/* 8. twine upload dist/* -9. git push upstream develop -10. git push upstream --tags +9. git push upstream --tags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/pylsp/_version.py new/python-lsp-server-1.4.1/pylsp/_version.py --- old/python-lsp-server-1.4.0/pylsp/_version.py 2022-03-11 16:12:51.000000000 +0100 +++ new/python-lsp-server-1.4.1/pylsp/_version.py 2022-03-27 08:05:19.000000000 +0200 @@ -1 +1 @@ -__version__ = "1.4.0" +__version__ = "1.4.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/pylsp/plugins/flake8_lint.py new/python-lsp-server-1.4.1/pylsp/plugins/flake8_lint.py --- old/python-lsp-server-1.4.0/pylsp/plugins/flake8_lint.py 2022-03-11 15:43:11.000000000 +0100 +++ new/python-lsp-server-1.4.1/pylsp/plugins/flake8_lint.py 2022-03-27 07:48:46.000000000 +0200 @@ -81,7 +81,7 @@ try: cmd = [flake8_executable] cmd.extend(args) - p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with + p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) except IOError: log.debug("Can't execute %s. Trying with '%s -m flake8'", flake8_executable, sys.executable) cmd = [sys.executable, '-m', 'flake8'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/pylsp/plugins/pylint_lint.py new/python-lsp-server-1.4.1/pylsp/plugins/pylint_lint.py --- old/python-lsp-server-1.4.0/pylsp/plugins/pylint_lint.py 2022-03-11 15:43:11.000000000 +0100 +++ new/python-lsp-server-1.4.1/pylsp/plugins/pylint_lint.py 2022-03-27 07:48:46.000000000 +0200 @@ -246,7 +246,7 @@ cmd = [pylint_executable] cmd.extend(flags) cmd.extend(['--from-stdin', document.path]) - p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with + p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) except IOError: log.debug("Can't execute %s. Trying with 'python -m pylint'", pylint_executable) cmd = ['python', '-m', 'pylint'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/pylsp/plugins/yapf_format.py new/python-lsp-server-1.4.1/pylsp/plugins/yapf_format.py --- old/python-lsp-server-1.4.0/pylsp/plugins/yapf_format.py 2022-03-11 15:43:11.000000000 +0100 +++ new/python-lsp-server-1.4.1/pylsp/plugins/yapf_format.py 2022-03-27 07:48:46.000000000 +0200 @@ -37,14 +37,14 @@ def _format(document, lines=None): - # Yapf doesn't work with CR line endings, so we replace them by '\n' + # Yapf doesn't work with CRLF/CR line endings, so we replace them by '\n' # and restore them below. - replace_cr = False + replace_eols = False source = document.source eol_chars = get_eol_chars(source) - if eol_chars == '\r': - replace_cr = True - source = source.replace('\r', '\n') + if eol_chars in ['\r', '\r\n']: + replace_eols = True + source = source.replace(eol_chars, '\n') new_source, changed = FormatCode( source, @@ -58,8 +58,8 @@ if not changed: return [] - if replace_cr: - new_source = new_source.replace('\n', '\r') + if replace_eols: + new_source = new_source.replace('\n', eol_chars) # I'm too lazy at the moment to parse diffs into TextEdit items # So let's just return the entire file... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/python_lsp_server.egg-info/PKG-INFO new/python-lsp-server-1.4.1/python_lsp_server.egg-info/PKG-INFO --- old/python-lsp-server-1.4.0/python_lsp_server.egg-info/PKG-INFO 2022-03-11 16:12:52.000000000 +0100 +++ new/python-lsp-server-1.4.1/python_lsp_server.egg-info/PKG-INFO 2022-03-27 08:05:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python-lsp-server -Version: 1.4.0 +Version: 1.4.1 Summary: Python Language Server for the Language Server Protocol Home-page: https://github.com/python-lsp/python-lsp-server Author: Python Language Server Contributors @@ -82,19 +82,34 @@ ## Configuration -Configuration is loaded from zero or more configuration sources. Currently implemented are: +Like all language servers, configuration can be passed from the client that talks to this server (i.e. your editor/IDE or other tool that has the same purpose). The details of how this is done depend on the editor or plugin that you are using to communicate with `python-lsp-server`. The configuration options available at that level are documented in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). -- pycodestyle: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. -- flake8: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` +`python-lsp-server` depends on other tools, like flake8 and pycodestyle. These tools can be configured via settings passed from the client (as above), or alternatively from other configuration sources. The following sources are available: -The default configuration source is pycodestyle. Change the `pylsp.configurationSources` setting to `['flake8']` in order to respect flake8 configuration instead. +- `pycodestyle`: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. +- `flake8`: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` + +The default configuration source is `pycodestyle`. Change the `pylsp.configurationSources` setting (in the value passed in from your client) to `['flake8']` in order to use the flake8 configuration instead. + +The configuration options available in these config files (`setup.cfg` etc) are documented in the relevant tools: + +- [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) +- [pycodestyle configuration](https://pycodestyle.pycqa.org/en/latest/intro.html#configuration) Overall configuration is computed first from user configuration (in home directory), overridden by configuration passed in by the language client, and then overridden by configuration discovered in the workspace. -To enable pydocstyle for linting docstrings add the following setting in your LSP configuration: -`"pylsp.plugins.pydocstyle.enabled": true` +As an example, to change the list of errors that pycodestyle will ignore, assuming you are using the `pycodestyle` configuration source (the default), you can: + +1. Add the following to your ~/.config/pycodestyle: + + ``` + [pycodestyle] + ignore = E226,E302,E41 + ``` + +2. Set the `pylsp.plugins.pycodestyle.ignore` config value from your editor +3. Same as 1, but add to `setup.cfg` file in the root of the project. -All configuration options are described in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md). ## LSP Server Features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/test/plugins/test_autopep8_format.py new/python-lsp-server-1.4.1/test/plugins/test_autopep8_format.py --- old/python-lsp-server-1.4.0/test/plugins/test_autopep8_format.py 2022-03-11 15:43:11.000000000 +0100 +++ new/python-lsp-server-1.4.1/test/plugins/test_autopep8_format.py 2022-03-27 07:48:46.000000000 +0200 @@ -1,6 +1,8 @@ # Copyright 2017-2020 Palantir Technologies, Inc. # Copyright 2021- Python Language Server Contributors. +import pytest + from pylsp import uris from pylsp.plugins.autopep8_format import pylsp_format_document, pylsp_format_range from pylsp.workspace import Document @@ -73,8 +75,9 @@ assert res[0]['newText'] == CORRECT_INDENTED_DOC -def test_cr_line_endings(config, workspace): - doc = Document(DOC_URI, workspace, 'import os;import sys\r\rdict(a=1)') +@pytest.mark.parametrize('newline', ['\r\n', '\r']) +def test_line_endings(config, workspace, newline): + doc = Document(DOC_URI, workspace, f'import os;import sys{2 * newline}dict(a=1)') res = pylsp_format_document(config, doc) - assert res[0]['newText'] == 'import os\rimport sys\r\rdict(a=1)\r' + assert res[0]['newText'] == f'import os{newline}import sys{2 * newline}dict(a=1){newline}' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/test/plugins/test_flake8_lint.py new/python-lsp-server-1.4.1/test/plugins/test_flake8_lint.py --- old/python-lsp-server-1.4.0/test/plugins/test_flake8_lint.py 2021-10-30 19:18:46.000000000 +0200 +++ new/python-lsp-server-1.4.1/test/plugins/test_flake8_lint.py 2022-03-27 07:48:46.000000000 +0200 @@ -43,8 +43,8 @@ def test_flake8_lint(workspace): + name, doc = temp_document(DOC, workspace) try: - name, doc = temp_document(DOC, workspace) diags = flake8_lint.pylsp_lint(workspace, doc) msg = 'F841 local variable \'a\' is assigned to but never used' unused_var = [d for d in diags if d['message'] == msg][0] @@ -54,7 +54,6 @@ assert unused_var['range']['start'] == {'line': 5, 'character': 1} assert unused_var['range']['end'] == {'line': 5, 'character': 11} assert unused_var['severity'] == lsp.DiagnosticSeverity.Warning - finally: os.remove(name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-lsp-server-1.4.0/test/plugins/test_yapf_format.py new/python-lsp-server-1.4.1/test/plugins/test_yapf_format.py --- old/python-lsp-server-1.4.0/test/plugins/test_yapf_format.py 2022-03-11 15:43:11.000000000 +0100 +++ new/python-lsp-server-1.4.1/test/plugins/test_yapf_format.py 2022-03-27 07:48:46.000000000 +0200 @@ -1,6 +1,8 @@ # Copyright 2017-2020 Palantir Technologies, Inc. # Copyright 2021- Python Language Server Contributors. +import pytest + from pylsp import uris from pylsp.plugins.yapf_format import pylsp_format_document, pylsp_format_range from pylsp.workspace import Document @@ -60,8 +62,9 @@ assert pylsp_format_document(doc)[0]['newText'] == "A = [\n 'h', 'w',\n 'a'\n]\n\nB = ['h', 'w']\n" -def test_cr_line_endings(workspace): - doc = Document(DOC_URI, workspace, 'import os;import sys\r\rdict(a=1)') +@pytest.mark.parametrize('newline', ['\r\n', '\r']) +def test_line_endings(workspace, newline): + doc = Document(DOC_URI, workspace, f'import os;import sys{2 * newline}dict(a=1)') res = pylsp_format_document(doc) - assert res[0]['newText'] == 'import os\rimport sys\r\rdict(a=1)\r' + assert res[0]['newText'] == f'import os{newline}import sys{2 * newline}dict(a=1){newline}'