*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / dev-python / jedi / jedi-0.12.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
6
7 inherit distutils-r1
8
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"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 ~x86"
16 IUSE="doc test"
17 RESTRICT="!test? ( test )"
18
19 RDEPEND=">=dev-python/parso-0.3.1[${PYTHON_USEDEP}]"
20 DEPEND="
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         doc? ( dev-python/sphinx )
23         test? (
24                 dev-python/pytest[${PYTHON_USEDEP}]
25                 ${RDEPEND}
26         )"
27
28 python_prepare_all() {
29         # speed tests are fragile
30         rm test/test_speed.py || die
31
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
36
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
40
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
44
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
48
49         distutils-r1_python_prepare_all
50 }
51
52 python_test() {
53         py.test -vv jedi test || die "Tests failed under ${EPYTHON}"
54 }
55
56 python_compile_all() {
57         use doc && emake -C docs html
58 }
59
60 python_install_all() {
61         use doc && HTML_DOCS=( "${S}"/docs/_build/html/. )
62         distutils-r1_python_install_all
63 }