guix-commits
[Top][All Lists]
Advanced

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

04/04: gnu: python-cloudscraper: Update to 1.2.58.


From: guix-commits
Subject: 04/04: gnu: python-cloudscraper: Update to 1.2.58.
Date: Tue, 30 Nov 2021 14:52:39 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit e4e50229f19f79079982e8017b20e3988a5c9226
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Tue Nov 30 20:49:18 2021 +0100

    gnu: python-cloudscraper: Update to 1.2.58.
    
    * gnu/packages/python-web.scm (python-cloudscraper): Update to 1.2.58.
    [source]: Do not delete as many files in snippet; fetch sources via git.
    [arguments]: Add build phase 'fix-references; replace 'check phase.
    [inputs]: Add node.
    [propagated-inputs]: Add python-js2py, python-polling2, and 
python-responses.
---
 gnu/packages/python-web.scm | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index fcc2ed6..2d13b17 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -79,6 +79,7 @@
   #:use-module (gnu packages groff)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages node)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -6020,26 +6021,26 @@ Encoding for HTTP.")
 (define-public python-cloudscraper
   (package
     (name "python-cloudscraper")
-    (version "1.2.48")
+    (version "1.2.58")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "cloudscraper" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/VeNoMouS/cloudscraper";)
+             ;; Corresponds to 1.2.58
+             (commit "f3a3d067ea8b5238e9a0948aed0c3fa0d9c29b96")))
        (sha256
-        (base32 "0qjxzb0z5bprvmdhx42ayqhlhi2h49d9dwc0vvycj817s71f2sxv"))
+        (base32 "18fbp086imabjxly04rrchbf6n6m05bpd150zxbw7z2w3mjnpsqd"))
        (modules '((guix build utils)))
        (snippet
         '(with-directory-excursion "cloudscraper"
            (for-each delete-file
-                     '("captcha/2captcha.py"
-                       "captcha/9kw.py"
-                       "captcha/anticaptcha.py"
-                       "captcha/deathbycaptcha.py"))
+                     '("captcha/9kw.py"
+                       "captcha/anticaptcha.py"))
            (substitute* "__init__.py"
              ;; Perhaps it's a joke, but don't promote proprietary software.
              (("([Th]is feature is not available) in the .*'" _ prefix)
-              (string-append prefix ".'")))
-           #t))))
+              (string-append prefix ".'")))))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -6050,12 +6051,25 @@ Encoding for HTTP.")
            (lambda _
              (with-directory-excursion "cloudscraper"
                (for-each delete-file
-                         '("interpreters/js2py.py"
-                           "interpreters/v8.py")))
-             #t)))))
+                         '("interpreters/v8.py")))))
+         (add-after 'unpack 'fix-references
+           (lambda _
+             (substitute* "cloudscraper/interpreters/nodejs.py"
+               (("'node'")
+                (string-append "'" (which "node") "'")))))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "pytest" "-vv"
+                       "-k" "not 
test_getCookieString_challenge_js_challenge1_16_05_2020")))))))
+    (inputs
+     `(("node" ,node)))
     (propagated-inputs
-     `(("python-requests" ,python-requests)
+     `(("python-js2py" ,python-js2py)
+       ("python-polling2" ,python-polling2)
+       ("python-requests" ,python-requests)
        ("python-requests-toolbelt" ,python-requests-toolbelt-0.9.1)
+       ("python-responses" ,python-responses)
        ("python-pyparsing" ,python-pyparsing-2.4.7)))
     (native-inputs
      `(("python-pytest" ,python-pytest)))



reply via email to

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