guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/08: gnu: Update python-faker to to 4.0.2, python2-faker to 3.0.1.


From: guix-commits
Subject: 07/08: gnu: Update python-faker to to 4.0.2, python2-faker to 3.0.1.
Date: Fri, 20 Mar 2020 17:44:56 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit a6a7336964da06abba9dd40ce8d7496c9c711177
Author: Marius Bakke <address@hidden>
AuthorDate: Fri Mar 20 22:09:12 2020 +0100

    gnu: Update python-faker to to 4.0.2, python2-faker to 3.0.1.
    
    * gnu/packages/patches/python-faker-fix-build-32bit.patch: Delete file.
    * gnu/local.mk (dist_patch_DATA): Adjust accordingly.
    * gnu/packages/python-xyz.scm (python-faker): Update to 4.0.2.
    [source](patches, modules, snippet): Remove.
    [arguments]: Adjust check phase.
    [native-inputs]: Remove PYTHON-EMAIL-VALIDATOR and PYTHON-MOCK.  Add
    PYTHON-FREEZEGUN, PYTHON-PYTEST, PYTHON-RANDOM2, and PYTHON-VALIDATORS.
    [propagated-inputs]: Remove PYTHON-SIX.  Add PYTHON-TEXT-UNIDECODE.
    (python2-faker): Update to 3.0.1.
    [native-inputs]: Add PYTHON2-MOCK.
---
 gnu/local.mk                                       |  1 -
 .../patches/python-faker-fix-build-32bit.patch     | 36 ----------------------
 gnu/packages/python-xyz.scm                        | 34 +++++++++++---------
 3 files changed, 20 insertions(+), 51 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 0207c75..8ada031 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1337,7 +1337,6 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-cffi-x87-stack-clean.patch       \
   %D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
   %D%/packages/patches/python-configobj-setuptools.patch       \
-  %D%/packages/patches/python-faker-fix-build-32bit.patch      \
   %D%/packages/patches/python-flask-restful-werkzeug-compat.patch      \
   %D%/packages/patches/python-keras-integration-test.patch     \
   %D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
diff --git a/gnu/packages/patches/python-faker-fix-build-32bit.patch 
b/gnu/packages/patches/python-faker-fix-build-32bit.patch
deleted file mode 100644
index 466b289..0000000
--- a/gnu/packages/patches/python-faker-fix-build-32bit.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-These tests fail on 32-bit due to an overflow.
-
-Upstream bug URL: https://github.com/joke2k/faker/issues/408
-
-diff --git a/tests/__init__.py b/tests/__init__.py
-index 6026772..58b6b83 100644
---- a/tests/__init__.py
-+++ b/tests/__init__.py
-@@ -384,7 +384,6 @@ class FactoryTestCase(unittest.TestCase):
-         provider = Provider
-         # test century
-         
self.assertTrue(self._datetime_to_time(provider.date_time_this_century(after_now=False))
 <= self._datetime_to_time(datetime.datetime.now()))
--        
self.assertTrue(self._datetime_to_time(provider.date_time_this_century(before_now=False,
 after_now=True)) >= self._datetime_to_time(datetime.datetime.now()))
-         # test decade
-         
self.assertTrue(self._datetime_to_time(provider.date_time_this_decade(after_now=False))
 <= self._datetime_to_time(datetime.datetime.now()))
-         
self.assertTrue(self._datetime_to_time(provider.date_time_this_decade(before_now=False,
 after_now=True)) >= self._datetime_to_time(datetime.datetime.now()))
-@@ -413,8 +412,6 @@ class FactoryTestCase(unittest.TestCase):
- 
-         # ensure all methods provide timezone aware datetimes
-         with self.assertRaises(TypeError):
--            provider.date_time_this_century(before_now=False, after_now=True, 
tzinfo=utc) >= datetime.datetime.now()
--        with self.assertRaises(TypeError):
-             provider.date_time_this_decade(after_now=False, tzinfo=utc) <= 
datetime.datetime.now()
-         with self.assertRaises(TypeError):
-             provider.date_time_this_year(after_now=False, tzinfo=utc) <= 
datetime.datetime.now()
-@@ -423,7 +420,6 @@ class FactoryTestCase(unittest.TestCase):
- 
-         # test century
-         self.assertTrue(provider.date_time_this_century(after_now=False, 
tzinfo=utc) <= datetime.datetime.now(utc))
--        self.assertTrue(provider.date_time_this_century(before_now=False, 
after_now=True, tzinfo=utc) >= datetime.datetime.now(utc))
-         # test decade
-         self.assertTrue(provider.date_time_this_decade(after_now=False, 
tzinfo=utc) <= datetime.datetime.now(utc))
-         self.assertTrue(provider.date_time_this_decade(before_now=False, 
after_now=True, tzinfo=utc) >= datetime.datetime.now(utc))
--- 
-2.11.1
-
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0c7e9e4..47a75bc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11368,34 +11368,29 @@ parsing UK postcodes.")
 (define-public python-faker
   (package
   (name "python-faker")
-  (version "0.7.9")
+  (version "4.0.2")
   (source (origin
             (method url-fetch)
             (uri (pypi-uri "Faker" version))
             (sha256
              (base32
-              "1fh2p2yz0fsdr4fqwxgddwbvfb6qn6vp8yx0qwqzra27yq5d1wsm"))
-            (patches
-             (search-patches "python-faker-fix-build-32bit.patch"))
-            (modules '((guix build utils)))
-            (snippet
-             '(begin
-                (for-each delete-file (find-files "." "\\.pyc$"))
-                #t))))
+              "13qq485ydxmdnqn3xbfv1xfyqbf9qfnfw33v1vw5l6jyy9p8cgrd"))))
   (build-system python-build-system)
   (arguments
    '(#:phases
      (modify-phases %standard-phases
        (replace 'check
-         (lambda _ (invoke "python" "-m" "unittest" "-v" "tests"))))))
+         (lambda _ (invoke "python" "-m" "pytest" "-v"))))))
   (native-inputs
    `(;; For testing
-     ("python-email-validator" ,python-email-validator)
-     ("python-mock" ,python-mock)
-     ("python-ukpostcodeparser" ,python-ukpostcodeparser)))
+     ("python-freezegun" ,python-freezegun)
+     ("python-pytest" ,python-pytest)
+     ("python-random2" ,python-random2)
+     ("python-ukpostcodeparser" ,python-ukpostcodeparser)
+     ("python-validators" ,python-validators)))
   (propagated-inputs
    `(("python-dateutil" ,python-dateutil)
-     ("python-six" ,python-six)))
+     ("python-text-unidecode" ,python-text-unidecode)))
   (home-page "https://github.com/joke2k/faker";)
   (synopsis "Python package that generates fake data")
   (description
@@ -11404,11 +11399,22 @@ addresses, and phone numbers.")
   (license license:expat)
   (properties `((python2-variant . ,(delay python2-faker))))))
 
+;; Faker 4.0 dropped Python 2 support, so we stick with this older version 
here.
 (define-public python2-faker
   (let ((base (package-with-python2 (strip-python2-variant
                                      python-faker))))
     (package
       (inherit base)
+      (version "3.0.1")
+      (source (origin
+                (method url-fetch)
+                (uri (pypi-uri "Faker" version))
+                (sha256
+                 (base32
+                  "11cr0qvspkdh6198rqy56qildk7bnp6llj8kyy1dan5sp5n4dxy7"))))
+      (native-inputs
+       `(("python-mock" ,python2-mock)
+         ,@(package-native-inputs base)))
       (propagated-inputs
        `(("python2-ipaddress" ,python2-ipaddress)
          ,@(package-propagated-inputs base))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]