Skip to content

Commit

Permalink
Update kiwi for bionic and 2018
Browse files Browse the repository at this point in the history
- Deal with change in the pt_BR locale's date formatting that happened post-Xenial
- Use python3 in Makefile
- Note the specfile is outdated

Fixes: https://gitlab.com/stoqtech/kiwi/issues/1
Change-Id: I28a82a91bc73d29065ef4a80c41e3ef8bf753325
  • Loading branch information
Christian "kiko" Reis committed Dec 6, 2018
1 parent 19ab93b commit bd21733
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -5,7 +5,7 @@ WEBDIR=/mondo/htdocs/async.com.br/www/projects/kiwi
TESTS_RUNNER=python3 -m nose --nocapture --nologcapture --verbose --detailed-errors

all:
python setup.py build_ext -i
python3 setup.py build_ext -i

clean-docs:
rm -fr doc/api
Expand Down
4 changes: 4 additions & 0 deletions kiwi.spec
@@ -1,3 +1,7 @@
# XXX: This file is outdated, as it refers to an older version of kiwi that is
# now unsupported. Kiwi has now moved to Python3 and is hosted at
# https://gerrit.async.com.br/#/admin/projects/kiwi

%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Expand Down
9 changes: 6 additions & 3 deletions tests/test_datatypes.py
Expand Up @@ -96,10 +96,13 @@ def testAsStringBR(self):
if not set_locale(locale.LC_TIME, 'pt_BR'):
return

self.assertEqual(self.conv.as_string(self.dt), "Seg 12 Fev 1979 12:15")
# The double lowers() here are to deal with the fact that in mid-2016
# glibc changed the month and day names to be lowercase, as per
# https://sourceware.org/bugzilla/show_bug.cgi?id=19133
self.assertEqual(self.conv.as_string(self.dt).lower(), "seg 12 fev 1979 12:15")
with mock.patch.object(self.conv, '_keep_seconds', True):
self.assertEqual(self.conv.as_string(self.dt),
"Seg 12 Fev 1979 12:15:30")
self.assertEqual(self.conv.as_string(self.dt).lower(),
"seg 12 fev 1979 12:15:30")

def testAsStringUS(self):
if not set_locale(locale.LC_TIME, 'en_US'):
Expand Down

0 comments on commit bd21733

Please sign in to comment.