From 5e90c0ac0f421d3163faab593c367cce6b4602cb Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Sat, 25 Apr 2020 00:44:15 +0200 Subject: [PATCH] dev-python/ukpostcodeparser: new package Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Alessandro Barbieri --- dev-python/ukpostcodeparser/Manifest | 1 + .../files/ukpostcodeparser-1.1.2-test.patch | 70 +++++++++++++++++++ dev-python/ukpostcodeparser/metadata.xml | 15 ++++ .../ukpostcodeparser-1.1.2.ebuild | 30 ++++++++ 4 files changed, 116 insertions(+) create mode 100644 dev-python/ukpostcodeparser/Manifest create mode 100644 dev-python/ukpostcodeparser/files/ukpostcodeparser-1.1.2-test.patch create mode 100644 dev-python/ukpostcodeparser/metadata.xml create mode 100644 dev-python/ukpostcodeparser/ukpostcodeparser-1.1.2.ebuild diff --git a/dev-python/ukpostcodeparser/Manifest b/dev-python/ukpostcodeparser/Manifest new file mode 100644 index 0000000000..12535d75fa --- /dev/null +++ b/dev-python/ukpostcodeparser/Manifest @@ -0,0 +1 @@ +DIST ukpostcodeparser-1.1.2.tar.gz 5585 BLAKE2B c95f215f0e4b222b85ec3ab0a8d82186845d9cb161098240411a425094ada391bb6c891904293cca4a56e9370217829b51ba30e91824dd3d762279baef6c65f7 SHA512 8113522b728c095f937a9f53f21c369130e3e63c4fc3546dbea4ad1c53648742fb0e766b1254c76ee65d69dec585f1a90caa7d39ca540de1765ff5f989a702de diff --git a/dev-python/ukpostcodeparser/files/ukpostcodeparser-1.1.2-test.patch b/dev-python/ukpostcodeparser/files/ukpostcodeparser-1.1.2-test.patch new file mode 100644 index 0000000000..fd08a559d3 --- /dev/null +++ b/dev-python/ukpostcodeparser/files/ukpostcodeparser-1.1.2-test.patch @@ -0,0 +1,70 @@ +--- ../ukpostcodeparser/test/parser.py 2018-12-19 17:55:53.435338634 +0200 ++++ ../ukpostcodeparser/test/parser.py 2018-12-19 17:56:54.075385419 +0200 +@@ -796,14 +796,6 @@ + expected=InvalidPostcodeError + ) + +- def test_091(self): +- self.run_parser( +- postcode='w1m 4zz', +- strict=True, +- incode_mandatory=False, +- expected=InvalidPostcodeError +- ) +- + def test_092(self): + self.run_parser( + postcode='3r0', +@@ -844,22 +836,6 @@ + expected=('GIR', '') + ) + +- def test_097(self): +- self.run_parser( +- postcode='w1m 4zz', +- strict=True, +- incode_mandatory=False, +- expected=InvalidPostcodeError +- ) +- +- def test_098(self): +- self.run_parser( +- postcode='w1m', +- strict=True, +- incode_mandatory=False, +- expected=InvalidPostcodeError +- ) +- + def test_099(self): + self.run_parser( + postcode='dn169aaA', +@@ -1068,14 +1044,6 @@ + expected=InvalidPostcodeError + ) + +- def test_125(self): +- self.run_parser( +- postcode='w1m 4zz', +- strict=True, +- incode_mandatory=True, +- expected=InvalidPostcodeError +- ) +- + def test_126(self): + self.run_parser( + postcode='3r0', +@@ -1116,14 +1084,6 @@ + expected=IncodeNotFoundError + ) + +- def test_131(self): +- self.run_parser( +- postcode='w1m 4zz', +- strict=True, +- incode_mandatory=True, +- expected=InvalidPostcodeError +- ) +- + def test_132(self): + self.run_parser( + postcode='w1m', diff --git a/dev-python/ukpostcodeparser/metadata.xml b/dev-python/ukpostcodeparser/metadata.xml new file mode 100644 index 0000000000..f34e585a34 --- /dev/null +++ b/dev-python/ukpostcodeparser/metadata.xml @@ -0,0 +1,15 @@ + + + + + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + UK Postcode parser + + + hamstah/ukpostcodeparser + UkPostcodeParser + + diff --git a/dev-python/ukpostcodeparser/ukpostcodeparser-1.1.2.ebuild b/dev-python/ukpostcodeparser/ukpostcodeparser-1.1.2.ebuild new file mode 100644 index 0000000000..0469203e9e --- /dev/null +++ b/dev-python/ukpostcodeparser/ukpostcodeparser-1.1.2.ebuild @@ -0,0 +1,30 @@ +# 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} ) + +inherit distutils-r1 + +DESCRIPTION="UK postcode parser library" +HOMEPAGE="https://github.com/hamstah/ukpostcodeparser" +SRC_URI="https://github.com/hamstah/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +# https://github.com/hamstah/ukpostcodeparser/issues/8 +PATCHES=( "${FILESDIR}/${P}-test.patch" ) + +python_test() { + "${PYTHON}" -m unittest discover -v -s ukpostcodeparser/test -p parser.py || die "tests failed with ${EPYTHON}" +} + +python_install_all() { + distutils-r1_python_install_all + find "${ED}" -type d -name "test" -exec rm -rv {} + || die "tests removing failed" +}