summaryrefslogtreecommitdiff
blob: 7fa754b6731a8cc0ad2b42c989fc87e7d2516728 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DISTUTILS_USE_SETUPTOOLS=rdepend
PYTHON_COMPAT=( python3_{8..10} )

inherit distutils-r1

MY_PV=${PV/_beta/b}
DESCRIPTION="Python Development Workflow for Humans"
HOMEPAGE="https://github.com/pypa/pipenv https://pypi.org/project/pipenv/"
SRC_URI="https://github.com/pypa/pipenv/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${MY_PV}

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="!test? ( test )"

PATCHES=(
	"${FILESDIR}/${PN}-${PV//./-}-remove-attr-vendor-import.patch"
	"${FILESDIR}/${PN}-${PV//./-}-remove-colorama-vendor-import.patch"
	)

RDEPEND="
	${PYTHON_DEPS}
	dev-python/attrs[${PYTHON_USEDEP}]
	dev-python/certifi[${PYTHON_USEDEP}]
	>=dev-python/colorama-0.4.4[${PYTHON_USEDEP}]
	>=dev-python/jinja-3.0.1[${PYTHON_USEDEP}]
	dev-python/pip[${PYTHON_USEDEP}]
	>=dev-python/virtualenv-20.0.35[${PYTHON_USEDEP}]
	dev-python/virtualenv-clone[${PYTHON_USEDEP}]
	>=dev-python/requests-2.26.0[${PYTHON_USEDEP}]
	>=dev-python/wheel-0.36.0[${PYTHON_USEDEP}]
"

BDEPEND="
	${RDEPEND}
	test? (
		dev-python/flaky[${PYTHON_USEDEP}]
		dev-python/mock[${PYTHON_USEDEP}]
		dev-python/pytest[${PYTHON_USEDEP}]
		dev-python/pytz[${PYTHON_USEDEP}]
	)
"

src_prepare() {
	# remove vendored versions
	# see https://bugs.gentoo.org/717666
	rm -vR "${S}/${PN}/vendor/attr/" || die
	rm -vR "${S}/${PN}/vendor/colorama/" || die
	rm -vR "${S}/${PN}/vendor/requests/" || die
	# not actually used by pipenv, but included in pipenv
	rm -vR "${S}/${PN}/vendor/jinja2/" || die
	rm -vR "${S}/${PN}/vendor/wheel/" || die
	distutils-r1_src_prepare
}

python_test() {
	pytest -vvv -x -m "not cli and not needs_internet" tests/unit/ || die
}