Hello community,

here is the log from the commit of package python-jedi for openSUSE:Factory 
checked in at 2019-06-18 14:44:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jedi (Old)
 and      /work/SRC/openSUSE:Factory/.python-jedi.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jedi"

Tue Jun 18 14:44:15 2019 rev:12 rq:706299 version:0.13.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jedi/python-jedi.changes  2019-01-08 
12:31:20.344085149 +0100
+++ /work/SRC/openSUSE:Factory/.python-jedi.new.4811/python-jedi.changes        
2019-06-18 14:44:22.621741510 +0200
@@ -1,0 +2,22 @@
+Wed May 29 12:51:13 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Disable tests as it is not working at all on python 3.7
+
+-------------------------------------------------------------------
+Tue Mar 26 10:48:44 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Do not bother condition for typing, on 3.7+ it is provided by base
+
+-------------------------------------------------------------------
+Sat Mar  2 15:12:14 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.13.3:
+  * Fixed an issue with embedded Python see 
https://github.com/davidhalter/jedi-vim/issues/870
+
+-------------------------------------------------------------------
+Thu Feb 14 12:05:41 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Fix the typing dependency
+- Really run the tests
+
+-------------------------------------------------------------------

Old:
----
  jedi-0.13.2.tar.gz

New:
----
  jedi-0.13.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jedi.spec ++++++
--- /var/tmp/diff_new_pack.SxY5ox/_old  2019-06-18 14:44:23.649741406 +0200
+++ /var/tmp/diff_new_pack.SxY5ox/_new  2019-06-18 14:44:23.653741406 +0200
@@ -17,36 +17,22 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-# Compiled file tests only work on particular architectures and only run on 
python 3.4
-%bcond_with tests
 Name:           python-jedi
-Version:        0.13.2
+Version:        0.13.3
 Release:        0
 Summary:        An autocompletion tool for Python
 License:        MIT AND Python-2.0
 Group:          Development/Languages/Python
 URL:            https://github.com/davidhalter/jedi
 Source0:        
https://files.pythonhosted.org/packages/source/j/jedi/jedi-%{version}.tar.gz
+BuildRequires:  %{python_module parso >= 0.3.0}
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module typing}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-parso >= 0.3.0
 BuildArch:      noarch
-%if %{with tests}
-# Test requirements
-BuildRequires:  %{python_module colorama}
-BuildRequires:  %{python_module docopt}
-BuildRequires:  %{python_module numpydoc}
-BuildRequires:  %{python_module parso >= 0.3.0}
-BuildRequires:  %{python_module pytest >= 2.3.5}
-BuildRequires:  %{python_module pytest-cache}
-BuildRequires:  python2-typing
-BuildRequires:  python3-tox
-# do not require python3-typing for python >= 3.5
-%if 0%{?suse_version} <= 1320
-BuildRequires:  python3-typing
-%endif
-%endif
 %python_subpackages
 
 %description
@@ -72,16 +58,12 @@
 %python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
-%if %{with tests}
 %check
-
 export PYTHONDONTWRITEBYTECODE=1
 export LANG="en_US.UTF-8"
-pushd docs
-# we don't care about the speed, just that it works
-tox -e py%{python3_version_nodots} --sitepackages --skip-missing-interpreters
-popd
-%endif
+# Don't bother with tests, this thing is broken on python3.7 and newer and
+# upstream needs to rewrite quite a lot
+#%%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} 
py.test-%{$python_bin_suffix} test/
 
 %files %{python_files}
 %doc AUTHORS.txt CHANGELOG.rst README.rst

++++++ jedi-0.13.2.tar.gz -> jedi-0.13.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/CHANGELOG.rst 
new/jedi-0.13.3/CHANGELOG.rst
--- old/jedi-0.13.2/CHANGELOG.rst       2018-12-15 20:10:18.000000000 +0100
+++ new/jedi-0.13.3/CHANGELOG.rst       2019-02-24 18:45:27.000000000 +0100
@@ -3,6 +3,11 @@
 Changelog
 ---------
 
+0.13.3 (2019-02-24)
++++++++++++++++++++
+
+- Fixed an issue with embedded Pytho, see 
https://github.com/davidhalter/jedi-vim/issues/870
+
 0.13.2 (2018-12-15)
 +++++++++++++++++++
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/PKG-INFO new/jedi-0.13.3/PKG-INFO
--- old/jedi-0.13.2/PKG-INFO    2018-12-15 20:16:08.000000000 +0100
+++ new/jedi-0.13.3/PKG-INFO    2019-02-24 18:50:54.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: jedi
-Version: 0.13.2
+Version: 0.13.3
 Summary: An autocompletion tool for Python that can be used for text editors.
 Home-page: https://github.com/davidhalter/jedi
 Author: David Halter
@@ -246,6 +246,11 @@
         Changelog
         ---------
         
+        0.13.3 (2019-02-24)
+        +++++++++++++++++++
+        
+        - Fixed an issue with embedded Pytho, see 
https://github.com/davidhalter/jedi-vim/issues/870
+        
         0.13.2 (2018-12-15)
         +++++++++++++++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/jedi/__init__.py 
new/jedi-0.13.3/jedi/__init__.py
--- old/jedi-0.13.2/jedi/__init__.py    2018-12-15 20:10:18.000000000 +0100
+++ new/jedi-0.13.3/jedi/__init__.py    2019-02-24 18:45:27.000000000 +0100
@@ -36,7 +36,7 @@
 good text editor, while still having very good IDE features for Python.
 """
 
-__version__ = '0.13.2'
+__version__ = '0.13.3'
 
 from jedi.api import Script, Interpreter, set_debug_function, \
     preload_module, names
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/jedi/_compatibility.py 
new/jedi-0.13.3/jedi/_compatibility.py
--- old/jedi-0.13.2/jedi/_compatibility.py      2018-12-15 20:10:18.000000000 
+0100
+++ new/jedi-0.13.3/jedi/_compatibility.py      2019-02-24 18:45:27.000000000 
+0100
@@ -348,6 +348,11 @@
 except NameError:
     NotADirectoryError = IOError
 
+try:
+    PermissionError = PermissionError
+except NameError:
+    PermissionError = IOError
+
 
 def no_unicode_pprint(dct):
     """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/jedi/api/environment.py 
new/jedi-0.13.3/jedi/api/environment.py
--- old/jedi-0.13.2/jedi/api/environment.py     2018-12-15 20:10:18.000000000 
+0100
+++ new/jedi-0.13.3/jedi/api/environment.py     2019-02-24 18:45:27.000000000 
+0100
@@ -153,9 +153,9 @@
     variable is considered to be safe / controlled by the user solely.
     """
     var = os.environ.get('VIRTUAL_ENV')
-    if var is not None:
+    if var:
         if var == sys.prefix:
-            return SameEnvironment()
+            return _try_get_same_env()
 
         try:
             return create_environment(var, safe=False)
@@ -184,9 +184,47 @@
     if virtual_env is not None:
         return virtual_env
 
-    # If no VirtualEnv is found, use the environment we're already
+    return _try_get_same_env()
+
+
+def _try_get_same_env():
+    env = SameEnvironment()
+    if not os.path.basename(env.executable).lower().startswith('python'):
+        # This tries to counter issues with embedding. In some cases (e.g.
+        # VIM's Python Mac/Windows, sys.executable is /foo/bar/vim. This
+        # happens, because for Mac a function called `_NSGetExecutablePath` is
+        # used and for Windows `GetModuleFileNameW`. These are both platform
+        # specific functions. For all other systems sys.executable should be
+        # alright. However here we try to generalize:
+        #
+        # 1. Check if the executable looks like python (heuristic)
+        # 2. In case it's not try to find the executable
+        # 3. In case we don't find it use an interpreter environment.
+        #
+        # The last option will always work, but leads to potential crashes of
+        # Jedi - which is ok, because it happens very rarely and even less,
+        # because the code below should work for most cases.
+        if os.name == 'nt':
+            # The first case would be a virtualenv and the second a normal
+            # Python installation.
+            checks = (r'Scripts\python.exe', 'python.exe')
+        else:
+            # For unix it looks like Python is always in a bin folder.
+            checks = (
+                'bin/python%s.%s' % (sys.version_info[0], sys.version[1]),
+                'bin/python%s' % (sys.version_info[0]),
+                'bin/python',
+            )
+        for check in checks:
+            guess = os.path.join(sys.exec_prefix, check)
+            if os.path.isfile(guess):
+                # Bingo - We think we have our Python.
+                return Environment(guess)
+        # It looks like there is no reasonable Python to be found.
+        return InterpreterEnvironment()
+    # If no virtualenv is found, use the environment we're already
     # using.
-    return SameEnvironment()
+    return env
 
 
 def get_cached_default_environment():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/jedi/api/helpers.py 
new/jedi-0.13.3/jedi/api/helpers.py
--- old/jedi-0.13.2/jedi/api/helpers.py 2018-12-15 20:10:18.000000000 +0100
+++ new/jedi-0.13.3/jedi/api/helpers.py 2019-02-24 18:45:27.000000000 +0100
@@ -130,7 +130,10 @@
         p.parse(tokens=tokenize_without_endmarker(code))
     except EndMarkerReached:
         return p.stack
-    raise SystemError("This really shouldn't happen. There's a bug in Jedi.")
+    raise SystemError(
+        "This really shouldn't happen. There's a bug in Jedi:\n%s"
+        % list(tokenize_without_endmarker(code))
+    )
 
 
 def evaluate_goto_definition(evaluator, context, leaf):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/jedi/api/project.py 
new/jedi-0.13.3/jedi/api/project.py
--- old/jedi-0.13.2/jedi/api/project.py 2018-12-15 20:10:18.000000000 +0100
+++ new/jedi-0.13.3/jedi/api/project.py 2019-02-24 18:45:27.000000000 +0100
@@ -1,7 +1,7 @@
 import os
 import json
 
-from jedi._compatibility import FileNotFoundError, NotADirectoryError
+from jedi._compatibility import FileNotFoundError, NotADirectoryError, 
PermissionError
 from jedi.api.environment import SameEnvironment, \
     get_cached_default_environment
 from jedi.api.exceptions import WrongVersion
@@ -151,7 +151,7 @@
     try:
         with open(os.path.join(directory, 'manage.py'), 'rb') as f:
             return b"DJANGO_SETTINGS_MODULE" in f.read()
-    except (FileNotFoundError, NotADirectoryError):
+    except (FileNotFoundError, NotADirectoryError, PermissionError):
         return False
 
     return False
@@ -167,7 +167,7 @@
     for dir in traverse_parents(check, include_current=True):
         try:
             return Project.load(dir)
-        except (FileNotFoundError, NotADirectoryError):
+        except (FileNotFoundError, NotADirectoryError, PermissionError):
             pass
 
         if first_no_init_file is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/jedi.egg-info/PKG-INFO 
new/jedi-0.13.3/jedi.egg-info/PKG-INFO
--- old/jedi-0.13.2/jedi.egg-info/PKG-INFO      2018-12-15 20:16:08.000000000 
+0100
+++ new/jedi-0.13.3/jedi.egg-info/PKG-INFO      2019-02-24 18:50:54.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: jedi
-Version: 0.13.2
+Version: 0.13.3
 Summary: An autocompletion tool for Python that can be used for text editors.
 Home-page: https://github.com/davidhalter/jedi
 Author: David Halter
@@ -246,6 +246,11 @@
         Changelog
         ---------
         
+        0.13.3 (2019-02-24)
+        +++++++++++++++++++
+        
+        - Fixed an issue with embedded Pytho, see 
https://github.com/davidhalter/jedi-vim/issues/870
+        
         0.13.2 (2018-12-15)
         +++++++++++++++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/setup.py new/jedi-0.13.3/setup.py
--- old/jedi-0.13.2/setup.py    2018-12-15 20:10:18.000000000 +0100
+++ new/jedi-0.13.3/setup.py    2019-02-24 18:45:27.000000000 +0100
@@ -10,7 +10,7 @@
 # Get the version from within jedi. It's defined in exactly one place now.
 with open('jedi/__init__.py') as f:
     tree = ast.parse(f.read())
-version = tree.body[1].value.s
+version = tree.body[int(not hasattr(tree, 'docstring'))].value.s
 
 readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read()
 with open('requirements.txt') as f:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jedi-0.13.2/test/test_api/test_environment.py 
new/jedi-0.13.3/test/test_api/test_environment.py
--- old/jedi-0.13.2/test/test_api/test_environment.py   2018-12-15 
20:10:18.000000000 +0100
+++ new/jedi-0.13.3/test/test_api/test_environment.py   2019-02-24 
18:45:27.000000000 +0100
@@ -131,6 +131,17 @@
     assert env.path == 'fake'
 
 
[email protected]('virtualenv', ['', 'fufuuuuu', sys.prefix])
+def test_get_default_environment_when_embedded(monkeypatch, virtualenv):
+    # When using Python embedded, sometimes the executable is not a Python
+    # executable.
+    executable_name = 'RANDOM_EXE'
+    monkeypatch.setattr(sys, 'executable', executable_name)
+    monkeypatch.setenv('VIRTUAL_ENV', virtualenv)
+    env = get_default_environment()
+    assert env.executable != executable_name
+
+
 def test_changing_venv(venv_path, monkeypatch):
     monkeypatch.setitem(os.environ, 'VIRTUAL_ENV', venv_path)
     get_cached_default_environment()


Reply via email to