From 05129cec4610bf321ac7671fb8ef25a91de2845d0238b18e9e74a4c7787e12e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Tue, 4 Feb 2020 11:43:22 +0000 Subject: [PATCH] - add delete.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jedi?expand=0&rev=54 --- delete.patch | 43 +++++++++++++++++++++++++++++++++++++++++++ python-jedi.changes | 1 + python-jedi.spec | 2 ++ 3 files changed, 46 insertions(+) create mode 100644 delete.patch diff --git a/delete.patch b/delete.patch new file mode 100644 index 0000000..1b03d68 --- /dev/null +++ b/delete.patch @@ -0,0 +1,43 @@ +From bec87f7ff82b0731713c6520a14c213341b4cecf Mon Sep 17 00:00:00 2001 +From: Dave Halter +Date: Sun, 26 Jan 2020 20:07:25 +0100 +Subject: [PATCH] Jedi understand now when you use del, fixes #313 + +--- + test/completion/basic.py | 6 +++--- + test/test_api/test_full_name.py | 3 ++- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/test/completion/basic.py b/test/completion/basic.py +index b40068179..3ff919ca6 100644 +--- a/test/completion/basic.py ++++ b/test/completion/basic.py +@@ -209,11 +209,11 @@ def global_as_import(): + + deleted_var = 3 + del deleted_var +-#? int() ++#? + deleted_var +-#? ['deleted_var'] ++#? [] + deleted_var +-#! ['deleted_var = 3'] ++#! [] + deleted_var + + # ----------------- +diff --git a/test/test_api/test_full_name.py b/test/test_api/test_full_name.py +index 4fdb861b0..6858b6ca8 100644 +--- a/test/test_api/test_full_name.py ++++ b/test/test_api/test_full_name.py +@@ -112,7 +112,8 @@ def test_os_path(Script): + + def test_os_issues(Script): + """Issue #873""" +- assert [c.name for c in Script('import os\nos.nt''').complete()] == ['nt'] ++ # nt is not found, because it's deleted ++ assert [c.name for c in Script('import os\nos.nt''').complete()] == [] + + + def test_param_name(Script): diff --git a/python-jedi.changes b/python-jedi.changes index 2e6bcab..22367c3 100644 --- a/python-jedi.changes +++ b/python-jedi.changes @@ -2,6 +2,7 @@ Tue Feb 4 09:38:03 UTC 2020 - Ondřej Súkup - update to 0.16.0 +- add delete.patch * Added Script.get_context to get information where you currently are. * Completions/type inference of Pytest fixtures. * Tensorflow, Numpy and Pandas completions should now be about 4-10x faster after the first time they are used. diff --git a/python-jedi.spec b/python-jedi.spec index b1427d9..5af069f 100644 --- a/python-jedi.spec +++ b/python-jedi.spec @@ -26,6 +26,7 @@ Group: Development/Languages/Python URL: https://github.com/davidhalter/jedi Source0: https://files.pythonhosted.org/packages/source/j/jedi/jedi-%{version}.tar.gz Patch0: unbundle.patch +Patch1: delete.patch BuildRequires: %{python_module parso >= 0.5.0} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} @@ -54,6 +55,7 @@ implementation as a VIM plugin which uses Jedi's autocompletion. %prep %setup -q -n jedi-%{version} %patch0 -p1 +%patch1 -p1 rm -Rf jedi/third_party %build