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

- tell Leap 15.1 and SLE 15 SP1 pytest to ignore test/__init__.py so that a test file with purposely placed syntax errors does not trip the entire discovery
- reenable (most) unittests
- remove unbundle.patch -- according to upstream, typeshed is meant to be bundled.

I was made package maintainer some time ago, but for this SR I would like to have a project maintainer look at the revert of unbundling typeshed first.

Re-enabling the unit tests to make sure further work on python-language-server and spyder works with a sane package when unpinning their dependencies. Upstream of those packages does not like to support unpinned Jedi [1, 2].

[1] https://github.com/spyder-ide/spyder/issues/11975
[2] https://github.com/palantir/python-language-server/issues/744

OBS-URL: https://build.opensuse.org/request/show/793600
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jedi?expand=0&rev=63
This commit is contained in:
Matej Cepl 2020-04-14 08:51:52 +00:00 committed by Git OBS Bridge
parent 2322b1aa2c
commit 86e95ff892
4 changed files with 26 additions and 43 deletions

1
python-jedi-rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("zero-length.*typeshed.*pyi")

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon Apr 13 10:01:10 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- tell Leap 15.1 and SLE 15 SP1 pytest to ignore test/__init__.py
so that a test file with purposely placed syntax errors does not
trip the entire discovery
-------------------------------------------------------------------
Thu Apr 9 18:59:55 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- reenable (most) unittests
- remove unbundle.patch -- according to upstream, typeshed is meant
to be bundled.
-------------------------------------------------------------------
Tue Mar 17 21:45:28 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@ -25,16 +25,14 @@ License: MIT AND Python-2.0
Group: Development/Languages/Python
URL: https://github.com/davidhalter/jedi
Source0: jedi-%{version}.tar.xz
Patch0: unbundle.patch
Source1: %{name}-rpmlintrc
BuildRequires: %{python_module parso >= 0.5.0}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python-typeshed
Requires: python-parso >= 0.5.0
Requires: python-typeshed
BuildArch: noarch
%python_subpackages
@ -53,8 +51,6 @@ implementation as a VIM plugin which uses Jedi's autocompletion.
%prep
%setup -q -n jedi-%{version}
%patch0 -p1
rm -Rf jedi/third_party
%build
%python_build
@ -66,10 +62,16 @@ rm -Rf jedi/third_party
%check
export PYTHONDONTWRITEBYTECODE=1
export LANG="en_US.UTF-8"
# Do not execute tests
# Reason here is that the upstream uses bundled typeshed of exact revision and we can't guarantee that
# Something like 20-30 tests always break with any typeshed change, and as such we can't do much
# %%pytest -k "not (test_venv_and_pths or test_completion or test_builtin_details or test_static_analysis or test_os_path_join or test_import or test_compiled_signature or test_module__file__ or test_sqlite3_conversion)"
skiptests="test_venv_and_pths"
skiptests+=" or test_sqlite3_conversion"
# some architectures are too slow for these optimizer devel checks
skiptests+=" or test_speed"
%if 0%{?sle_version} == 150100
# the python 2 pytest test discovery in Leap 15.1 and SLE15 SP1
# trips on purposely placed syntax errors in test/completion/imports.py
%define pytestignore --ignore test/__init__.py
%endif
%pytest -k "not ($skiptests)" %{?pytestignore}
%files %{python_files}
%doc AUTHORS.txt CHANGELOG.rst README.rst

View File

@ -1,34 +0,0 @@
Index: jedi-0.15.2/setup.py
===================================================================
--- jedi-0.15.2.orig/setup.py
+++ jedi-0.15.2/setup.py
@@ -2,7 +2,6 @@
from setuptools import setup, find_packages
-import os
import ast
__AUTHOR__ = 'David Halter'
@@ -17,8 +16,6 @@ readme = open('README.rst').read() + '\n
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
-assert os.path.isfile("jedi/third_party/typeshed/LICENSE"), \
- "Please download the typeshed submodule first (Hint: git submodule update --init)"
setup(name='jedi',
version=version,
Index: jedi-0.15.2/jedi/inference/gradual/typeshed.py
===================================================================
--- jedi-0.15.2.orig/jedi/inference/gradual/typeshed.py
+++ jedi-0.15.2/jedi/inference/gradual/typeshed.py
@@ -10,7 +10,7 @@ from jedi.inference.gradual.stub_value i
from jedi.inference.value import ModuleValue
_jedi_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-TYPESHED_PATH = os.path.join(_jedi_path, 'third_party', 'typeshed')
+TYPESHED_PATH = "/usr/share/typeshed"
_IMPORT_MAP = dict(
_collections='collections',