[08/10] gnu: Add python-email-validator and python2-email-validator.

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

Commit Message

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

Comments

Leo Famulari June 25, 2016, 5:58 p.m. UTC | #1
On Thu, Jun 23, 2016 at 11:20:02PM +0800, 宋文武 wrote:
> * gnu/packages/python.scm (python-email-validator)
> (python2-email-validator): New variables.
> ---
>  gnu/packages/python.scm | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index ff3cb99..68123cc 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -9468,3 +9468,35 @@ It supports TSIG authenticated messages and EDNS0.")
>  (define-public python2-dnspython
>    (package-with-python2 python-dnspython))
>  
> +(define-public python-email-validator
> +  (package
> +    (name "python-email-validator")
> +    (version "1.0.1")
> +    (source
> +     (origin (method url-fetch)
> +             (uri (pypi-uri "email_validator" version))
> +             (sha256
> +              (base32
> +               "0mn8jg5h8ifl8w6a6m0hq8kbk0mzw9vm054qfamkn89b3npz52qw"))))

The indentation should be shifted to the right.

> +    (build-system python-build-system)
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (add-before 'build 'use-dnspython
> +           (lambda _
> +             (substitute* "setup.py"
> +               (("dnspython3") "dnspython"))
> +             #t)))))
> +    (native-inputs
> +     `(("python-dnspython" ,python-dnspython)
> +       ("python-idna" ,python-idna)

Do dnspython and idna need to be native-inputs? Are they only used to
build?
  
=?utf-8?B?5a6L5paH5q2m?= June 26, 2016, 2:43 a.m. UTC | #2
Leo Famulari <leo@famulari.name> writes:

> On Thu, Jun 23, 2016 at 11:20:02PM +0800, 宋文武 wrote:
>> * gnu/packages/python.scm (python-email-validator)
>> (python2-email-validator): New variables.
>> ---
>>  gnu/packages/python.scm | 32 ++++++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>> 
>> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
>> index ff3cb99..68123cc 100644
>> --- a/gnu/packages/python.scm
>> +++ b/gnu/packages/python.scm
>> @@ -9468,3 +9468,35 @@ It supports TSIG authenticated messages and EDNS0.")
>>  (define-public python2-dnspython
>>    (package-with-python2 python-dnspython))
>>  
>> +(define-public python-email-validator
>> +  (package
>> +    (name "python-email-validator")
>> +    (version "1.0.1")
>> +    (source
>> +     (origin (method url-fetch)
>> +             (uri (pypi-uri "email_validator" version))
>> +             (sha256
>> +              (base32
>> +               "0mn8jg5h8ifl8w6a6m0hq8kbk0mzw9vm054qfamkn89b3npz52qw"))))
>
> The indentation should be shifted to the right.
OK.

>
>> +    (build-system python-build-system)
>> +    (arguments
>> +     '(#:phases
>> +       (modify-phases %standard-phases
>> +         (add-before 'build 'use-dnspython
>> +           (lambda _
>> +             (substitute* "setup.py"
>> +               (("dnspython3") "dnspython"))
>> +             #t)))))
>> +    (native-inputs
>> +     `(("python-dnspython" ,python-dnspython)
>> +       ("python-idna" ,python-idna)
>
> Do dnspython and idna need to be native-inputs? Are they only used to
> build?
They're needed at runtime, and included in the pth file.
But I'm not sure whether or not inputs for python should be
native-inputs, I never cross build python modules for other
architertures.

Should I put dnspython and idna into inputs, or propagated-inputs?
  
Ludovic Courtès June 26, 2016, 9:03 p.m. UTC | #3
iyzsong@member.fsf.org (宋文武) skribis:

> Leo Famulari <leo@famulari.name> writes:
>
>> On Thu, Jun 23, 2016 at 11:20:02PM +0800, 宋文武 wrote:
>>> * gnu/packages/python.scm (python-email-validator)
>>> (python2-email-validator): New variables.
>>> ---
>>>  gnu/packages/python.scm | 32 ++++++++++++++++++++++++++++++++
>>>  1 file changed, 32 insertions(+)
>>> 
>>> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
>>> index ff3cb99..68123cc 100644
>>> --- a/gnu/packages/python.scm
>>> +++ b/gnu/packages/python.scm
>>> @@ -9468,3 +9468,35 @@ It supports TSIG authenticated messages and EDNS0.")
>>>  (define-public python2-dnspython
>>>    (package-with-python2 python-dnspython))
>>>  
>>> +(define-public python-email-validator
>>> +  (package
>>> +    (name "python-email-validator")
>>> +    (version "1.0.1")
>>> +    (source
>>> +     (origin (method url-fetch)
>>> +             (uri (pypi-uri "email_validator" version))
>>> +             (sha256
>>> +              (base32
>>> +               "0mn8jg5h8ifl8w6a6m0hq8kbk0mzw9vm054qfamkn89b3npz52qw"))))
>>
>> The indentation should be shifted to the right.
> OK.
>
>>
>>> +    (build-system python-build-system)
>>> +    (arguments
>>> +     '(#:phases
>>> +       (modify-phases %standard-phases
>>> +         (add-before 'build 'use-dnspython
>>> +           (lambda _
>>> +             (substitute* "setup.py"
>>> +               (("dnspython3") "dnspython"))
>>> +             #t)))))
>>> +    (native-inputs
>>> +     `(("python-dnspython" ,python-dnspython)
>>> +       ("python-idna" ,python-idna)
>>
>> Do dnspython and idna need to be native-inputs? Are they only used to
>> build?
> They're needed at runtime, and included in the pth file.
> But I'm not sure whether or not inputs for python should be
> native-inputs, I never cross build python modules for other
> architertures.

If they’re used at run time, they’re not ‘native-inputs’.  (In practice
we cannot cross-compile Python stuff currently, so this is largely a
theoretical concern, but it doesn’t cost much to get it right.)

> Should I put dnspython and idna into inputs, or propagated-inputs?

If the installed code “import”s them, then they should be propagated.

Ludo’.
  
=?utf-8?B?5a6L5paH5q2m?= June 27, 2016, 2:22 p.m. UTC | #4
>> They're needed at runtime, and included in the pth file.
>> But I'm not sure whether or not inputs for python should be
>> native-inputs, I never cross build python modules for other
>> architertures.
>
> If they’re used at run time, they’re not ‘native-inputs’.  (In practice
> we cannot cross-compile Python stuff currently, so this is largely a
> theoretical concern, but it doesn’t cost much to get it right.)
>
>> Should I put dnspython and idna into inputs, or propagated-inputs?
>
> If the installed code “import”s them, then they should be propagated.
OK, done.  I'm fine with propagated them, but there are many python
packages use inputs for runtime depends and rely on the pth file too.

What's the current practice?


Also, last dicussed at:
<https://lists.gnu.org/archive/html/guix-devel/2016-04/msg01020.html>
  
Ludovic Courtès June 28, 2016, 12:28 p.m. UTC | #5
iyzsong@member.fsf.org (宋文武) skribis:

>>> They're needed at runtime, and included in the pth file.
>>> But I'm not sure whether or not inputs for python should be
>>> native-inputs, I never cross build python modules for other
>>> architertures.
>>
>> If they’re used at run time, they’re not ‘native-inputs’.  (In practice
>> we cannot cross-compile Python stuff currently, so this is largely a
>> theoretical concern, but it doesn’t cost much to get it right.)
>>
>>> Should I put dnspython and idna into inputs, or propagated-inputs?
>>
>> If the installed code “import”s them, then they should be propagated.
> OK, done.  I'm fine with propagated them, but there are many python
> packages use inputs for runtime depends and rely on the pth file too.
>
> What's the current practice?
>
>
> Also, last dicussed at:
> <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg01020.html>

AIUI, what Ricardo is saying in this message is that current practice is
to propagate inputs that are needed at run time, even though that sucks
in some ways.

Ludo’.
  

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ff3cb99..68123cc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9468,3 +9468,35 @@  It supports TSIG authenticated messages and EDNS0.")
 (define-public python2-dnspython
   (package-with-python2 python-dnspython))
 
+(define-public python-email-validator
+  (package
+    (name "python-email-validator")
+    (version "1.0.1")
+    (source
+     (origin (method url-fetch)
+             (uri (pypi-uri "email_validator" version))
+             (sha256
+              (base32
+               "0mn8jg5h8ifl8w6a6m0hq8kbk0mzw9vm054qfamkn89b3npz52qw"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'use-dnspython
+           (lambda _
+             (substitute* "setup.py"
+               (("dnspython3") "dnspython"))
+             #t)))))
+    (native-inputs
+     `(("python-dnspython" ,python-dnspython)
+       ("python-idna" ,python-idna)
+       ("python-setuptools" ,python-setuptools)))
+    (home-page "https://github.com/JoshData/python-email-validator")
+    (synopsis "Email address validation library for Python")
+    (description
+     "This library validates email address syntax and deliverability.")
+    (license cc0)))
+
+(define-public python2-email-validator
+  (package-with-python2 python-email-validator))
+