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.
This commit is contained in:
Ricardo Wurmus 2021-11-30 20:49:18 +01:00
parent 3b74b41498
commit e4e50229f1
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -79,6 +79,7 @@ (define-module (gnu packages python-web)
#: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 @@ (define-public python-http-ece
(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 @@ (define-public python-cloudscraper
(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)))