Gentoo Archives: gentoo-commits

From: Louis Sautier <sbraz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pycountry/files/, dev-python/pycountry/
Date: Thu, 17 Sep 2020 12:44:41
Message-Id: 1600346652.5648a406217ea18b214e681a9ec334f848301b09.sbraz@gentoo
1 commit: 5648a406217ea18b214e681a9ec334f848301b09
2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 17 12:26:40 2020 +0000
4 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 17 12:44:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5648a406
7
8 dev-python/pycountry: bump to 20.7.3, add Python 3.9 support
9
10 Package-Manager: Portage-3.0.7, Repoman-3.0.1
11 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
12
13 dev-python/pycountry/Manifest | 1 +
14 .../pycountry-20.7.3-fix-tests-for-pypy3.patch | 21 +++++++++++++
15 dev-python/pycountry/pycountry-20.7.3.ebuild | 35 ++++++++++++++++++++++
16 3 files changed, 57 insertions(+)
17
18 diff --git a/dev-python/pycountry/Manifest b/dev-python/pycountry/Manifest
19 index 6dfcf9279b5..77a686674cb 100644
20 --- a/dev-python/pycountry/Manifest
21 +++ b/dev-python/pycountry/Manifest
22 @@ -1 +1,2 @@
23 DIST pycountry-19.8.18.tar.gz 10003160 BLAKE2B ac7894e9fc1ed4e8f386cc6e07c1fc2abefee63c39c7c851c100519418606b52bc18be8da672930ceefdc7ca7b51571e4b3884ea0c20e547e5b596e249ebf407 SHA512 39ba06629eeea55460424d06992ca5f1e5bf6168b219dc4880ec326f6aa0c92a4fdc54d4143a8b8bb1490149af793e760e291c6d704104a57ba91e88228ab669
24 +DIST pycountry-20.7.3.tar.gz 10137217 BLAKE2B 2b32d450a1d16eab95e0c1ab6cae3bf89c07742d48cf6f8473854119ac0483b5490523e03e823c9b314231983f39d1c8bf595aac201756fee9897a8d15a84c08 SHA512 df88a34307a4275267a7f3af282b73ca5e762c49ad158bfcd39b97c5d852bf045bcfe72351fc6f232c55003a7c4b0a04801eb562ba65ed5d599bd45b2bd3bc58
25
26 diff --git a/dev-python/pycountry/files/pycountry-20.7.3-fix-tests-for-pypy3.patch b/dev-python/pycountry/files/pycountry-20.7.3-fix-tests-for-pypy3.patch
27 new file mode 100644
28 index 00000000000..453c57f362c
29 --- /dev/null
30 +++ b/dev-python/pycountry/files/pycountry-20.7.3-fix-tests-for-pypy3.patch
31 @@ -0,0 +1,21 @@
32 +commit 57a64b69704640bd85270d886c369ef5a31eee80
33 +Author: Louis Sautier <sautier.louis@×××××.com>
34 +Date: Thu Sep 17 13:01:07 2020 +0200
35 +
36 + Do not rely on CPython-specific __builtins__ for tests
37 +
38 + This makes test_locales pass with PyPy3.
39 +
40 +diff --git a/src/pycountry/tests/test_general.py b/src/pycountry/tests/test_general.py
41 +index ea697ae..ad1090f 100644
42 +--- a/src/pycountry/tests/test_general.py
43 ++++ b/src/pycountry/tests/test_general.py
44 +@@ -149,7 +149,7 @@ def test_locales():
45 + german = gettext.translation(
46 + 'iso3166', pycountry.LOCALES_DIR, languages=['de'])
47 + german.install()
48 +- assert __builtins__['_']('Germany') == 'Deutschland'
49 ++ assert _('Germany') == 'Deutschland'
50 +
51 +
52 + def test_removed_countries():
53
54 diff --git a/dev-python/pycountry/pycountry-20.7.3.ebuild b/dev-python/pycountry/pycountry-20.7.3.ebuild
55 new file mode 100644
56 index 00000000000..6ae5775ac03
57 --- /dev/null
58 +++ b/dev-python/pycountry/pycountry-20.7.3.ebuild
59 @@ -0,0 +1,35 @@
60 +# Copyright 1999-2020 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=7
64 +
65 +PYTHON_COMPAT=( pypy3 python3_{6,7,8,9} )
66 +# The package uses pkg_resources to determine its version
67 +DISTUTILS_USE_SETUPTOOLS=manual
68 +
69 +inherit distutils-r1
70 +
71 +DESCRIPTION="Database of countries, subdivisions, languages, currencies and script"
72 +HOMEPAGE="https://github.com/flyingcircusio/pycountry"
73 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
74 +
75 +LICENSE="LGPL-2.1"
76 +SLOT="0"
77 +KEYWORDS="~amd64 ~arm64 ~ia64 ~ppc ~sparc ~x86"
78 +IUSE="test"
79 +RESTRICT="!test? ( test )"
80 +
81 +RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
82 +BDEPEND="
83 + dev-python/setuptools[${PYTHON_USEDEP}]
84 + test? ( dev-python/pytest[${PYTHON_USEDEP}] )
85 +"
86 +
87 +# https://github.com/flyingcircusio/pycountry/pull/51
88 +PATCHES=( "${FILESDIR}/${P}-fix-tests-for-pypy3.patch" )
89 +
90 +python_test() {
91 + # The package uses pkg_resources to determine its version
92 + distutils_install_for_testing
93 + pytest -vv || die "Tests fail with ${EPYTHON}"
94 +}