unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Fix python-html5lib import.
@ 2016-12-10 15:57 Marius Bakke
  2016-12-10 15:57 ` [PATCH 1/2] gnu: Add python-webencodings Marius Bakke
  2016-12-10 15:57 ` [PATCH 2/2] gnu: python-html5lib: Add dependency on python-webencodings Marius Bakke
  0 siblings, 2 replies; 3+ messages in thread
From: Marius Bakke @ 2016-12-10 15:57 UTC (permalink / raw)
  To: guix-devel; +Cc: Marius Bakke

I'm not sure if this is a recent dependency, but without this patch
"import html5lib" complains about not finding webencodings module.

Marius Bakke (2):
  gnu: Add python-webencodings.
  gnu: python-html5lib: Add dependency on python-webencodings.

 gnu/packages/python.scm | 43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] gnu: Add python-webencodings.
  2016-12-10 15:57 [PATCH 0/2] Fix python-html5lib import Marius Bakke
@ 2016-12-10 15:57 ` Marius Bakke
  2016-12-10 15:57 ` [PATCH 2/2] gnu: python-html5lib: Add dependency on python-webencodings Marius Bakke
  1 sibling, 0 replies; 3+ messages in thread
From: Marius Bakke @ 2016-12-10 15:57 UTC (permalink / raw)
  To: guix-devel; +Cc: Marius Bakke

* gnu/packages/python.scm (python-webencodings, python2-webencodings): New
variables.
---
 gnu/packages/python.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b0e23b5c1..690e0ae37 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4892,6 +4892,46 @@ and written in Python.")
 (define-public python2-html5lib-0.9
   (package-with-python2 python-html5lib-0.9))
 
+(define-public python-webencodings
+  (package
+    (name "python-webencodings")
+    (version "0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "webencodings" version))
+              (sha256
+               (base32
+                "015rw7662lkpb9aqiqah2hbizk6w531badqwjpz41rr47glmxid5"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "py.test" "-v" "webencodings/tests.py")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/SimonSapin/python-webencodings")
+    (synopsis "Character encoding aliases for legacy web content")
+    (description
+     "In order to be compatible with legacy web content when interpreting
+something like @code{Content-Type: text/html; charset=latin1}, tools need
+to use a particular set of aliases for encoding labels as well as some
+overriding rules.  For example, @code{US-ASCII} and @code{iso-8859-1} on
+the web are actually aliases for @code{windows-1252}, and an @code{UTF-8}
+or @code{UTF-16} BOM takes precedence over any other encoding declaration.
+The WHATWG @url{https://encoding.spec.whatwg.org/,Encoding} standard
+defines all such details so that implementations do not have to
+reverse-engineer each other.
+
+This module implements the Encoding standard and has encoding labels and
+BOM detection, but the actual implementation for encoders and decoders
+is Python’s.")
+    (license license:bsd-3)))
+
+(define-public python2-webencodings
+  (package-with-python2 python-webencodings))
+
 (define-public python-urwid
   (package
     (name "python-urwid")
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] gnu: python-html5lib: Add dependency on python-webencodings.
  2016-12-10 15:57 [PATCH 0/2] Fix python-html5lib import Marius Bakke
  2016-12-10 15:57 ` [PATCH 1/2] gnu: Add python-webencodings Marius Bakke
@ 2016-12-10 15:57 ` Marius Bakke
  1 sibling, 0 replies; 3+ messages in thread
From: Marius Bakke @ 2016-12-10 15:57 UTC (permalink / raw)
  To: guix-devel; +Cc: Marius Bakke

* gnu/packages/python.scm (python-html5lib,
python2-html5lib)[propagated-inputs]: Add python-webencodings.
---
 gnu/packages/python.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 690e0ae37..101d8bc25 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4861,7 +4861,8 @@ ISO 8601 dates, time and duration.")
             "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd"))))
     (build-system python-build-system)
     (propagated-inputs
-      `(("python-six" ,python-six))) ; required to "import html5lib"
+     `(("python-six" ,python-six)
+       ("python-webencodings" ,python-webencodings)))
     (arguments
      `(#:test-target "check"))
     (home-page
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-10 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-10 15:57 [PATCH 0/2] Fix python-html5lib import Marius Bakke
2016-12-10 15:57 ` [PATCH 1/2] gnu: Add python-webencodings Marius Bakke
2016-12-10 15:57 ` [PATCH 2/2] gnu: python-html5lib: Add dependency on python-webencodings Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).