Accepting request 939577 from home:bnavigator:branches:devel:languages:python

- Update to 0.18.1
  * Implict namespaces are now a separate types in Name().type
  * Python 3.10 support
  * Mostly bugfixes
- Drop jedi-py39-pytest.patch
- Skip failing test (reported as gh#davidhalter/jedi#1824)

OBS-URL: https://build.opensuse.org/request/show/939577
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jedi?expand=0&rev=89
This commit is contained in:
Benjamin Greiner 2021-12-11 12:23:44 +00:00 committed by Git OBS Bridge
parent 2265bd365b
commit 01cf371a2f
5 changed files with 18 additions and 74 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:92550a404bad8afed881a137ec9a461fed49eca661414be45059329614ed0707
size 1127968

3
jedi-0.18.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74137626a64a99c8eb6ae5832d99b3bdd7d29a3850fe2aa80a4126b2a7d949ab
size 1222511

View File

@ -1,60 +0,0 @@
From 85ec94cf6518e3446c5b19048c046a784fed4130 Mon Sep 17 00:00:00 2001
From: Dave Halter <davidhalter88@gmail.com>
Date: Sat, 26 Dec 2020 03:32:17 +0100
Subject: [PATCH] Fix pytest issues, fixes #1699
---
jedi/plugins/pytest.py | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/jedi/plugins/pytest.py b/jedi/plugins/pytest.py
index cec237338..d0dfba018 100644
--- a/jedi/plugins/pytest.py
+++ b/jedi/plugins/pytest.py
@@ -5,6 +5,7 @@
from jedi.inference.imports import load_module_from_path
from jedi.inference.filters import ParserTreeFilter
from jedi.inference.base_value import NO_VALUES, ValueSet
+from jedi.inference.helpers import infer_call_of_leaf
_PYTEST_FIXTURE_MODULES = [
('_pytest', 'monkeypatch'),
@@ -147,18 +148,35 @@ class FixtureFilter(ParserTreeFilter):
def _filter(self, names):
for name in super()._filter(names):
funcdef = name.parent
+ # Class fixtures are not supported
if funcdef.type == 'funcdef':
- # Class fixtures are not supported
decorated = funcdef.parent
if decorated.type == 'decorated' and self._is_fixture(decorated):
yield name
def _is_fixture(self, decorated):
- for decorator in decorated.children:
+ decorators = decorated.children[0]
+ if decorators.type == 'decorators':
+ decorators = decorators.children
+ else:
+ decorators = [decorators]
+ for decorator in decorators:
dotted_name = decorator.children[1]
# A heuristic, this makes it faster.
if 'fixture' in dotted_name.get_code():
- for value in self.parent_context.infer_node(dotted_name):
+ if dotted_name.type == 'atom_expr':
+ # Since Python3.9 a decorator does not have dotted names
+ # anymore.
+ last_trailer = dotted_name.children[-1]
+ last_leaf = last_trailer.get_last_leaf()
+ if last_leaf == ')':
+ values = infer_call_of_leaf(
+ self.parent_context, last_leaf, cut_own_trailer=True)
+ else:
+ values = self.parent_context.infer_node(dotted_name)
+ else:
+ values = self.parent_context.infer_node(dotted_name)
+ for value in values:
if value.name.get_qualified_names(include_module_names=True) \
== ('_pytest', 'fixtures', 'fixture'):
return True

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Dec 10 20:53:13 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to 0.18.1
* Implict namespaces are now a separate types in Name().type
* Python 3.10 support
* Mostly bugfixes
- Drop jedi-py39-pytest.patch
- Skip failing test (reported as gh#davidhalter/jedi#1824)
-------------------------------------------------------------------
Sun Oct 31 15:56:52 UTC 2021 - Benjamin Greiner <code@bnavigator.de>

View File

@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-jedi
Version: 0.18.0
Version: 0.18.1
Release: 0
Summary: An autocompletion tool for Python
License: MIT AND Python-2.0
@ -27,11 +27,8 @@ Group: Development/Languages/Python
URL: https://github.com/davidhalter/jedi
Source0: https://files.pythonhosted.org/packages/source/j/jedi/jedi-%{version}.tar.gz
Source1: %{name}-rpmlintrc
# PATCH-FIX-UPSTREAM Support pytest completion for Python 3.9 -- gh#davidhalter/jedi#1699
Patch0: https://github.com/davidhalter/jedi/commit/85ec94cf.patch#/jedi-py39-pytest.patch
BuildRequires: %{python_module parso >= 0.8.0}
# need pytest <6 https://github.com/davidhalter/jedi/issues/1660; pytest4 in Leap cannot work with pluggy 1.0 in :backports
BuildRequires: %{python_module pytest5}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing}
BuildRequires: fdupes
@ -71,12 +68,9 @@ skiptests+=" or test_sqlite3_conversion"
skiptests+=" or test_speed"
# fails on some architectures
skiptests+=" or test_init_extension_module"
%if 0%{?suse_version} == 1500
# the python 2 pytest test discovery in Leap 15 and SLE15
# trips on purposely placed syntax errors in test/completion/imports.py
%define pytestignore --ignore test/__init__.py
%endif
%pytest -k "not ($skiptests)" %{?pytestignore}
# https://github.com/davidhalter/jedi/issues/1824
skiptests+=" or (test_completion and lambdas and 112)"
%pytest -k "not ($skiptests)"
%files %{python_files}
%doc AUTHORS.txt CHANGELOG.rst README.rst