summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Sautier <sbraz@gentoo.org>2020-09-17 14:26:40 +0200
committerLouis Sautier <sbraz@gentoo.org>2020-09-17 14:44:12 +0200
commit5648a406217ea18b214e681a9ec334f848301b09 (patch)
tree9922093dac8fe25563df40e35d0ff3f2aa66b851
parentdev-perl/Exception-Base: Cleanup old 0.250.100 (diff)
downloadgentoo-5648a406217ea18b214e681a9ec334f848301b09.tar.gz
gentoo-5648a406217ea18b214e681a9ec334f848301b09.tar.bz2
gentoo-5648a406217ea18b214e681a9ec334f848301b09.zip
dev-python/pycountry: bump to 20.7.3, add Python 3.9 support
Package-Manager: Portage-3.0.7, Repoman-3.0.1 Signed-off-by: Louis Sautier <sbraz@gentoo.org>
-rw-r--r--dev-python/pycountry/Manifest1
-rw-r--r--dev-python/pycountry/files/pycountry-20.7.3-fix-tests-for-pypy3.patch21
-rw-r--r--dev-python/pycountry/pycountry-20.7.3.ebuild35
3 files changed, 57 insertions, 0 deletions
diff --git a/dev-python/pycountry/Manifest b/dev-python/pycountry/Manifest
index 6dfcf9279b55..77a686674cb2 100644
--- a/dev-python/pycountry/Manifest
+++ b/dev-python/pycountry/Manifest
@@ -1 +1,2 @@
DIST pycountry-19.8.18.tar.gz 10003160 BLAKE2B ac7894e9fc1ed4e8f386cc6e07c1fc2abefee63c39c7c851c100519418606b52bc18be8da672930ceefdc7ca7b51571e4b3884ea0c20e547e5b596e249ebf407 SHA512 39ba06629eeea55460424d06992ca5f1e5bf6168b219dc4880ec326f6aa0c92a4fdc54d4143a8b8bb1490149af793e760e291c6d704104a57ba91e88228ab669
+DIST pycountry-20.7.3.tar.gz 10137217 BLAKE2B 2b32d450a1d16eab95e0c1ab6cae3bf89c07742d48cf6f8473854119ac0483b5490523e03e823c9b314231983f39d1c8bf595aac201756fee9897a8d15a84c08 SHA512 df88a34307a4275267a7f3af282b73ca5e762c49ad158bfcd39b97c5d852bf045bcfe72351fc6f232c55003a7c4b0a04801eb562ba65ed5d599bd45b2bd3bc58
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
new file mode 100644
index 000000000000..453c57f362cd
--- /dev/null
+++ b/dev-python/pycountry/files/pycountry-20.7.3-fix-tests-for-pypy3.patch
@@ -0,0 +1,21 @@
+commit 57a64b69704640bd85270d886c369ef5a31eee80
+Author: Louis Sautier <sautier.louis@gmail.com>
+Date: Thu Sep 17 13:01:07 2020 +0200
+
+ Do not rely on CPython-specific __builtins__ for tests
+
+ This makes test_locales pass with PyPy3.
+
+diff --git a/src/pycountry/tests/test_general.py b/src/pycountry/tests/test_general.py
+index ea697ae..ad1090f 100644
+--- a/src/pycountry/tests/test_general.py
++++ b/src/pycountry/tests/test_general.py
+@@ -149,7 +149,7 @@ def test_locales():
+ german = gettext.translation(
+ 'iso3166', pycountry.LOCALES_DIR, languages=['de'])
+ german.install()
+- assert __builtins__['_']('Germany') == 'Deutschland'
++ assert _('Germany') == 'Deutschland'
+
+
+ def test_removed_countries():
diff --git a/dev-python/pycountry/pycountry-20.7.3.ebuild b/dev-python/pycountry/pycountry-20.7.3.ebuild
new file mode 100644
index 000000000000..6ae5775ac033
--- /dev/null
+++ b/dev-python/pycountry/pycountry-20.7.3.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( pypy3 python3_{6,7,8,9} )
+# The package uses pkg_resources to determine its version
+DISTUTILS_USE_SETUPTOOLS=manual
+
+inherit distutils-r1
+
+DESCRIPTION="Database of countries, subdivisions, languages, currencies and script"
+HOMEPAGE="https://github.com/flyingcircusio/pycountry"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ia64 ~ppc ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+BDEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )
+"
+
+# https://github.com/flyingcircusio/pycountry/pull/51
+PATCHES=( "${FILESDIR}/${P}-fix-tests-for-pypy3.patch" )
+
+python_test() {
+ # The package uses pkg_resources to determine its version
+ distutils_install_for_testing
+ pytest -vv || die "Tests fail with ${EPYTHON}"
+}