dev-python/click-default-group: keyworded 1.2.2 for ia64, bug #700918
[gentoo.git] / dev-python / setuptools / setuptools-44.1.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 DISTUTILS_USE_SETUPTOOLS=no
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
7 PYTHON_REQ_USE="xml(+)"
8
9 inherit distutils-r1
10
11 if [[ ${PV} == "9999" ]]; then
12         EGIT_REPO_URI="https://github.com/pypa/setuptools.git"
13         inherit git-r3
14 else
15         SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
16         KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 fi
18
19 DESCRIPTION="Collection of extensions to Distutils"
20 HOMEPAGE="https://github.com/pypa/setuptools https://pypi.org/project/setuptools/"
21
22 LICENSE="MIT"
23 SLOT="0"
24 IUSE="test"
25 RESTRICT="!test? ( test )"
26
27 BDEPEND="
28         app-arch/unzip
29         test? (
30                 dev-python/mock[${PYTHON_USEDEP}]
31                 dev-python/pip[${PYTHON_USEDEP}]
32                 >=dev-python/pytest-3.7.0[${PYTHON_USEDEP}]
33                 dev-python/pytest-fixture-config[${PYTHON_USEDEP}]
34                 dev-python/pytest-virtualenv[${PYTHON_USEDEP}]
35                 dev-python/wheel[${PYTHON_USEDEP}]
36                 $(python_gen_cond_dep '
37                         dev-python/futures[${PYTHON_USEDEP}]
38                 ' -2)
39         )
40 "
41 PDEPEND="
42         >=dev-python/certifi-2016.9.26[${PYTHON_USEDEP}]"
43
44 # Force in-source build because build system modifies sources.
45 DISTUTILS_IN_SOURCE_BUILD=1
46
47 DOCS=( {CHANGES,README}.rst docs/{easy_install.txt,pkg_resources.txt,setuptools.txt} )
48
49 PATCHES=(
50         # fix regression introduced by reinventing deprecated 'imp'
51         # https://github.com/pypa/setuptools/pull/1905
52         "${FILESDIR}"/setuptools-42.0.0-imp-fix.patch
53 )
54
55 python_prepare_all() {
56         if [[ ${PV} == "9999" ]]; then
57                 python_setup
58                 ${EPYTHON} bootstrap.py || die
59         fi
60
61         # disable tests requiring a network connection
62         rm setuptools/tests/test_packageindex.py || die
63
64         # don't run integration tests
65         rm setuptools/tests/test_integration.py || die
66
67         distutils-r1_python_prepare_all
68 }
69
70 python_test() {
71         # test_easy_install raises a SandboxViolation due to ${HOME}/.pydistutils.cfg
72         # It tries to sandbox the test in a tempdir
73         HOME="${PWD}" pytest -vv ${PN} || die "Tests failed under ${EPYTHON}"
74 }
75
76 python_install() {
77         export DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT=1
78         distutils-r1_python_install
79 }