dev-perl/Class-Inspector: amd64 stable
[gentoo.git] / dev-python / setuptools / setuptools-36.0.1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
6 PYTHON_REQ_USE="xml(+)"
7
8 inherit distutils-r1
9
10 if [[ ${PV} == "9999" ]]; then
11         EGIT_REPO_URI="https://github.com/pypa/setuptools.git"
12         inherit git-r3
13 else
14         SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
15         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 fi
17
18 DESCRIPTION="Collection of extensions to Distutils"
19 HOMEPAGE="https://github.com/pypa/setuptools https://pypi.python.org/pypi/setuptools"
20
21 LICENSE="MIT"
22 SLOT="0"
23 IUSE="test"
24
25 RDEPEND="
26 "
27 DEPEND="${RDEPEND}
28         app-arch/unzip
29         test? (
30                 dev-python/pip[${PYTHON_USEDEP}]
31                 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
32                 >=dev-python/backports-unittest-mock-1.2[${PYTHON_USEDEP}]
33         )
34 "
35 PDEPEND="
36         >=dev-python/certifi-2016.9.26[${PYTHON_USEDEP}]"
37
38 # Force in-source build because build system modifies sources.
39 DISTUTILS_IN_SOURCE_BUILD=1
40
41 DOCS=( {CHANGES,README}.rst docs/{easy_install.txt,pkg_resources.txt,setuptools.txt} )
42
43 python_prepare_all() {
44         if [[ ${PV} == "9999" ]]; then
45                 python_setup
46                 ${EPYTHON} bootstrap.py || die
47         fi
48
49         # disable tests requiring a network connection
50         rm setuptools/tests/test_packageindex.py || die
51
52         # don't run integration tests
53         rm setuptools/tests/test_integration.py || die
54
55         distutils-r1_python_prepare_all
56 }
57
58 python_test() {
59         # test_easy_install raises a SandboxViolation due to ${HOME}/.pydistutils.cfg
60         # It tries to sandbox the test in a tempdir
61         HOME="${PWD}" py.test --verbose ${PN} || die "Tests failed under ${EPYTHON}"
62 }
63
64 python_install() {
65         export DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT=1
66         distutils-r1_python_install
67 }