aboutsummaryrefslogtreecommitdiff
blob: dce4027d8e128a28a1123841349939ba644e7e84 (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
# Copyright 2021-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..12} )

inherit distutils-r1

DESCRIPTION="Python command line client for tldr pages"
HOMEPAGE="https://github.com/tldr-pages/tldr-python-client"
# sdist lacks some files.
SRC_URI="https://github.com/tldr-pages/tldr-python-client/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${PN}-python-client-${PV}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="man"

RDEPEND="
	dev-python/colorama[${PYTHON_USEDEP}]
	dev-python/shtab[${PYTHON_USEDEP}]
	dev-python/termcolor[${PYTHON_USEDEP}]
	!app-misc/tealdeer
"
BDEPEND="
	man? (
		dev-python/sphinx
		dev-python/sphinx-argparse
	)
"

distutils_enable_tests pytest

src_prepare() {
	use man || sed -i '/data_files/d' setup.py || die
	distutils-r1_src_prepare
}

src_compile() {
	emake -C docs
	distutils-r1_src_compile
}

python_test() {
	local EPYTEST_DESELECT=(
		# tries to access internet
		tests/test_tldr.py::test_error_message
	)
	epytest
}