From d40ed99efaea320ad0d60dcedb0f1c72ce4afc48edb1c86aeb807d3e33f3d3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sun, 10 Mar 2019 11:05:14 +0000 Subject: [PATCH 1/5] Accepting request 683524 from home:jayvdb:py-check-failures - Remove pre-existing bytecode files in the sdist, which were being included in the runtime package and causing lint warnings on Leap 42.3 & SLE 12 SP4, and they were breaking tests on Leap 15. OBS-URL: https://build.opensuse.org/request/show/683524 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Faker?expand=0&rev=18 --- python-Faker.changes | 7 +++++++ python-Faker.spec | 2 ++ 2 files changed, 9 insertions(+) diff --git a/python-Faker.changes b/python-Faker.changes index eac3dff..7744f4f 100644 --- a/python-Faker.changes +++ b/python-Faker.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Mar 10 10:15:00 UTC 2019 - John Vandenberg + +- Remove pre-existing bytecode files in the sdist, which were + being included in the runtime package and causing lint warnings + on Leap 42.3 & SLE 12 SP4, and they were breaking tests on Leap 15. + ------------------------------------------------------------------- Thu Feb 14 14:44:47 UTC 2019 - Tomáš Chvátal diff --git a/python-Faker.spec b/python-Faker.spec index 163ea8e..d596e2b 100644 --- a/python-Faker.spec +++ b/python-Faker.spec @@ -63,6 +63,8 @@ testing, and data anonymization from production services. %prep %setup -q -n Faker-%{version} +# Remove pre-existing bytecode files in the sdist +find . -name '*.py[co]' -delete # do not hardcode pytest version sed -i -e 's:"pytest>=3.8.0,<3.9":"pytest>=3.8.0":g' setup.py From 5717d2750331cd3f1503586537c881f43a3b19ec9cb423edc6e2c8a9d0c39002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 12 Mar 2019 09:24:25 +0000 Subject: [PATCH 2/5] - Add patch to fix 32bit builds: * faker-32bit.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Faker?expand=0&rev=19 --- faker-32bit.patch | 102 +++++++++++++++++++++++++++++++++++++++++++ python-Faker.changes | 6 +++ python-Faker.spec | 2 + 3 files changed, 110 insertions(+) create mode 100644 faker-32bit.patch diff --git a/faker-32bit.patch b/faker-32bit.patch new file mode 100644 index 0000000..e41fc4b --- /dev/null +++ b/faker-32bit.patch @@ -0,0 +1,102 @@ +From 26260b97bee18e2b1ace7cd0f450215f35fd667e Mon Sep 17 00:00:00 2001 +From: Flavio Curella <89607+fcurella@users.noreply.github.com> +Date: Mon, 11 Mar 2019 13:38:18 -0500 +Subject: [PATCH] Close #912. Skip tests on 32bit systems (#922) + +--- + .dockerignore | 16 ++++++++++++++++ + .travis.yml | 9 ++++++--- + MANIFEST.in | 3 ++- + build32bit.sh | 10 ++++++++++ + faker/providers/date_time/__init__.py | 18 ++++++++++++------ + setup.py | 4 ++-- + tests/providers/test_date_time.py | 8 ++++++++ + tox.ini | 8 ++++++-- + 8 files changed, 62 insertions(+), 14 deletions(-) + create mode 100644 .dockerignore + create mode 100755 build32bit.sh + +diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py +index ed27c9f4..7158307a 100644 +--- a/faker/providers/date_time/__init__.py ++++ b/faker/providers/date_time/__init__.py +@@ -11,8 +11,8 @@ + from dateutil import relativedelta + from dateutil.tz import tzlocal, tzutc + +-from faker.utils.datetime_safe import date, datetime, real_date, real_datetime + from faker.utils import is_string ++from faker.utils.datetime_safe import date, datetime, real_date, real_datetime + + from .. import BaseProvider + +@@ -1664,11 +1664,17 @@ def date_time_between_dates( + datetime_to_timestamp(datetime_start), + datetime_to_timestamp(datetime_end), + ) +- if tzinfo is None: +- pick = datetime.fromtimestamp(timestamp, tzlocal()) +- pick = pick.astimezone(tzutc()).replace(tzinfo=None) +- else: +- pick = datetime.fromtimestamp(timestamp, tzinfo) ++ try: ++ if tzinfo is None: ++ pick = datetime.fromtimestamp(timestamp, tzlocal()) ++ pick = pick.astimezone(tzutc()).replace(tzinfo=None) ++ else: ++ pick = datetime.fromtimestamp(timestamp, tzinfo) ++ except OverflowError: ++ raise OverflowError( ++ "You specified an end date with a timestamp bigger than the maximum allowed on this" ++ " system. Please specify an earlier date.", ++ ) + return pick + + def date_between_dates(self, date_start=None, date_end=None): +diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py +index 6f80ed54..67c974cb 100644 +--- a/tests/providers/test_date_time.py ++++ b/tests/providers/test_date_time.py +@@ -6,6 +6,7 @@ + import time + import unittest + import random ++import sys + + import six + +@@ -18,6 +19,10 @@ + import pytest + + ++def is64bit(): ++ return sys.maxsize > 2**32 ++ ++ + class UTC(tzinfo): + """ + UTC implementation taken from Python's docs. +@@ -225,6 +230,7 @@ def test_date_between_dates(self): + def _datetime_to_time(self, value): + return int(time.mktime(value.timetuple())) + ++ @unittest.skipUnless(is64bit(), "requires 64bit") + def test_date_time_this_period(self): + # test century + this_century_start = self._datetime_to_time( +@@ -292,6 +298,7 @@ def test_date_time_this_period(self): + self._datetime_to_time(datetime.now()) + ) + ++ @unittest.skipUnless(is64bit(), "requires 64bit") + def test_date_time_this_period_with_tzinfo(self): + # ensure all methods provide timezone aware datetimes + with pytest.raises(TypeError): +@@ -329,6 +336,7 @@ def test_date_time_this_period_with_tzinfo(self): + replace(second=0, microsecond=0) == datetime.now(utc).replace(second=0, microsecond=0) + ) + ++ @unittest.skipUnless(is64bit(), "requires 64bit") + def test_date_this_period(self): + # test century + assert self.factory.date_this_century(after_today=False) <= date.today() diff --git a/python-Faker.changes b/python-Faker.changes index 7744f4f..eb07fbe 100644 --- a/python-Faker.changes +++ b/python-Faker.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 12 09:24:13 UTC 2019 - Tomáš Chvátal + +- Add patch to fix 32bit builds: + * faker-32bit.patch + ------------------------------------------------------------------- Sun Mar 10 10:15:00 UTC 2019 - John Vandenberg diff --git a/python-Faker.spec b/python-Faker.spec index d596e2b..779a2de 100644 --- a/python-Faker.spec +++ b/python-Faker.spec @@ -26,6 +26,7 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/joke2k/faker Source: https://files.pythonhosted.org/packages/source/F/Faker/Faker-%{version}.tar.gz +Patch0: faker-32bit.patch BuildRequires: %{python_module UkPostcodeParser >= 1.1.1} BuildRequires: %{python_module email_validator >= 1.0.2} BuildRequires: %{python_module mock} @@ -67,6 +68,7 @@ testing, and data anonymization from production services. find . -name '*.py[co]' -delete # do not hardcode pytest version sed -i -e 's:"pytest>=3.8.0,<3.9":"pytest>=3.8.0":g' setup.py +%patch0 -p1 %build %python_build From 0cd20a600ca0a059b8492c65a857cc55c426ee5c18151dd55195cc2ff3959142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 14 Mar 2019 14:34:55 +0000 Subject: [PATCH 3/5] - Update to 1.0.4: * Various small fixes, see CHANGELOG.rst - Merge patch faker-32bit.patch - Update to 1.0.2: OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Faker?expand=0&rev=20 --- Faker-1.0.2.tar.gz | 3 -- Faker-1.0.4.tar.gz | 3 ++ faker-32bit.patch | 102 ------------------------------------------- python-Faker.changes | 9 +++- python-Faker.spec | 11 ++--- 5 files changed, 17 insertions(+), 111 deletions(-) delete mode 100644 Faker-1.0.2.tar.gz create mode 100644 Faker-1.0.4.tar.gz delete mode 100644 faker-32bit.patch diff --git a/Faker-1.0.2.tar.gz b/Faker-1.0.2.tar.gz deleted file mode 100644 index 2ec0ad1..0000000 --- a/Faker-1.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d871ea315b2dcba9138b8344f2c131a76ac62d6227ca39f69b0c889fec97376c -size 933017 diff --git a/Faker-1.0.4.tar.gz b/Faker-1.0.4.tar.gz new file mode 100644 index 0000000..25ad7d8 --- /dev/null +++ b/Faker-1.0.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:745ac8b9c9526e338696e07b7f2e206e5e317e5744e22fdd7c2894bf19af41f1 +size 803706 diff --git a/faker-32bit.patch b/faker-32bit.patch deleted file mode 100644 index e41fc4b..0000000 --- a/faker-32bit.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 26260b97bee18e2b1ace7cd0f450215f35fd667e Mon Sep 17 00:00:00 2001 -From: Flavio Curella <89607+fcurella@users.noreply.github.com> -Date: Mon, 11 Mar 2019 13:38:18 -0500 -Subject: [PATCH] Close #912. Skip tests on 32bit systems (#922) - ---- - .dockerignore | 16 ++++++++++++++++ - .travis.yml | 9 ++++++--- - MANIFEST.in | 3 ++- - build32bit.sh | 10 ++++++++++ - faker/providers/date_time/__init__.py | 18 ++++++++++++------ - setup.py | 4 ++-- - tests/providers/test_date_time.py | 8 ++++++++ - tox.ini | 8 ++++++-- - 8 files changed, 62 insertions(+), 14 deletions(-) - create mode 100644 .dockerignore - create mode 100755 build32bit.sh - -diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py -index ed27c9f4..7158307a 100644 ---- a/faker/providers/date_time/__init__.py -+++ b/faker/providers/date_time/__init__.py -@@ -11,8 +11,8 @@ - from dateutil import relativedelta - from dateutil.tz import tzlocal, tzutc - --from faker.utils.datetime_safe import date, datetime, real_date, real_datetime - from faker.utils import is_string -+from faker.utils.datetime_safe import date, datetime, real_date, real_datetime - - from .. import BaseProvider - -@@ -1664,11 +1664,17 @@ def date_time_between_dates( - datetime_to_timestamp(datetime_start), - datetime_to_timestamp(datetime_end), - ) -- if tzinfo is None: -- pick = datetime.fromtimestamp(timestamp, tzlocal()) -- pick = pick.astimezone(tzutc()).replace(tzinfo=None) -- else: -- pick = datetime.fromtimestamp(timestamp, tzinfo) -+ try: -+ if tzinfo is None: -+ pick = datetime.fromtimestamp(timestamp, tzlocal()) -+ pick = pick.astimezone(tzutc()).replace(tzinfo=None) -+ else: -+ pick = datetime.fromtimestamp(timestamp, tzinfo) -+ except OverflowError: -+ raise OverflowError( -+ "You specified an end date with a timestamp bigger than the maximum allowed on this" -+ " system. Please specify an earlier date.", -+ ) - return pick - - def date_between_dates(self, date_start=None, date_end=None): -diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py -index 6f80ed54..67c974cb 100644 ---- a/tests/providers/test_date_time.py -+++ b/tests/providers/test_date_time.py -@@ -6,6 +6,7 @@ - import time - import unittest - import random -+import sys - - import six - -@@ -18,6 +19,10 @@ - import pytest - - -+def is64bit(): -+ return sys.maxsize > 2**32 -+ -+ - class UTC(tzinfo): - """ - UTC implementation taken from Python's docs. -@@ -225,6 +230,7 @@ def test_date_between_dates(self): - def _datetime_to_time(self, value): - return int(time.mktime(value.timetuple())) - -+ @unittest.skipUnless(is64bit(), "requires 64bit") - def test_date_time_this_period(self): - # test century - this_century_start = self._datetime_to_time( -@@ -292,6 +298,7 @@ def test_date_time_this_period(self): - self._datetime_to_time(datetime.now()) - ) - -+ @unittest.skipUnless(is64bit(), "requires 64bit") - def test_date_time_this_period_with_tzinfo(self): - # ensure all methods provide timezone aware datetimes - with pytest.raises(TypeError): -@@ -329,6 +336,7 @@ def test_date_time_this_period_with_tzinfo(self): - replace(second=0, microsecond=0) == datetime.now(utc).replace(second=0, microsecond=0) - ) - -+ @unittest.skipUnless(is64bit(), "requires 64bit") - def test_date_this_period(self): - # test century - assert self.factory.date_this_century(after_today=False) <= date.today() diff --git a/python-Faker.changes b/python-Faker.changes index eb07fbe..a07ebb7 100644 --- a/python-Faker.changes +++ b/python-Faker.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 14 14:26:07 UTC 2019 - Tomáš Chvátal + +- Update to 1.0.4: + * Various small fixes, see CHANGELOG.rst +- Merge patch faker-32bit.patch + ------------------------------------------------------------------- Tue Mar 12 09:24:13 UTC 2019 - Tomáš Chvátal @@ -14,7 +21,7 @@ Sun Mar 10 10:15:00 UTC 2019 - John Vandenberg ------------------------------------------------------------------- Thu Feb 14 14:44:47 UTC 2019 - Tomáš Chvátal -- Update to 1.0.10: +- Update to 1.0.2: * Many changes to list see CHANGELOG.rst - Run tests diff --git a/python-Faker.spec b/python-Faker.spec index 779a2de..11fb002 100644 --- a/python-Faker.spec +++ b/python-Faker.spec @@ -19,20 +19,21 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Faker -Version: 1.0.2 +Version: 1.0.4 Release: 0 Summary: Faker is a Python package that generates fake data License: MIT Group: Development/Languages/Python URL: https://github.com/joke2k/faker Source: https://files.pythonhosted.org/packages/source/F/Faker/Faker-%{version}.tar.gz -Patch0: faker-32bit.patch BuildRequires: %{python_module UkPostcodeParser >= 1.1.1} BuildRequires: %{python_module email_validator >= 1.0.2} +BuildRequires: %{python_module freezegun >= 0.3.11} BuildRequires: %{python_module mock} BuildRequires: %{python_module more-itertools} BuildRequires: %{python_module pytest >= 3.8.0} BuildRequires: %{python_module python-dateutil >= 2.4} +BuildRequires: %{python_module random2 >= 1.0.1} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.10} BuildRequires: %{python_module text-unidecode >= 1.2} @@ -66,9 +67,9 @@ testing, and data anonymization from production services. %setup -q -n Faker-%{version} # Remove pre-existing bytecode files in the sdist find . -name '*.py[co]' -delete -# do not hardcode pytest version +# do not hardcode versions sed -i -e 's:"pytest>=3.8.0,<3.9":"pytest>=3.8.0":g' setup.py -%patch0 -p1 +sed -i -e 's:==:>=:g' setup.py %build %python_build @@ -85,7 +86,7 @@ sed -i -e 's:"pytest>=3.8.0,<3.9":"pytest>=3.8.0":g' setup.py %python_uninstall_alternative faker %check -%python_exec setup.py test +%pytest %files %{python_files} %license LICENSE.txt From 8caacdbddcbce2eb507b999b7336d6d4d65dd9295849c4c33923413b6c6b0c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 15 Mar 2019 12:06:47 +0000 Subject: [PATCH 4/5] - Add patch ipaddress.patch to fix its runtime detection OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Faker?expand=0&rev=21 --- ipaddress.patch | 13 +++++++++++++ python-Faker.changes | 5 +++++ python-Faker.spec | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 ipaddress.patch diff --git a/ipaddress.patch b/ipaddress.patch new file mode 100644 index 0000000..51858fd --- /dev/null +++ b/ipaddress.patch @@ -0,0 +1,13 @@ +Index: Faker-1.0.4/setup.py +=================================================================== +--- Faker-1.0.4.orig/setup.py ++++ Faker-1.0.4/setup.py +@@ -78,7 +78,7 @@ setup( + "freezegun==0.3.11", + ], + extras_require={ +- ':python_version=="2.7"': [ ++ ':python_version<"3.3"': [ + 'ipaddress', + ], + }, diff --git a/python-Faker.changes b/python-Faker.changes index a07ebb7..78ee0c5 100644 --- a/python-Faker.changes +++ b/python-Faker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 15 12:02:12 UTC 2019 - Tomáš Chvátal + +- Add patch ipaddress.patch to fix its runtime detection + ------------------------------------------------------------------- Thu Mar 14 14:26:07 UTC 2019 - Tomáš Chvátal diff --git a/python-Faker.spec b/python-Faker.spec index 11fb002..c60cf18 100644 --- a/python-Faker.spec +++ b/python-Faker.spec @@ -26,6 +26,7 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/joke2k/faker Source: https://files.pythonhosted.org/packages/source/F/Faker/Faker-%{version}.tar.gz +Patch0: ipaddress.patch BuildRequires: %{python_module UkPostcodeParser >= 1.1.1} BuildRequires: %{python_module email_validator >= 1.0.2} BuildRequires: %{python_module freezegun >= 0.3.11} @@ -65,6 +66,7 @@ testing, and data anonymization from production services. %prep %setup -q -n Faker-%{version} +%patch0 -p1 # Remove pre-existing bytecode files in the sdist find . -name '*.py[co]' -delete # do not hardcode versions From 1611aa107f7d31b0ff5c323cfd7f9c63a90b6341736f7c1f50e1d694143178d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sun, 17 Mar 2019 15:32:11 +0000 Subject: [PATCH 5/5] Accepting request 685440 from home:jengelh:branches:devel:languages:python - Trim duplicated name from summary. OBS-URL: https://build.opensuse.org/request/show/685440 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Faker?expand=0&rev=22 --- python-Faker.changes | 5 +++++ python-Faker.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python-Faker.changes b/python-Faker.changes index 78ee0c5..f8f7c2a 100644 --- a/python-Faker.changes +++ b/python-Faker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 15 13:15:47 UTC 2019 - Jan Engelhardt + +- Trim duplicated name from summary. + ------------------------------------------------------------------- Fri Mar 15 12:02:12 UTC 2019 - Tomáš Chvátal diff --git a/python-Faker.spec b/python-Faker.spec index c60cf18..a360f04 100644 --- a/python-Faker.spec +++ b/python-Faker.spec @@ -21,7 +21,7 @@ Name: python-Faker Version: 1.0.4 Release: 0 -Summary: Faker is a Python package that generates fake data +Summary: Python package that generates fake data License: MIT Group: Development/Languages/Python URL: https://github.com/joke2k/faker