summaryrefslogtreecommitdiff
blob: 67e2ca1a19befe4ee2ef0665d12ac6a29f828843 (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
66
67
68
69
70
71
72
73
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{7,8} )

inherit distutils-r1 virtualx

DESCRIPTION="Python screenshot library"
HOMEPAGE="https://github.com/ponty/pyscreenshot"
SRC_URI="https://github.com/ponty/pyscreenshot/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 x86"

BDEPEND="test? (
	dev-python/path-py[${PYTHON_USEDEP}]
	dev-python/pillow[${PYTHON_USEDEP}]
	dev-python/python-xlib[${PYTHON_USEDEP}]
	dev-python/pyvirtualdisplay[${PYTHON_USEDEP}]
	media-gfx/pqiv
)"

DEPEND="
	dev-python/easyprocess[${PYTHON_USEDEP}]
	dev-python/entrypoint2[${PYTHON_USEDEP}]
	dev-python/jeepney[${PYTHON_USEDEP}]
	dev-python/mss[${PYTHON_USEDEP}]
"

distutils_enable_tests pytest

python_prepare_all() {
	# easyprocess.EasyProcessError: start error fails inside emerge env
	sed -i -e 's:test_default:_&:' \
			tests/test_default.py || die

	# AssertionError
	sed -i -e 's:test_imagemagick:_&:' \
			tests/test_imagemagick.py || die

	# Needs access to dbus
	sed -i -e 's:test_kwin_dbus:_&:' \
			tests/test_kwin_dbus.py || die

	# AssertionError
	sed -i -e 's:test_mss:_&:' \
			tests/test_mss.py || die

	# AssertionError
	sed -i -e 's:test_pygdk3:_&:' \
			tests/test_pygdk3.py || die

	# AssertionError
	sed -i -e 's:test_pyqt5:_&:' \
			tests/test_pyqt5.py || die

	# AssertionError
	sed -i -e 's:test_qtpy:_&:' \
			tests/test_qtpy.py || die

	# AssertionError
	sed -i -e 's:test_scrot:_&:' \
			tests/test_scrot.py || die

	distutils-r1_python_prepare_all
}

python_test() {
	virtx pytest -vv
}