[PATCH] gnu: Add python-domain-connect-dyndns.

OpenSubmitted by Mekeor Melire.
Details
2 participants
  • Mekeor Melire
  • Xinglu Chen
Owner
unassigned
Severity
normal
M
M
Mekeor Melire wrote on 19 May 2021 04:19
(address . guix-patches@gnu.org)
87bl97lb2y.fsf@posteo.de
Hello Guix!

It's been long time since my last contribution. (Namely, almost 4
years!) But now I got three little package declarations for you, which
can be used to update DNS records of domains from certain
domain-providers. For example, I'm using a well known, pretty common
German domain-provider and found this python-script to be most
comfortable to use. It is based on a new, open standard, called "Domain
Connect", developed, used and supported by many common DNS/domain
just to argue why I think these packages have a value for the public
(and not just my private self).

See you
Mekeor
From 488d77b3a6542598264ba964a723cf2c7d6e646f Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor@posteo.de>
Date: Wed, 19 May 2021 03:45:08 +0200
Subject: [PATCH] gnu: Add python-domain-connect-dyndns.

* gnu/packages/python-web.scm (python-publicsuffixlist, python-domain-connect,
python-domain-connect-dyndns): New variables.
---
gnu/packages/python-web.scm | 103 ++++++++++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)

Toggle diff (123 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index b7411d21fa..41c8971c8c 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -42,6 +42,7 @@
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2021 Mekeor Melire <mekeor@posteo.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4066,6 +4067,108 @@ List.  Forked from and using the same API as the publicsuffix package.")
 (define-public python2-publicsuffix2
   (package-with-python2 python-publicsuffix2))
 
+(define-public python-publicsuffixlist
+  (package
+    (name "python-publicsuffixlist")
+    (version "0.7.7")
+    (home-page "https://github.com/ko-zu/psl")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit "bff8d6a87b6bd3f6894e9211a9ee3c995ccfdcfc")))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32 "1nzvw6n702y1v1z5b62lv2rnlqjr3hjpal2750sg8s713fxvxlzz"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))
+    (synopsis "Parse the Public Suffix List")
+    (description "Parse and use a given list of public suffix domains.")
+    (license license:mpl2.0)))
+
+(define-public python-domain-connect
+  (package
+    (name "python-domain-connect")
+    (version "0.0.9")
+    (home-page "https://github.com/Domain-Connect/domainconnect_python")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32 "1xji0svamw961c7zgs1453cw2b9w94mk5qrfvqyb592l6yhmmm62"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'only-single-number-versions
+           (lambda _
+             (substitute* '("setup.py" "requirements.txt")
+               (("(.*)([0-9]+)\\.[0-9]+\\.[0-9]+(.*)" all begin number end)
+                (string-append begin number end "\n"))))))))
+    (propagated-inputs
+     `(("python-cffi" ,python-cffi)
+       ("python-cryptography" ,python-cryptography)
+       ("python-dnspython" ,python-dnspython)
+       ("python-future" ,python-future)
+       ("python-publicsuffix" ,python-publicsuffix)
+       ("python-publicsuffixlist" ,python-publicsuffixlist)
+       ("python-pycparser" ,python-pycparser)
+       ("python-six" ,python-six)))
+    (synopsis "Update DNS record of a domain per Domain Connect standard")
+    (description "This library provides \"Domain Connect\" for Python, which
+can be used to update DNS records of domains.")
+    (license license:expat)))
+
+(define-public python-domain-connect-dyndns
+  (package
+    (name "python-domain-connect-dyndns")
+    (version "0.0.9")
+    (home-page "https://github.com/Domain-Connect/DomainConnectDDNS-Python")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url home-page)
+          (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "024wxhfifl14j8s973lg6ls6s80grf9sm417kd2rpy1a90p89dnk"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'only-single-number-versions
+           (lambda _
+             (substitute* '("setup.py" "requirements.txt")
+               (("(.*)([0-9]+)\\.[0-9]+\\.[0-9]+(.*)" all begin number end)
+                (string-append begin number end "\n"))))))))
+    (propagated-inputs
+     `(("python-certifi" ,python-certifi)
+       ("python-cffi" ,python-cffi)
+       ("python-chardet" ,python-chardet)
+       ("python-cryptography" ,python-cryptography)
+       ("python-dnspython" ,python-dnspython)
+       ("python-domain-connect" ,python-domain-connect)
+       ("python-future" ,python-future)
+       ("python-idna" ,python-idna)
+       ("python-publicsuffix" ,python-publicsuffix)
+       ("python-pycparser" ,python-pycparser)
+       ("python-requests" ,python-requests)
+       ("python-six" ,python-six)
+       ("python-urllib3" ,python-urllib3)
+       ("python-validators" ,python-validators)))
+    (synopsis "Update DNS record of a domain per Domain Connect standard")
+    (description "This package provides a client for the open standard
+\"Domain Connect\" which can be used to update DNS records of domains.")
+    (license license:expat)))
+
 (define-public python-werkzeug
   (package
     (name "python-werkzeug")
-- 
2.30.2
X
X
Xinglu Chen wrote on 23 May 2021 09:34
87im39c39y.fsf@yoctocell.xyz
On Wed, May 19 2021, Mekeor Melire wrote:

Toggle quote (8 lines)
> From 488d77b3a6542598264ba964a723cf2c7d6e646f Mon Sep 17 00:00:00 2001
> From: Mekeor Melire <mekeor@posteo.de>
> Date: Wed, 19 May 2021 03:45:08 +0200
> Subject: [PATCH] gnu: Add python-domain-connect-dyndns.
>
> * gnu/packages/python-web.scm (python-publicsuffixlist, python-domain-connect,
> python-domain-connect-dyndns): New variables.

This should be split into three separate commits, you can use the
etc/committer.scm script to automatically create commits for unstaged
changes.

Toggle quote (17 lines)
> +(define-public python-publicsuffixlist
> + (package
> + (name "python-publicsuffixlist")
> + (version "0.7.7")
> + (home-page "https://github.com/ko-zu/psl")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url home-page)
> + (commit "bff8d6a87b6bd3f6894e9211a9ee3c995ccfdcfc")))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "1nzvw6n702y1v1z5b62lv2rnlqjr3hjpal2750sg8s713fxvxlzz"))))
> + (build-system python-build-system)
> + (arguments
> + `(#:tests? #f))

What’s the reason for disabling the tests?

Toggle quote (3 lines)
> + (synopsis "Parse the Public Suffix List")
> + (description "Parse and use a given list of public suffix domains.")

The description should contain one or more full sentences.

Toggle quote (19 lines)
> + (license license:mpl2.0)))
> +
> +(define-public python-domain-connect
> + (package
> + (name "python-domain-connect")
> + (version "0.0.9")
> + (home-page "https://github.com/Domain-Connect/domainconnect_python")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url home-page)
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "1xji0svamw961c7zgs1453cw2b9w94mk5qrfvqyb592l6yhmmm62"))))
> + (build-system python-build-system)
> + (arguments
> + `(#:tests? #f

Same as above (why are tests disabled?).

Toggle quote (8 lines)
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'only-single-number-versions
> + (lambda _
> + (substitute* '("setup.py" "requirements.txt")
> + (("(.*)([0-9]+)\\.[0-9]+\\.[0-9]+(.*)" all begin number end)
> + (string-append begin number end "\n"))))))))

Is the newline necessary?

Toggle quote (33 lines)
> + (propagated-inputs
> + `(("python-cffi" ,python-cffi)
> + ("python-cryptography" ,python-cryptography)
> + ("python-dnspython" ,python-dnspython)
> + ("python-future" ,python-future)
> + ("python-publicsuffix" ,python-publicsuffix)
> + ("python-publicsuffixlist" ,python-publicsuffixlist)
> + ("python-pycparser" ,python-pycparser)
> + ("python-six" ,python-six)))
> + (synopsis "Update DNS record of a domain per Domain Connect standard")
> + (description "This library provides \"Domain Connect\" for Python, which
> +can be used to update DNS records of domains.")
> + (license license:expat)))
> +
> +(define-public python-domain-connect-dyndns
> + (package
> + (name "python-domain-connect-dyndns")
> + (version "0.0.9")
> + (home-page "https://github.com/Domain-Connect/DomainConnectDDNS-Python")
> + (source
> + (origin
> + (method git-fetch)
> + (uri
> + (git-reference
> + (url home-page)
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "024wxhfifl14j8s973lg6ls6s80grf9sm417kd2rpy1a90p89dnk"))))
> + (build-system python-build-system)
> + (arguments
> + `(#:tests? #f

Same as the comment for python-domain-connect.

Toggle quote (8 lines)
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'only-single-number-versions
> + (lambda _
> + (substitute* '("setup.py" "requirements.txt")
> + (("(.*)([0-9]+)\\.[0-9]+\\.[0-9]+(.*)" all begin number end)
> + (string-append begin number end "\n"))))))))

Same as the comment for python-domain-connect.

otherwise LGTM!
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmCqBWoVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5omkP/Rq4kBbNMlXVzZJvI/024mKQ+UhV
KWcuKNfaEeDZUrEP5wDFhGRl5aHA91Be14AZOeloDSYI6YXbyf1po1jL1CR1XKNa
W7o1xllnQ4tNIEdOiQb7Fb5VhuIwSRoWT+jqQBIck+ImobpeZJg0s+fDW9b2y3ov
c6yB3eT+QPppll5G3ayKgii3JDmOH4+ZTrCn5euKnwfOrplWu1X9NlOqb4bY4zEQ
jYPt6qWdnzYn5L+M39I/rdFoDoTcdQPCNA96aNfkjR76CsHlneUtdLLRgkpxK4NO
6sMLs5SamPF8CSh9+Rn5NhuKC+TwfrM1D4ublQrPWfuZ1L1k7OOonye15r5xhK+T
IsaA23RTTf03/tLWUb6SvmE3xQbwVfJFwp98ehFx9pGN/ynn4fYhXCcEmFmL3lUX
WuOou8UzkB5pfm9OJIT2cpPJ9Qp6PTgYfE9526BOVq+2bPvrQ8f5Ji5bg5VLub0M
zBSTVG/X0RwK1zyhZUXCDrST2HYstf+i5MopOaI/4xhCYulJlWXGOdbtCy1XQNj9
iLrE3DyYEuTzbsqBgyfjp5R/Z4Sx4ZbvSKBRC/C+XAke5Xko9BOHeSenzdbKwNNd
b9eVhJ+udsG3cZZex95XGo4inr7U97c9bblVEIPvl3VdYGzCnQmCGeHy352e1EFG
iC6ekRCqGoi1t2ss
=vD7+
-----END PGP SIGNATURE-----

M
M
Mekeor Melire wrote on 29 Jun 2021 22:43
(name . Xinglu Chen)(address . public@yoctocell.xyz)(address . 48514@debbugs.gnu.org)
87bl7otmzc.fsf@posteo.de
Hi and thank you for reviewing the patch!

2021-05-23 / 09:34 / public@yoctocell.xyz:

Toggle quote (34 lines)
> [[PGP Signed Part:Undecided]]
> On Wed, May 19 2021, Mekeor Melire wrote:
>
>> From 488d77b3a6542598264ba964a723cf2c7d6e646f Mon Sep 17 00:00:00 2001
>> From: Mekeor Melire <mekeor@posteo.de>
>> Date: Wed, 19 May 2021 03:45:08 +0200
>> Subject: [PATCH] gnu: Add python-domain-connect-dyndns.
>>
>> * gnu/packages/python-web.scm (python-publicsuffixlist, python-domain-connect,
>> python-domain-connect-dyndns): New variables.
>
> This should be split into three separate commits, you can use the
> etc/committer.scm script to automatically create commits for unstaged
> changes.
>
>> +(define-public python-publicsuffixlist
>> + (package
>> + (name "python-publicsuffixlist")
>> + (version "0.7.7")
>> + (home-page "https://github.com/ko-zu/psl")
>> + (source (origin
>> + (method git-fetch)
>> + (uri (git-reference
>> + (url home-page)
>> + (commit "bff8d6a87b6bd3f6894e9211a9ee3c995ccfdcfc")))
>> + (file-name (git-file-name name version))
>> + (sha256
>> + (base32 "1nzvw6n702y1v1z5b62lv2rnlqjr3hjpal2750sg8s713fxvxlzz"))))
>> + (build-system python-build-system)
>> + (arguments
>> + `(#:tests? #f))
>
> What’s the reason for disabling the tests?

I tried to get the tests working. But I'm not sure how to fix this
error: "ImportError: Failed to import test module: domainconnect". The
full logs are here: http://ix.io/3rvK

It probably originates in this line:


If I understand correctly, the package's tests try to import the package
itself (which makes sense). I'm not sure why it does not work though.
Any ideas?

I will get the other change-requests done after fixing the tests.

Toggle quote (84 lines)
>> + (synopsis "Parse the Public Suffix List")
>> + (description "Parse and use a given list of public suffix domains.")
>
> The description should contain one or more full sentences.
>
>> + (license license:mpl2.0)))
>> +
>> +(define-public python-domain-connect
>> + (package
>> + (name "python-domain-connect")
>> + (version "0.0.9")
>> + (home-page "https://github.com/Domain-Connect/domainconnect_python")
>> + (source (origin
>> + (method git-fetch)
>> + (uri (git-reference
>> + (url home-page)
>> + (commit (string-append "v" version))))
>> + (file-name (git-file-name name version))
>> + (sha256
>> + (base32 "1xji0svamw961c7zgs1453cw2b9w94mk5qrfvqyb592l6yhmmm62"))))
>> + (build-system python-build-system)
>> + (arguments
>> + `(#:tests? #f
>
> Same as above (why are tests disabled?).
>
>> + #:phases
>> + (modify-phases %standard-phases
>> + (add-after 'unpack 'only-single-number-versions
>> + (lambda _
>> + (substitute* '("setup.py" "requirements.txt")
>> + (("(.*)([0-9]+)\\.[0-9]+\\.[0-9]+(.*)" all begin number end)
>> + (string-append begin number end "\n"))))))))
>
> Is the newline necessary?
>
>> + (propagated-inputs
>> + `(("python-cffi" ,python-cffi)
>> + ("python-cryptography" ,python-cryptography)
>> + ("python-dnspython" ,python-dnspython)
>> + ("python-future" ,python-future)
>> + ("python-publicsuffix" ,python-publicsuffix)
>> + ("python-publicsuffixlist" ,python-publicsuffixlist)
>> + ("python-pycparser" ,python-pycparser)
>> + ("python-six" ,python-six)))
>> + (synopsis "Update DNS record of a domain per Domain Connect standard")
>> + (description "This library provides \"Domain Connect\" for Python, which
>> +can be used to update DNS records of domains.")
>> + (license license:expat)))
>> +
>> +(define-public python-domain-connect-dyndns
>> + (package
>> + (name "python-domain-connect-dyndns")
>> + (version "0.0.9")
>> + (home-page "https://github.com/Domain-Connect/DomainConnectDDNS-Python")
>> + (source
>> + (origin
>> + (method git-fetch)
>> + (uri
>> + (git-reference
>> + (url home-page)
>> + (commit (string-append "v" version))))
>> + (file-name (git-file-name name version))
>> + (sha256
>> + (base32 "024wxhfifl14j8s973lg6ls6s80grf9sm417kd2rpy1a90p89dnk"))))
>> + (build-system python-build-system)
>> + (arguments
>> + `(#:tests? #f
>
> Same as the comment for python-domain-connect.
>
>> + #:phases
>> + (modify-phases %standard-phases
>> + (add-after 'unpack 'only-single-number-versions
>> + (lambda _
>> + (substitute* '("setup.py" "requirements.txt")
>> + (("(.*)([0-9]+)\\.[0-9]+\\.[0-9]+(.*)" all begin number end)
>> + (string-append begin number end "\n"))))))))
>
> Same as the comment for python-domain-connect.
>
> otherwise LGTM!
>
> [[End of PGP Signed Part]]
?