diff options
author | Patrick McLean <patrick.mclean@sony.com> | 2019-12-02 16:54:27 -0800 |
---|---|---|
committer | Patrick McLean <chutzpah@gentoo.org> | 2019-12-02 16:54:27 -0800 |
commit | 825d5b2157072fadf14ddccf0bf86cfa51e74254 (patch) | |
tree | 6f9bc273257f234ad374a46d0ddf92b5310c3e8c /dev-python | |
parent | dev-python/parso-0.5.1-r1: revbump, port to new helpers, py38, pypy{,3} (diff) | |
download | gentoo-825d5b2157072fadf14ddccf0bf86cfa51e74254.tar.gz gentoo-825d5b2157072fadf14ddccf0bf86cfa51e74254.tar.bz2 gentoo-825d5b2157072fadf14ddccf0bf86cfa51e74254.zip |
dev-python/jedi-0.15.1: Version bump, add py38
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.80, Repoman-2.3.19
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/jedi/Manifest | 2 | ||||
-rw-r--r-- | dev-python/jedi/files/jedi-0.15.1-tests.patch | 94 | ||||
-rw-r--r-- | dev-python/jedi/jedi-0.15.1.ebuild | 68 |
3 files changed, 164 insertions, 0 deletions
diff --git a/dev-python/jedi/Manifest b/dev-python/jedi/Manifest index cf317547cbe0..4960101dd427 100644 --- a/dev-python/jedi/Manifest +++ b/dev-python/jedi/Manifest @@ -2,3 +2,5 @@ DIST jedi-0.10.2.tar.gz 373879 BLAKE2B 8007b31dc6c96d9538ab141b976fd4554ea16f01b DIST jedi-0.11.1.tar.gz 332402 BLAKE2B bc0a8df89c3d8b6cccc387a22cc08f613c990c59e360c58ae1d2becf521a755892afa4972195f6e40ec3bb48b74b20a966034d0e5bcad5051f90e5b4cc082270 SHA512 61389704a318f89d12b053b786bfb6bda21d2696830c001d6d6e66191fc060d731bc05ea71f2e70725532dcbe109c5c7346a36d227e6f8ab0eb2512f4c1a8945 DIST jedi-0.12.0.tar.gz 354329 BLAKE2B ef203f2ba57a90de1e16b80c8786fa25d6d459244873dfb22044aa6d080435efa976daeb80949c3fba41ca2f57feb5bfed255b3bb490e17b40b3f13dfbb31e14 SHA512 3e8280b16855cf2c891666f0fb02ac30d801279b72b5bcb64541ef7c152d9f9b165015405ee291cbccd6c9cb3c0481c24f30e6100cb4463888153021b946f16d DIST jedi-0.12.1.tar.gz 356736 BLAKE2B 515cbc27e065c24fb2cebae5a3807d2e025f22110f3de60d26a74475eadc985bb32bea60b691c580473fffe2fdfc86705187dea1fb730ef3f510b7bdb52e0d59 SHA512 92f9ac34abf908a8143dff360400dd8d6643dc3502bb7973f92bd05db94c2af151c2063f2de0481a14e26d11c009cc39c46189e1ea31d274b80802e3a10cd665 +DIST jedi-0.15.1.tar.gz 412356 BLAKE2B a7738e8825b3f578db5e64d50cbf65219b4d2f2f81c45cbae9e3dbb858b0e1ef26d76972c112bfae839daaf73bba0d00b30b5708404d16b0385452500a1c2d35 SHA512 0f6e0185f3f10dbc000f09ddfed7b9596fe5dc270682544173dc156d505618ea14f1f44ede5d2357745ab8ded0b15b2788d064ca4db39fe70196982dd0a16893 +DIST typeshed-jedi_v0.15.0.tar.gz 466890 BLAKE2B 7c4956c60646ecb7f21704e3ce95cd38a44e40849e4efba352a0be11c4511fc28d77f32308a3f136cd72833f937f802194ae57f1cdf1d53ae7824ebe4f4bc323 SHA512 46250822eb4aa20203db9b99626e33f2b60ec77072e20dbd94219d782cf204e2cc5a94579b1753c634f931445ad4ef9f0bd7ccfed287d86bca96b945d2eb27c1 diff --git a/dev-python/jedi/files/jedi-0.15.1-tests.patch b/dev-python/jedi/files/jedi-0.15.1-tests.patch new file mode 100644 index 000000000000..cdc59053df03 --- /dev/null +++ b/dev-python/jedi/files/jedi-0.15.1-tests.patch @@ -0,0 +1,94 @@ +diff --git a/test/test_api/test_completion.py b/test/test_api/test_completion.py +index 178daee9..0c86f837 100644 +--- a/test/test_api/test_completion.py ++++ b/test/test_api/test_completion.py +@@ -1,4 +1,5 @@ +-from os.path import join, sep as s ++from os.path import join, sep as s, dirname ++import os + import sys + from textwrap import dedent + +@@ -164,6 +165,7 @@ f2 = join(root_dir, 'test', 'example.py') + os_path = 'from os.path import *\n' + # os.path.sep escaped + se = s * 2 if s == '\\' else s ++current_dirname = os.path.basename(dirname(dirname(dirname(__file__)))) + + + @pytest.mark.parametrize( +@@ -181,7 +183,7 @@ se = s * 2 if s == '\\' else s + ('test%sexample.py' % se, 'r"test%scomp"' % s, 5, ['t' + s]), + ('test%sexample.py' % se, 'r"test%scomp"' % s, 11, ['letion' + s]), + ('test%sexample.py' % se, '"%s"' % join('test', 'completion', 'basi'), 21, ['c.py']), +- ('example.py', 'rb"' + join('..', 'jedi', 'tes'), None, ['t' + s]), ++ ('example.py', 'rb"'+ join('..', current_dirname, 'tes'), None, ['t' + s]), + + # Absolute paths + (None, '"' + join(root_dir, 'test', 'test_ca'), None, ['che.py"']), +diff --git a/test/test_evaluate/test_signature.py b/test/test_evaluate/test_signature.py +index 0bb5cbae..2fda3d55 100644 +--- a/test/test_evaluate/test_signature.py ++++ b/test/test_evaluate/test_signature.py +@@ -16,7 +16,7 @@ from jedi.evaluate.gradual.conversion import _stub_to_python_context_set + ('str', "str(object='', /) -> str", ['object'], ge, (2, 7)), + + ('pow', 'pow(x, y, z=None, /) -> number', ['x', 'y', 'z'], lt, (3, 5)), +- ('pow', 'pow(x, y, z=None, /)', ['x', 'y', 'z'], ge, (3, 5)), ++ ('pow', 'pow(base, exp, mod=None)', ['base', 'exp', 'mod'], ge, (3, 8)), + + ('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)', ['self', 'sep'], lt, (3, 5)), + ('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 5)), +diff --git a/test/test_evaluate/test_sys_path.py b/test/test_evaluate/test_sys_path.py +index deaa64ca..fdee2ece 100644 +--- a/test/test_evaluate/test_sys_path.py ++++ b/test/test_evaluate/test_sys_path.py +@@ -1,7 +1,9 @@ + import os ++import os.path + from glob import glob + import sys + import shutil ++import distutils.sysconfig + + import pytest + from ..helpers import skip_if_windows, skip_if_not_windows +@@ -33,12 +35,10 @@ def test_venv_and_pths(venv_path): + pjoin = os.path.join + + CUR_DIR = os.path.dirname(__file__) +- site_pkg_path = pjoin(venv_path, 'lib') +- if os.name == 'nt': +- site_pkg_path = pjoin(site_pkg_path, 'site-packages') +- else: +- site_pkg_path = glob(pjoin(site_pkg_path, 'python*', 'site-packages'))[0] +- shutil.rmtree(site_pkg_path) ++ site_pkg_path = pjoin(venv_path, ++ distutils.sysconfig.get_python_lib().lstrip(distutils.sysconfig.BASE_PREFIX)) ++ if os.path.exists(site_pkg_path): ++ shutil.rmtree(site_pkg_path) + shutil.copytree(pjoin(CUR_DIR, 'sample_venvs', 'pth_directory'), site_pkg_path) + + virtualenv = create_environment(venv_path) +diff --git a/test/test_utils.py b/test/test_utils.py +index 17328a36..71217086 100644 +--- a/test/test_utils.py ++++ b/test/test_utils.py +@@ -77,10 +77,14 @@ class TestSetupReadline(unittest.TestCase): + # There are minor differences, e.g. the dir doesn't include deleted + # items as well as items that are not only available on linux. + difference = set(self.completions(s)).symmetric_difference(goal) +- difference = {x for x in difference if not x.startswith('from os import _')} ++ difference = { ++ x for x in difference ++ if all(not x.startswith('from os import ' + s) ++ for s in ['_', 'O_', 'EX_', 'MFD_', 'SF_']) ++ } + # There are quite a few differences, because both Windows and Linux +- # (posix and nt) libraries are included. +- assert len(difference) < 38 ++ # (posix and nt) librariesare included. ++ assert len(difference) < 22 + + @cwd_at('test') + def test_local_import(self): diff --git a/dev-python/jedi/jedi-0.15.1.ebuild b/dev-python/jedi/jedi-0.15.1.ebuild new file mode 100644 index 000000000000..417f98aaef73 --- /dev/null +++ b/dev-python/jedi/jedi-0.15.1.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} ) + +inherit distutils-r1 + +TYPESHED_PV="$(ver_cut 1-2).0" +TYPESHED_P="typeshed-jedi_v${TYPESHED_PV}" + +DESCRIPTION="Autocompletion library for Python" +HOMEPAGE="https://github.com/davidhalter/jedi" +SRC_URI="https://github.com/davidhalter/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/davidhalter/typeshed/archive/${TYPESHED_P#typeshed-}.tar.gz -> ${TYPESHED_P}.tar.gz" + +LICENSE="MIT + test? ( Apache-2.0 )" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" +IUSE="test" + +RDEPEND=">=dev-python/parso-0.5.0[${PYTHON_USEDEP}]" +BDEPEND="${RDEPEND} + dev-python/setuptools[${PYTHON_USEDEP}] +" + +RESTRICT+=" !test? ( test )" + +PATCHES=( + # mostly pulled from upstream git, except the patch for + # test/test_evaluate/test_sys_path.py + "${FILESDIR}/jedi-0.15.1-tests.patch" +) + +distutils_enable_sphinx docs +distutils_enable_tests pytest + +python_prepare_all() { + # upstream includes this as a submodule ... + rmdir "${S}/jedi/third_party/typeshed" || die + mv "${WORKDIR}/${TYPESHED_P}" \ + "${S}/jedi/third_party/typeshed" || die + + # don't run doctests, don't depend on colorama + sed -i "s:'docopt',:: ; s:'colorama',::" setup.py || die + sed -i "s: --doctest-modules::" pytest.ini || die + + # speed tests are fragile + rm test/test_speed.py || die + + # 'path' completion test does not account for 'path' being a valid + # package (i.e. dev-python/path-py) + # https://github.com/davidhalter/jedi/issues/1210 + sed -i -e '/path.*not in/d' test/test_evaluate/test_imports.py || die + + distutils-r1_python_prepare_all +} + +python_test() { + # at this point fixing tests on python2 isn't worth the effort... + if ! python_is_python3; then + ewarn "Skipping tests for ${EPYTHON}" + return 0 + fi + + pytest -vv || die "Tests fail with ${EPYTHON}" +} |