blob: 0429627f07db692b3df61f13a359b91508c93cf4 (
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
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} )
inherit distutils-r1
DESCRIPTION="Proton Technologies API wrapper"
HOMEPAGE="https://github.com/ProtonVPN/python-proton-core/"
SRC_URI="https://github.com/ProtonVPN/python-proton-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/python-${P}"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="test? ( dev-python/pyotp[${PYTHON_USEDEP}] )"
RDEPEND="
dev-python/aiohttp[${PYTHON_USEDEP}]
dev-python/bcrypt[${PYTHON_USEDEP}]
dev-python/pyopenssl[${PYTHON_USEDEP}]
dev-python/python-gnupg[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
"
distutils_enable_sphinx docs
distutils_enable_tests pytest
src_prepare() {
distutils-r1_src_prepare
sed -i "/--cov/d" setup.cfg || die
}
python_test() {
# The following tests need network
EPYTEST_DESELECT=(
"tests/test_alternativerouting.py::TestAlternativeRouting::test_alternative_routing_works_on_prod"
"tests/test_autotransport.py::TestAuto::test_auto_works_on_prod"
"tests/test_protonsso.py::TestProtonSSO::test_broken_data"
"tests/test_protonsso.py::TestProtonSSO::test_broken_index"
"tests/test_protonsso.py::TestProtonSSO::test_sessions"
"tests/test_session.py::TestSession::test_ping"
"tests/test_session.py::TestSession::test_raw_ping"
"tests/test_tlsverification.py::TestTLSValidation::test_bad_pinning_fingerprint_changed"
"tests/test_tlsverification.py::TestTLSValidation::test_bad_pinning_url_changed"
"tests/test_tlsverification.py::TestTLSValidation::test_successful"
"tests/test_tlsverification.py::TestTLSValidation::test_without_pinning"
)
XDG_RUNTIME_DIR="${T}/python_test" epytest
}
|