diff --git a/python-lsp-server-pr415-flake8deps.patch b/python-lsp-server-pr415-flake8deps.patch new file mode 100644 index 0000000..7e9ab15 --- /dev/null +++ b/python-lsp-server-pr415-flake8deps.patch @@ -0,0 +1,135 @@ +From 181db703d6fad6baa5c57ee24a07068f5101f5d1 Mon Sep 17 00:00:00 2001 +From: Chih-Hsuan Yen <645432-yan12125@users.noreply.gitlab.com> +Date: Sat, 12 Aug 2023 12:41:38 +0800 +Subject: [PATCH 1/4] Add support for pyflakes 3.1 + +`ContinueInFinally` is dropped in pyflakes 3.1 [1]. + +flake8 is bumped to a version that supports pyflakes 3.1 [2]. + +Closes https://github.com/python-lsp/python-lsp-server/issues/412 + +[1] https://github.com/PyCQA/pyflakes/pull/752 +[2] https://flake8.pycqa.org/en/latest/release-notes/6.1.0.html +--- + pylsp/plugins/pyflakes_lint.py | 1 - + pyproject.toml | 8 ++++---- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/pylsp/plugins/pyflakes_lint.py b/pylsp/plugins/pyflakes_lint.py +index 72e16a2e..2c3c3293 100644 +--- a/pylsp/plugins/pyflakes_lint.py ++++ b/pylsp/plugins/pyflakes_lint.py +@@ -15,7 +15,6 @@ + messages.YieldOutsideFunction, + messages.ContinueOutsideLoop, + messages.BreakOutsideLoop, +- messages.ContinueInFinally, + messages.TwoStarredExpressions, + ) + +diff --git a/pyproject.toml b/pyproject.toml +index 7e62d24c..c69f92f6 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -28,22 +28,22 @@ Homepage = "https://github.com/python-lsp/python-lsp-server" + [project.optional-dependencies] + all = [ + "autopep8>=1.6.0,<2.1.0", +- "flake8>=5.0.0,<7", ++ "flake8>=6.1.0,<7", + "mccabe>=0.7.0,<0.8.0", + "pycodestyle>=2.9.0,<2.11.0", + "pydocstyle>=6.3.0,<6.4.0", +- "pyflakes>=2.5.0,<3.1.0", ++ "pyflakes>=3.1.0,<3.2.0", + "pylint>=2.5.0,<3", + "rope>1.2.0", + "yapf>=0.33.0", + "whatthepatch>=1.0.2,<2.0.0" + ] + autopep8 = ["autopep8>=1.6.0,<2.1.0"] +-flake8 = ["flake8>=5.0.0,<7"] ++flake8 = ["flake8>=6.1.0,<7"] + mccabe = ["mccabe>=0.7.0,<0.8.0"] + pycodestyle = ["pycodestyle>=2.9.0,<2.11.0"] + pydocstyle = ["pydocstyle>=6.3.0,<6.4.0"] +-pyflakes = ["pyflakes>=2.5.0,<3.1.0"] ++pyflakes = ["pyflakes>=3.1.0,<3.2.0"] + pylint = ["pylint>=2.5.0,<3"] + rope = ["rope>1.2.0"] + yapf = ["yapf>=0.33.0", "whatthepatch>=1.0.2,<2.0.0"] + +From fe31435d83d3a25c92cf0d974b09f1ee7d7b94eb Mon Sep 17 00:00:00 2001 +From: Chih-Hsuan Yen <1937689+yan12125@users.noreply.github.com> +Date: Sun, 13 Aug 2023 01:10:51 +0800 +Subject: [PATCH 2/4] Update pyproject.toml + +Co-authored-by: Carlos Cordoba +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index c69f92f6..2379ce2b 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -30,7 +30,7 @@ all = [ + "autopep8>=1.6.0,<2.1.0", + "flake8>=6.1.0,<7", + "mccabe>=0.7.0,<0.8.0", +- "pycodestyle>=2.9.0,<2.11.0", ++ "pycodestyle>=2.11.0,<2.12.0", + "pydocstyle>=6.3.0,<6.4.0", + "pyflakes>=3.1.0,<3.2.0", + "pylint>=2.5.0,<3", + +From 952a73d2fdbbc8ad42f22aa29a10697d32155a3c Mon Sep 17 00:00:00 2001 +From: Chih-Hsuan Yen <1937689+yan12125@users.noreply.github.com> +Date: Sun, 13 Aug 2023 01:10:57 +0800 +Subject: [PATCH 3/4] Update pyproject.toml + +Co-authored-by: Carlos Cordoba +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 2379ce2b..60a36b99 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -41,7 +41,7 @@ all = [ + autopep8 = ["autopep8>=1.6.0,<2.1.0"] + flake8 = ["flake8>=6.1.0,<7"] + mccabe = ["mccabe>=0.7.0,<0.8.0"] +-pycodestyle = ["pycodestyle>=2.9.0,<2.11.0"] ++pycodestyle = ["pycodestyle>=2.11.0,<2.12.0"] + pydocstyle = ["pydocstyle>=6.3.0,<6.4.0"] + pyflakes = ["pyflakes>=3.1.0,<3.2.0"] + pylint = ["pylint>=2.5.0,<3"] + +From 295e4df835bc7025699c59ee303662b02959e2c2 Mon Sep 17 00:00:00 2001 +From: Chih-Hsuan Yen <645432-yan12125@users.noreply.gitlab.com> +Date: Sun, 13 Aug 2023 01:15:26 +0800 +Subject: [PATCH 4/4] Use newer Python for static ananlysis + +New flake8 requires Python 3.8 [1]. + +[1] https://flake8.pycqa.org/en/latest/release-notes/6.0.0.html +--- + .github/workflows/static.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml +index 7a398c0b..3eefea21 100644 +--- a/.github/workflows/static.yml ++++ b/.github/workflows/static.yml +@@ -32,7 +32,7 @@ jobs: + with: + # TODO: check with Python 3, but need to fix the + # errors first +- python-version: '3.7' ++ python-version: '3.8' + architecture: 'x64' + - run: python -m pip install --upgrade pip setuptools jsonschema + - run: pip install -e .[pylint,pycodestyle,pyflakes] diff --git a/python-lsp-server-pr416-jedi-0.19.patch b/python-lsp-server-pr416-jedi-0.19.patch new file mode 100644 index 0000000..fd2bd1f --- /dev/null +++ b/python-lsp-server-pr416-jedi-0.19.patch @@ -0,0 +1,13 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 7e62d24..e0b6e07 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -13,7 +13,7 @@ readme = "README.md" + license = {text = "MIT"} + requires-python = ">=3.7" + dependencies = [ +- "jedi>=0.17.2,<0.19.0", ++ "jedi>=0.17.2,<0.20.0", + "python-lsp-jsonrpc>=1.0.0", + "pluggy>=1.0.0", + "docstring-to-markdown", diff --git a/python-python-lsp-server.changes b/python-python-lsp-server.changes index 2ffc823..4473487 100644 --- a/python-python-lsp-server.changes +++ b/python-python-lsp-server.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Aug 12 18:01:40 UTC 2023 - Ben Greiner + +- Add python-lsp-server-pr415-flake8deps.patch + gh#python-lsp/python-lsp-server#415 +- Add python-lsp-server-pr416-jedi-0.19.patch + gh#python-lsp/python-lsp-server#416 + ------------------------------------------------------------------- Sat Jul 1 13:38:40 UTC 2023 - Ben Greiner diff --git a/python-python-lsp-server.spec b/python-python-lsp-server.spec index 798d1e7..a47be7f 100644 --- a/python-python-lsp-server.spec +++ b/python-python-lsp-server.spec @@ -23,7 +23,9 @@ Summary: Python Language Server for the Language Server Protocol License: MIT URL: https://github.com/python-lsp/python-lsp-server Source: https://files.pythonhosted.org/packages/source/p/python-lsp-server/python-lsp-server-%{version}.tar.gz -BuildRequires: %{python_module base >= 3.7} +Patch0: python-lsp-server-pr415-flake8deps.patch +Patch1: python-lsp-server-pr416-jedi-0.19.patch +BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 61.2} BuildRequires: %{python_module setuptools_scm >= 3.4.3} @@ -33,9 +35,9 @@ BuildRequires: python-rpm-macros >= 20210628 BuildRequires: %{python_module docstring-to-markdown} BuildRequires: %{python_module PyQt5} BuildRequires: %{python_module autopep8 >= 1.6.0 with %python-autopep8 < 2.1.0} -BuildRequires: %{python_module flake8 >= 5.0.0 with %python-flake8 < 7} +BuildRequires: %{python_module flake8 >= 6.1.0 with %python-flake8 < 7} BuildRequires: %{python_module flaky} -BuildRequires: %{python_module jedi >= 0.17.2 with %python-jedi < 0.19.0} +BuildRequires: %{python_module jedi >= 0.17.2 with %python-jedi < 0.20} BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpy} BuildRequires: %{python_module pandas} @@ -55,7 +57,7 @@ Requires: python-pluggy >= 1.0.0 Requires: python-python-lsp-jsonrpc >= 1.0.0 Requires: python-setuptools >= 39.0.0 Requires: python-ujson >= 3.0.0 -Requires: (python-jedi >= 0.17.2 with python-jedi < 0.19.0) +Requires: (python-jedi >= 0.17.2 with python-jedi < 0.20) Suggests: python-autopep8 >= 1.6.0 Conflicts: python-autopep8 >= 2.1.0 Suggests: python-pydocstyle >= 6.3.0 @@ -67,14 +69,14 @@ Suggests: python-yapf >= 0.33 Suggests: python-whatthepatch >= 1.0.2 Conflicts: python-whatthepatch >= 2 # SECTION flake8 pins -Suggests: python-flake8 >= 5.0.0 +Suggests: python-flake8 >= 6.1.0 Conflicts: python-flake8 >= 7 Suggests: python-mccabe >= 0.7.0 Conflicts: python-mccabe >= 0.8.0 -Suggests: python-pycodestyle >= 2.9.0 -Conflicts: python-pycodestyle >= 2.11.0 -Suggests: python-pyflakes >= 2.5.0 -Conflicts: python-pyflakes >= 3.1.0 +Suggests: python-pycodestyle >= 2.11.0 +Conflicts: python-pycodestyle >= 2.12.0 +Suggests: python-pyflakes >= 3.1.0 +Conflicts: python-pyflakes >= 3.2.0 # /SECTION BuildArch: noarch Requires(post): update-alternatives