pycountry: FTBFS: dh_auto_test: error: pybuild --test -i python{version} -p 3.9 returned exit code 13
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pycountry (Debian) |
Fix Released
|
Unknown
|
|||
pycountry (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Imported from Debian bug http://
Source: pycountry
Version: 20.7.3+ds1-1
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: <email address hidden>
Usertags: ftbfs-20211104 ftbfs-bookworm
Hi,
During a rebuild of all packages in sid, your package failed to build
on amd64.
Relevant part (hopefully):
> debian/rules binary
> dh binary --with python3 --buildsystem=
> dh_update_
> dh_autoreconf -O--buildsystem
> dh_auto_configure -O--buildsystem
> I: pybuild base:232: python3.9 setup.py config
> running config
> dh_auto_build -O--buildsystem
> I: pybuild base:232: /usr/bin/python3 setup.py build
> running build
> running build_py
> creating /<<PKGBUILDDIR>
> copying src/pycountry/
> copying src/pycountry/db.py -> /<<PKGBUILDDIR>
> running egg_info
> creating src/pycountry.
> writing src/pycountry.
> writing dependency_links to src/pycountry.
> writing top-level names to src/pycountry.
> writing manifest file 'src/pycountry.
> reading manifest file 'src/pycountry.
> reading manifest template 'MANIFEST.in'
> warning: no previously-included files matching '*.py[co]' found anywhere in distribution
> adding license file 'LICENSE.txt'
> writing manifest file 'src/pycountry.
> creating /<<PKGBUILDDIR>
> copying src/pycountry/
> dh_auto_test -O--buildsystem
> I: pybuild base:232: cd /<<PKGBUILDDIR>
> =======
> platform linux -- Python 3.9.7, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
> rootdir: /<<PKGBUILDDIR>>
> collected 20 items
>
> ../../.
>
> =======
> _______
>
> def test_country_
> > results = pycountry.
>
> ../../.
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <pycountry.
>
> def search_fuzzy(self, query):
> query = remove_
>
> # A country-code to points mapping for later sorting countries
> # based on the query's matching incidence.
> results = {}
>
> def add_result(country, points):
> results.
> results[
>
> # Prio 1: exact matches on country names
> try:
> add_result(
> except LookupError:
> pass
>
> # Prio 2: exact matches on subdivision names
> for candidate in subdivisions:
> for v in candidate.
> if v is None:
> continue
> v = remove_
> # Some names include alternative versions which we want to
> # match exactly.
> for v in v.split(';'):
> if v == query:
> add_result(
> break
>
> # Prio 3: partial matches on country names
> for candidate in self:
> # Higher priority for a match on the common name
> for v in [candidate.
> candidate.
> candidate.
> if v is None:
> continue
> v = remove_
> if query in v:
> # This prefers countries with a match early in their name
> # and also balances against countries with a number of
> # partial matches and their name containing 'new' in the
> # middle
> add_result(
> break
>
> # Prio 4: partial matches on subdivision names
> for candidate in subdivisions:
> v = candidate.
> if v is None:
> continue
> v = remove_
> if query in v:
> add_result(
>
> if not results:
> > raise LookupError(query)
> E LookupError: england
>
> pycountry/
> _______
>
> def test_subdivisio
> #assert len(pycountry.
> assert isinstance(
>
> de_st = pycountry.
> assert de_st.code == u'DE-ST'
> assert de_st.name == u'Sachsen-Anhalt'
> > assert de_st.type == u'State'
> E AssertionError: assert 'Land' == 'State'
> E - State
> E + Land
>
> ../../.
> _________________ test_subdivisio
>
> def test_subdivisio
> al_bu = pycountry.
> > assert al_bu.code == u'AL-BU'
> E AttributeError: 'NoneType' object has no attribute 'code'
>
> ../../.
> _______
>
> def test_repr():
> > assert re.match(
> "alpha_3=u?'DEU', "
> "name=u?'Germany', "
> "numeric=u?'276', "
> "official_
> repr(pycountry.
> E assert None
> E + where None = <function match at 0x7f56b1a19ee0>
> E + where <function match at 0x7f56b1a19ee0> = re.match
> E + and "Country(
> E + where Country(
> E + where <bound method lazy_load.
> E + where <pycountry.
>
> ../../.
> _______
>
> def test_lookup():
> c = pycountry.countries
> g = c.get(alpha_2='DE')
> assert g == c.get(alpha_2='de')
> assert g == c.lookup('de')
> assert g == c.lookup('DEU')
> assert g == c.lookup('276')
> assert g == c.lookup('germany')
> assert g == c.lookup('Federal Republic of Germany')
> # try a generated field
> bqaq = pycountry.
> assert bqaq == pycountry.
> german = pycountry.
> assert german == pycountry.
> euro = pycountry.
> assert euro == pycountry.
> latin = pycountry.
> assert latin == pycountry.
> al_bu = pycountry.
> > assert al_bu == pycountry.
>
> ../../.
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> pycountry/db.py:51: in load_if_needed
> return f(self, *args, **kw)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <pycountry.
>
> @lazy_load
> def lookup(self, value):
> if not isinstance(value, str):
> raise LookupError()
>
> # Normalize for case-insensitivity
> value = value.lower()
>
> # Use indexes first
> for key in self.indices:
> try:
> return self.indices[
> except LookupError:
> pass
>
> # Use non-indexed values now. Avoid going through indexed values.
> for candidate in self:
> for k in self.no_index:
> v = candidate.
> if v is None:
> continue
> if v.lower() == value:
> return candidate
>
> > raise LookupError('Could not find a record for %r' % value)
> E LookupError: Could not find a record for 'al-bu'
>
> pycountry/
> =======
> FAILED ../../.
> FAILED ../../.
> FAILED ../../.
> FAILED ../../.
> FAILED ../../.
> =======
> E: pybuild pybuild:354: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>
> dh_auto_test: error: pybuild --test -i python{version} -p 3.9 returned exit code 13
The full build log is available from:
http://
A list of current common problems and possible solutions is available at
http://
If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https:/
If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.
Changed in pycountry (Debian): | |
importance: | Undecided → Unknown |
status: | New → Confirmed |
Changed in pycountry (Debian): | |
status: | Confirmed → Fix Released |
There is an upstream merge proposal here:
https:/ /github. com/flyingcircu sio/pycountry/ pull/86