diff mbox

[10/10] gnu: Add python-fake-factory and python2-fake-factory.

Message ID 20160623152004.24065-6-iyzsong@gmail.com
State New
Headers show

Commit Message

宋文武 June 23, 2016, 3:20 p.m. UTC
* gnu/packages/python.scm (python-fake-factory, python2-fake-factory):
New variables.
---
 gnu/packages/python.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

Comments

Leo Famulari June 25, 2016, 5:58 p.m. UTC | #1
On Thu, Jun 23, 2016 at 11:20:04PM +0800, 宋文武 wrote:
> * gnu/packages/python.scm (python-fake-factory, python2-fake-factory):
> New variables.

> +  (arguments
> +   '(#:phases
> +     (modify-phases %standard-phases
> +       (add-before 'check 'disable-failing-test
> +         ;; XXX: faker/tests/ne_np/__init__.py, line 40, in test_names
> +         ;;      first_name, last_name = name.split()
> +         ;; ValueError: too many values to unpack (expected 2)
> +         (lambda _
> +           (delete-file "faker/tests/ne_np/__init__.py")
> +           #t)))))

It's safe to disable this test?

> +  (native-inputs
> +   `(("python-dateutil" ,python-dateutil-2)
> +     ("python-setuptools" ,python-setuptools)
> +     ("python-six" ,python-six)
> +     ;; For testing
> +     ("python-email-validator" ,python-email-validator)
> +     ("python-mock" ,python-mock)
> +     ("python-ukpostcodeparser" ,python-ukpostcodeparser)))

It doesn't need to use dateutil, email-validator, and ukpostcodeparser
at run-time?

> +  (home-page "http://github.com/joke2k/faker")
> +  (synopsis "Python package that generates fake data")
> +  (description
> +   "Faker is a Python package that generates fake data such as names,
> +addresses, and phone numbers.")
> +  (license license:expat)
> +  (properties `((python2-variant . ,(delay python2-fake-factory))))))
> +
> +(define-public python2-fake-factory
> +  (let ((base (package-with-python2 (strip-python2-variant
> +                                     python-fake-factory))))
> +    (package
> +      (inherit base)
> +      (native-inputs
> +       `(("python2-ipaddress" ,python2-ipaddress)
> +         ,@(package-native-inputs base))))))

I have the same question for python2-ipaddress.
=?utf-8?B?5a6L5paH5q2m?= June 26, 2016, 2:09 a.m. UTC | #2
Leo Famulari <leo@famulari.name> writes:

> On Thu, Jun 23, 2016 at 11:20:04PM +0800, 宋文武 wrote:
>> * gnu/packages/python.scm (python-fake-factory, python2-fake-factory):
>> New variables.
>
>> +  (arguments
>> +   '(#:phases
>> +     (modify-phases %standard-phases
>> +       (add-before 'check 'disable-failing-test
>> +         ;; XXX: faker/tests/ne_np/__init__.py, line 40, in test_names
>> +         ;;      first_name, last_name = name.split()
>> +         ;; ValueError: too many values to unpack (expected 2)
>> +         (lambda _
>> +           (delete-file "faker/tests/ne_np/__init__.py")
>> +           #t)))))
>
> It's safe to disable this test?
Yes, the provider provides names in (first, last) or (prefix, first,
last) forms, I think the test code is just outdated.

>
>> +  (native-inputs
>> +   `(("python-dateutil" ,python-dateutil-2)
>> +     ("python-setuptools" ,python-setuptools)
>> +     ("python-six" ,python-six)
>> +     ;; For testing
>> +     ("python-email-validator" ,python-email-validator)
>> +     ("python-mock" ,python-mock)
>> +     ("python-ukpostcodeparser" ,python-ukpostcodeparser)))
>
> It doesn't need to use dateutil, email-validator, and ukpostcodeparser
> at run-time?
It need dateutil and six at runtime, and they're included in the pth
file, I can import them in python from:
  `guix environment --ad-hoc python python-fake-factory -- python3'

IIUC, I don't need to propagate dateutil and six, right?

>
>> +  (home-page "http://github.com/joke2k/faker")
>> +  (synopsis "Python package that generates fake data")
>> +  (description
>> +   "Faker is a Python package that generates fake data such as names,
>> +addresses, and phone numbers.")
>> +  (license license:expat)
>> +  (properties `((python2-variant . ,(delay python2-fake-factory))))))
>> +
>> +(define-public python2-fake-factory
>> +  (let ((base (package-with-python2 (strip-python2-variant
>> +                                     python-fake-factory))))
>> +    (package
>> +      (inherit base)
>> +      (native-inputs
>> +       `(("python2-ipaddress" ,python2-ipaddress)
>> +         ,@(package-native-inputs base))))))
>
> I have the same question for python2-ipaddress.
Oh, it's needed and missing from PYTHONPATH, I should propagate it.

Thanks for the review!
diff mbox

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 50d9ee9..7f3f95d 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9522,3 +9522,50 @@  parsing UK postcodes.")
 
 (define-public python2-ukpostcodeparser
   (package-with-python2 python-ukpostcodeparser))
+
+(define-public python-fake-factory
+  (package
+  (name "python-fake-factory")
+  (version "0.5.7")
+  (source (origin
+            (method url-fetch)
+            (uri (pypi-uri "fake-factory" version))
+            (sha256
+             (base32
+              "1chmarnrdzn4r017n8qlic0m0bbnhw04s3hkwribjvm3mqpb6pa0"))))
+  (build-system python-build-system)
+  (arguments
+   '(#:phases
+     (modify-phases %standard-phases
+       (add-before 'check 'disable-failing-test
+         ;; XXX: faker/tests/ne_np/__init__.py, line 40, in test_names
+         ;;      first_name, last_name = name.split()
+         ;; ValueError: too many values to unpack (expected 2)
+         (lambda _
+           (delete-file "faker/tests/ne_np/__init__.py")
+           #t)))))
+  (native-inputs
+   `(("python-dateutil" ,python-dateutil-2)
+     ("python-setuptools" ,python-setuptools)
+     ("python-six" ,python-six)
+     ;; For testing
+     ("python-email-validator" ,python-email-validator)
+     ("python-mock" ,python-mock)
+     ("python-ukpostcodeparser" ,python-ukpostcodeparser)))
+  (home-page "http://github.com/joke2k/faker")
+  (synopsis "Python package that generates fake data")
+  (description
+   "Faker is a Python package that generates fake data such as names,
+addresses, and phone numbers.")
+  (license license:expat)
+  (properties `((python2-variant . ,(delay python2-fake-factory))))))
+
+(define-public python2-fake-factory
+  (let ((base (package-with-python2 (strip-python2-variant
+                                     python-fake-factory))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-ipaddress" ,python2-ipaddress)
+         ,@(package-native-inputs base))))))
+