[arch-commits] Commit in python-jedi/repos/community-any (4 files)
Jelle van der Waa
jelle at archlinux.org
Tue Mar 17 11:17:52 UTC 2020
Date: Tuesday, March 17, 2020 @ 11:17:51
Author: jelle
Revision: 600150
archrelease: copy trunk to community-any
Added:
python-jedi/repos/community-any/0001-Jedi-understand-now-when-you-use-del-fixes-313.patch
(from rev 600149, python-jedi/trunk/0001-Jedi-understand-now-when-you-use-del-fixes-313.patch)
python-jedi/repos/community-any/PKGBUILD
(from rev 600149, python-jedi/trunk/PKGBUILD)
Deleted:
python-jedi/repos/community-any/PKGBUILD
python-jedi/repos/community-any/jedi-fix-pytest5.1.2.patch
-----------------------------------------------------------+
0001-Jedi-understand-now-when-you-use-del-fixes-313.patch | 46 ++
PKGBUILD | 135 +++-----
jedi-fix-pytest5.1.2.patch | 197 ------------
3 files changed, 105 insertions(+), 273 deletions(-)
Copied: python-jedi/repos/community-any/0001-Jedi-understand-now-when-you-use-del-fixes-313.patch (from rev 600149, python-jedi/trunk/0001-Jedi-understand-now-when-you-use-del-fixes-313.patch)
===================================================================
--- 0001-Jedi-understand-now-when-you-use-del-fixes-313.patch (rev 0)
+++ 0001-Jedi-understand-now-when-you-use-del-fixes-313.patch 2020-03-17 11:17:51 UTC (rev 600150)
@@ -0,0 +1,46 @@
+From bec87f7ff82b0731713c6520a14c213341b4cecf Mon Sep 17 00:00:00 2001
+From: Dave Halter <davidhalter88 at gmail.com>
+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 b4006817..3ff919ca 100644
+--- a/test/completion/basic.py
++++ b/test/completion/basic.py
+@@ -209,11 +209,11 @@ if r:
+
+ 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 4fdb861b..6858b6ca 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):
+--
+2.25.1
+
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2020-03-17 11:17:32 UTC (rev 600149)
+++ PKGBUILD 2020-03-17 11:17:51 UTC (rev 600150)
@@ -1,76 +0,0 @@
-# Maintainer: Jelle van der Waa <jelle at archlinux.org>
-# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
-# Contributor: Danilo Bargen <gezuru at gmail.com>
-# Contributor: Simon Conseil <contact+aur at saimon dot org>
-# Contributor: Jesus Alvarez
-
-pkgbase=python-jedi
-pkgname=('python2-jedi' 'python-jedi')
-_gitcommit=005f69390c4b1a3b864e7373cfcbdaf95e65411d
-pkgver=0.15.1
-pkgrel=2
-pkgdesc="Awesome autocompletion for python"
-url="https://github.com/davidhalter/jedi"
-arch=('any')
-license=('MIT')
-makedepends=('git' 'python2-setuptools' 'python-setuptools')
-checkdepends=('python-pytest' 'python2-pytest' 'python-parso' 'python2-parso')
-source=("git+https://github.com/davidhalter/jedi#commit=${_gitcommit}"
- git+https://github.com/davidhalter/typeshed
- jedi-fix-pytest5.1.2.patch)
-sha256sums=('SKIP'
- 'SKIP'
- 'a02b616a3cdd178de894abb6212f6ce86432915dc5c12cd156da043433e6b153')
-
-pkgver() {
- cd jedi
- git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
-}
-
-prepare() {
- (cd jedi
- git submodule init
- git config submodule."jedi/third_party/typeshed".url "${srcdir}/typeshed"
- git submodule update --recursive
- patch -Np1 < ../jedi-fix-pytest5.1.2.patch
- )
- cp -a jedi{,-py2}
-}
-
-build() {
- (cd jedi
- python setup.py build
- )
- (cd jedi-py2
- python2 setup.py build
- )
-}
-
-check() {
- (cd jedi
- pytest test
- )
- (cd jedi-py2
- pytest2 test
- )
-}
-
-package_python-jedi() {
- pkgdesc="Awesome autocompletion for python"
- depends=('python' 'python-parso')
- cd jedi
- python setup.py install --root="$pkgdir" --optimize=1 --skip-build
- install -Dm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
- install -Dm 644 CHANGELOG.rst README.rst -t "$pkgdir/usr/share/doc/$pkgname"
-}
-
-package_python2-jedi() {
- pkgdesc="Awesome autocompletion for python2"
- depends=('python2' 'python2-parso')
- cd jedi-py2
- python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
- install -Dm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
- install -Dm 644 CHANGELOG.rst README.rst -t "$pkgdir/usr/share/doc/$pkgname"
-}
-
-# vim: ts=2 sw=2 et:
Copied: python-jedi/repos/community-any/PKGBUILD (from rev 600149, python-jedi/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2020-03-17 11:17:51 UTC (rev 600150)
@@ -0,0 +1,59 @@
+# Maintainer: Jelle van der Waa <jelle at archlinux.org>
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+# Contributor: Danilo Bargen <gezuru at gmail.com>
+# Contributor: Simon Conseil <contact+aur at saimon dot org>
+# Contributor: Jesus Alvarez
+
+pkgname=python-jedi
+_gitcommit=18f84d3af73c0de04883c10ab8745d7efb16593b
+pkgver=0.16.0
+pkgrel=1
+pkgdesc="Awesome autocompletion for python"
+url="https://github.com/davidhalter/jedi"
+arch=('any')
+license=('MIT')
+depends=('python' 'python-parso')
+makedepends=('git' 'python-setuptools')
+checkdepends=('python-pytest' 'python-parso')
+source=("git+https://github.com/davidhalter/jedi#commit=${_gitcommit}"
+ git+https://github.com/davidhalter/typeshed
+ 0001-Jedi-understand-now-when-you-use-del-fixes-313.patch)
+sha256sums=('SKIP'
+ 'SKIP'
+ 'c8ac3df187d59eb8a9ea18290a829b4b23e16b131b5580a6677d208fe8726d81')
+
+pkgver() {
+ cd jedi
+ git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ (cd jedi
+ git submodule init
+ git config submodule."jedi/third_party/typeshed".url "${srcdir}/typeshed"
+ git submodule update --recursive
+
+ patch -Np1 -i ${srcdir}/0001-Jedi-understand-now-when-you-use-del-fixes-313.patch
+ )
+}
+
+build() {
+ (cd jedi
+ python setup.py build
+ )
+}
+
+check() {
+ (cd jedi
+ pytest test
+ )
+}
+
+package() {
+ cd jedi
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ install -Dm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
+ install -Dm 644 CHANGELOG.rst README.rst -t "$pkgdir/usr/share/doc/$pkgname"
+}
+
+# vim: ts=2 sw=2 et:
Deleted: jedi-fix-pytest5.1.2.patch
===================================================================
--- jedi-fix-pytest5.1.2.patch 2020-03-17 11:17:32 UTC (rev 600149)
+++ jedi-fix-pytest5.1.2.patch 2020-03-17 11:17:51 UTC (rev 600150)
@@ -1,197 +0,0 @@
-From f57a0b3469159954253b3be6d3147bc902095029 Mon Sep 17 00:00:00 2001
-From: Levente Polyak <levente at leventepolyak.net>
-Date: Fri, 20 Sep 2019 18:34:39 +0200
-Subject: [PATCH] fix static analysis test skips with latest pytest
-
-Latest pytest ensures pytest.skip is being called with a str parameter.
-However, test_static_analysis passed over the skip parameter which
-contains a tuple returned from skip_python_version leading to test
-regression.
-Unify the version skip reasons for both, static analysis and integration
-tests by using a shared BaseTestCase parent to avoid code duplication.
-Furthermore handle test_static_analysis skip_reason extraction
-orthogonal to test_completion.
----
- test/conftest.py | 42 +------------------------
- test/run.py | 67 ++++++++++++++++++++++++++++++++++------
- test/test_integration.py | 5 +--
- 3 files changed, 61 insertions(+), 53 deletions(-)
-
-diff --git a/test/conftest.py b/test/conftest.py
-index 45bb48e0..389c7c98 100644
---- a/test/conftest.py
-+++ b/test/conftest.py
-@@ -10,7 +10,6 @@ from . import refactor
-
- import jedi
- from jedi.api.environment import InterpreterEnvironment
--from jedi.evaluate.analysis import Warning
-
-
- def pytest_addoption(parser):
-@@ -85,46 +84,7 @@ def collect_static_analysis_tests(base_dir, test_files):
- files_to_execute = [a for a in test_files.items() if a[0] in f_name]
- if f_name.endswith(".py") and (not test_files or files_to_execute):
- path = os.path.join(base_dir, f_name)
-- yield StaticAnalysisCase(path)
--
--
--class StaticAnalysisCase(object):
-- """
-- Static Analysis cases lie in the static_analysis folder.
-- The tests also start with `#!`, like the goto_definition tests.
-- """
-- def __init__(self, path):
-- self._path = path
-- self.name = os.path.basename(path)
-- with open(path) as f:
-- self._source = f.read()
--
-- self.skip = False
-- for line in self._source.splitlines():
-- self.skip = self.skip or run.skip_python_version(line)
--
-- def collect_comparison(self):
-- cases = []
-- for line_nr, line in enumerate(self._source.splitlines(), 1):
-- match = re.match(r'(\s*)#! (\d+ )?(.*)$', line)
-- if match is not None:
-- column = int(match.group(2) or 0) + len(match.group(1))
-- cases.append((line_nr + 1, column, match.group(3)))
-- return cases
--
-- def run(self, compare_cb, environment):
-- analysis = jedi.Script(
-- self._source,
-- path=self._path,
-- environment=environment,
-- )._analysis()
-- typ_str = lambda inst: 'warning ' if isinstance(inst, Warning) else ''
-- analysis = [(r.line, r.column, typ_str(r) + r.name)
-- for r in analysis]
-- compare_cb(self, analysis, self.collect_comparison())
--
-- def __repr__(self):
-- return "<%s: %s>" % (self.__class__.__name__, os.path.basename(self._path))
-+ yield run.StaticAnalysisCase(path)
-
-
- @pytest.fixture(scope='session')
-diff --git a/test/run.py b/test/run.py
-index 9e87be27..a42549c6 100755
---- a/test/run.py
-+++ b/test/run.py
-@@ -127,6 +127,7 @@ from jedi.api.completion import get_user_scope
- from jedi import parser_utils
- from jedi.api.environment import get_default_environment, get_system_environment
- from jedi.evaluate.gradual.conversion import convert_contexts
-+from jedi.evaluate.analysis import Warning
-
-
- TEST_COMPLETIONS = 0
-@@ -138,16 +139,8 @@ TEST_USAGES = 3
- grammar36 = parso.load_grammar(version='3.6')
-
-
--class IntegrationTestCase(object):
-- def __init__(self, test_type, correct, line_nr, column, start, line,
-- path=None, skip_version_info=None):
-- self.test_type = test_type
-- self.correct = correct
-- self.line_nr = line_nr
-- self.column = column
-- self.start = start
-- self.line = line
-- self.path = path
-+class BaseTestCase(object):
-+ def __init__(self, skip_version_info=None):
- self._skip_version_info = skip_version_info
- self._skip = None
-
-@@ -175,6 +168,19 @@ class IntegrationTestCase(object):
- operator_, min_version[0], min_version[1]
- )
-
-+
-+class IntegrationTestCase(BaseTestCase):
-+ def __init__(self, test_type, correct, line_nr, column, start, line,
-+ path=None, skip_version_info=None):
-+ super(IntegrationTestCase, self).__init__(skip_version_info)
-+ self.test_type = test_type
-+ self.correct = correct
-+ self.line_nr = line_nr
-+ self.column = column
-+ self.start = start
-+ self.line = line
-+ self.path = path
-+
- @property
- def module_name(self):
- return os.path.splitext(os.path.basename(self.path))[0]
-@@ -277,6 +283,47 @@ class IntegrationTestCase(object):
- return compare_cb(self, compare, sorted(wanted))
-
-
-+class StaticAnalysisCase(BaseTestCase):
-+ """
-+ Static Analysis cases lie in the static_analysis folder.
-+ The tests also start with `#!`, like the goto_definition tests.
-+ """
-+ def __init__(self, path):
-+ self._path = path
-+ self.name = os.path.basename(path)
-+ with open(path) as f:
-+ self._source = f.read()
-+
-+ skip_version_info = None
-+ for line in self._source.splitlines():
-+ skip_version_info = skip_python_version(line) or skip_version_info
-+
-+ super(StaticAnalysisCase, self).__init__(skip_version_info)
-+
-+ def collect_comparison(self):
-+ cases = []
-+ for line_nr, line in enumerate(self._source.splitlines(), 1):
-+ match = re.match(r'(\s*)#! (\d+ )?(.*)$', line)
-+ if match is not None:
-+ column = int(match.group(2) or 0) + len(match.group(1))
-+ cases.append((line_nr + 1, column, match.group(3)))
-+ return cases
-+
-+ def run(self, compare_cb, environment):
-+ analysis = jedi.Script(
-+ self._source,
-+ path=self._path,
-+ environment=environment,
-+ )._analysis()
-+ typ_str = lambda inst: 'warning ' if isinstance(inst, Warning) else ''
-+ analysis = [(r.line, r.column, typ_str(r) + r.name)
-+ for r in analysis]
-+ compare_cb(self, analysis, self.collect_comparison())
-+
-+ def __repr__(self):
-+ return "<%s: %s>" % (self.__class__.__name__, os.path.basename(self._path))
-+
-+
- def skip_python_version(line):
- # check for python minimal version number
- match = re.match(r" *# *python *([<>]=?|==) *(\d+(?:\.\d+)?)$", line)
-diff --git a/test/test_integration.py b/test/test_integration.py
-index 04fbd48e..64239048 100644
---- a/test/test_integration.py
-+++ b/test/test_integration.py
-@@ -45,8 +45,9 @@ def test_completion(case, monkeypatch, environment, has_typing):
-
-
- def test_static_analysis(static_analysis_case, environment):
-- if static_analysis_case.skip is not None:
-- pytest.skip(static_analysis_case.skip)
-+ skip_reason = static_analysis_case.get_skip_reason(environment)
-+ if skip_reason is not None:
-+ pytest.skip(skip_reason)
- else:
- static_analysis_case.run(assert_static_analysis, environment)
-
---
-2.23.0
-
More information about the arch-commits
mailing list