dev-libs/leatherman: remove installing vendored boost library
[gentoo.git] / dev-python / mypy / mypy-0.760.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python3_{6,7,8} )
6
7 inherit distutils-r1
8
9 if [ "${PV}" == "9999" ]; then
10         inherit git-r3
11         EGIT_REPO_URI="https://github.com/python/${PN}"
12         SRC_URI=""
13 else
14         TYPESHED_COMMIT="a06abc5"
15         SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
16                         https://api.github.com/repos/python/typeshed/tarball/${TYPESHED_COMMIT} -> mypy-typeshed-${PV}-${TYPESHED_COMMIT}.tar.gz"
17 fi
18
19 DESCRIPTION="Optional static typing for Python"
20 HOMEPAGE="http://www.mypy-lang.org/"
21
22 LICENSE="MIT"
23 SLOT="0"
24 KEYWORDS="amd64 x86"
25 IUSE="doc test"
26
27 DEPEND="
28         dev-python/setuptools[${PYTHON_USEDEP}]
29         test? ( dev-python/flake8[${PYTHON_USEDEP}] )
30         doc? (
31                 dev-python/sphinx[${PYTHON_USEDEP}]
32                 dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
33         )
34 "
35 CDEPEND="
36         !dev-util/stubgen
37         >=dev-python/psutil-4[${PYTHON_USEDEP}]
38         >=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
39         <dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
40         >=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
41         >=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
42         <dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
43         "
44
45 RDEPEND="${CDEPEND}"
46
47 RESTRICT="!test? ( test )"
48
49 src_unpack() {
50         if [ "${PV}" == "9999" ]; then
51                 git-r3_src_unpack
52         else
53                 unpack ${A}
54                 rmdir "${S}/mypy/typeshed"
55                 mv "${WORKDIR}/python-typeshed-${TYPESHED_COMMIT}" "${S}/mypy/typeshed"
56         fi
57 }
58
59 python_compile_all() {
60         use doc && emake -C docs html
61 }
62
63 python_test() {
64         local PYTHONPATH="$(pwd)"
65
66         "${PYTHON}" runtests.py || die "tests failed under ${EPYTHON}"
67 }
68
69 python_install_all() {
70         use doc && local HTML_DOCS=( docs/build/html/. )
71
72         distutils-r1_python_install_all
73 }