1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
9 DESCRIPTION="Autocompletion library for Python"
10 HOMEPAGE="https://github.com/davidhalter/jedi"
11 SRC_URI="https://github.com/davidhalter/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15 KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 ~x86"
17 RESTRICT="!test? ( test )"
19 RDEPEND=">=dev-python/parso-0.3.1[${PYTHON_USEDEP}]"
21 dev-python/setuptools[${PYTHON_USEDEP}]
22 doc? ( dev-python/sphinx )
24 dev-python/pytest[${PYTHON_USEDEP}]
28 python_prepare_all() {
29 # speed tests are fragile
30 rm test/test_speed.py || die
32 # 'path' completion test does not account for 'path' being a valid
33 # package (i.e. dev-python/path-py)
34 # https://github.com/davidhalter/jedi/issues/1210
35 sed -i -e '/path.*not in/d' test/test_evaluate/test_imports.py || die
37 # no clue why it fails but we don't really care about .pyc files
38 # without sources anyway
39 rm test/test_evaluate/test_pyc.py || die
41 # our very useful patching changes libdir for no good reason
42 sed -i -e "/site_pkg_path/s:'lib':& if virtualenv.version_info >= (3,7) else '$(get_libdir)':" \
43 test/test_evaluate/test_sys_path.py || die
45 # this super-secret feature of py3.4 apparently doesn't work for us
46 sed -i -e 's:test_init_extension_module:_&:' \
47 test/test_evaluate/test_extension.py || die
49 distutils-r1_python_prepare_all
53 py.test -vv jedi test || die "Tests failed under ${EPYTHON}"
56 python_compile_all() {
57 use doc && emake -C docs html
60 python_install_all() {
61 use doc && HTML_DOCS=( "${S}"/docs/_build/html/. )
62 distutils-r1_python_install_all