Add python-flask-compress and python-flask-seasurf

  • Done
  • quality assurance status badge
Details
3 participants
  • kiasoc5
  • Maxime Devos
  • Ricardo Wurmus
Owner
unassigned
Submitted by
kiasoc5
Severity
normal
K
K
kiasoc5 wrote on 27 Mar 2022 21:43
(name . Guix Patches)(address . guix-patches@gnu.org)
MzBtpau--3-2@tutanota.com

From 0d09e7fb5d68f30995663d9ff9621a234678c546 Mon Sep 17 00:00:00 2001
From: kiasoc5 <kiasoc5@tutanota.com>
Date: Sun, 27 Mar 2022 15:27:43 -0400
Subject: [PATCH 1/2] gnu: Add python-flask-compress.

* gnu/packages/python-web.scm (python-flask-compress): New variable.
---
gnu/packages/python-web.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 9c2a48166a..3de2629b29 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6388,3 +6388,23 @@ (define-public python-tweepy
(description "This package provides @code{Tweepy}, an easy-to-use Python
library for accessing the Twitter API.")
(license license:expat)))
+
+(define-public python-flask-compress
+ (package
+ (name "python-flask-compress")
+ (version "1.11")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "Flask-Compress" version))
+ (sha256
+ (base32 "0762n6g1rz1n01dh0y16fgpi262kl01m0z9liv52asvd8hng6sgm"))))
+ (build-system python-build-system)
+ (propagated-inputs (list python-brotli python-flask))
+ (native-inputs (list python-setuptools-scm))
+ (home-page "https://github.com/colour-science/flask-compress")
+ (synopsis
+ "Compress responses in your Flask app with gzip, deflate or brotli.")
+ (description
+ "Compress responses in your Flask app with gzip, deflate or brotli.")
+ (license license:expat)))

base-commit: 2344fb10972a4cefead8e7aa3e0b807da4cf4570
prerequisite-patch-id: 7bac83669fb48a2cf3bf087016093da017ba7ec5
--
2.35.1
From 7664077a8444286755cf82168d7dc2ad7efb06c1 Mon Sep 17 00:00:00 2001
From: kiasoc5 <kiasoc5@tutanota.com>
Date: Sun, 27 Mar 2022 15:27:59 -0400
Subject: [PATCH 2/2] gnu: Add python-flask-seasurf.

* gnu/packages/python-web.scm (python-flask-seasurf): New variable.
---
gnu/packages/python-web.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 3de2629b29..931d1500b7 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6408,3 +6408,28 @@ (define-public python-flask-compress
(description
"Compress responses in your Flask app with gzip, deflate or brotli.")
(license license:expat)))
+
+(define-public python-flask-seasurf
+ (package
+ (name "python-flask-seasurf")
+ (version "0.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "Flask-SeaSurf" version))
+ (sha256
+ (base32 "04yfwln40iji7vn517mmkflnzxy7wa11yfhs124rch4s7pqhvygz"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "python" "-m" "unittest")))))))
+ (propagated-inputs (list python-flask))
+ (native-inputs (list python-tox))
+ (home-page "https://github.com/maxcountryman/flask-seasurf/")
+ (synopsis "An updated CSRF extension for Flask.")
+ (description "An updated CSRF extension for Flask.")
+ (license license:bsd-3)))
--
2.35.1
M
M
Maxime Devos wrote on 27 Mar 2022 21:47
43942589dee617ec9eb65bc9bb12d27407a50a3a.camel@telenet.be
kiasoc5--- via Guix-patches via schreef op zo 27-03-2022 om 21:43
[+0200]:
Toggle quote (7 lines)
> +    (synopsis
> +      "Compress responses in your Flask app with gzip, deflate or
> brotli.")
> +    (description
> +      "Compress responses in your Flask app with gzip, deflate or
> brotli.")

The description is missing, and ‘do foo in your Brand(TM) app’ reads
like marketing. ’(guix)Synopses and Descriptions’ recommends longer,
and more descriptive, descriptions. E.g., what do ‘responses’ mean
here? Is it Flask-exclusive, or can it also be used outside a Flask
context?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkC/VhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7i5iAQDQiXxdJjF2Pxyz+HJZp41AUTpe
tPslPheZZ4jwwCrchgD9Fu2mXALBTuRyRsWlmubfh5f0S+88Uqx3X12VHPdWYg0=
=PJn/
-----END PGP SIGNATURE-----


K
K
kiasoc5 wrote on 27 Mar 2022 22:49
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 54601@debbugs.gnu.org)
MzC86GU--3-2@tutanota.com
Mar 27, 2022, 19:47 by maximedevos@telenet.be:

Toggle quote (17 lines)
> kiasoc5--- via Guix-patches via schreef op zo 27-03-2022 om 21:43
> [+0200]:
>
>> +    (synopsis
>> +      "Compress responses in your Flask app with gzip, deflate or
>> brotli.")
>> +    (description
>> +      "Compress responses in your Flask app with gzip, deflate or
>> brotli.")
>>
>
> The description is missing, and ‘do foo in your Brand(TM) app’ reads
> like marketing. ’(guix)Synopses and Descriptions’ recommends longer,
> and more descriptive, descriptions. E.g., what do ‘responses’ mean
> here? Is it Flask-exclusive, or can it also be used outside a Flask
> context?
>
Forgot to check that. Please see updated patches. Also removed unneeded python-tox input.

Toggle quote (3 lines)
> Greetings,
> Maxime.
>
From 35aa7b6052b1096ec1d4279cda31b0cdb8484ba0 Mon Sep 17 00:00:00 2001
From: kiasoc5 <kiasoc5@tutanota.com>
Date: Sun, 27 Mar 2022 15:27:43 -0400
Subject: [PATCH 1/2] gnu: Add python-flask-compress.

* gnu/packages/python-web.scm (python-flask-compress): New variable.
---
gnu/packages/python-web.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 9c2a48166a..38164d8243 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6388,3 +6388,26 @@ (define-public python-tweepy
(description "This package provides @code{Tweepy}, an easy-to-use Python
library for accessing the Twitter API.")
(license license:expat)))
+
+(define-public python-flask-compress
+ (package
+ (name "python-flask-compress")
+ (version "1.11")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "Flask-Compress" version))
+ (sha256
+ (base32
+ "0762n6g1rz1n01dh0y16fgpi262kl01m0z9liv52asvd8hng6sgm"))))
+ (build-system python-build-system)
+ (propagated-inputs (list python-brotli python-flask))
+ (native-inputs (list python-setuptools-scm))
+ (home-page "https://github.com/colour-science/flask-compress")
+ (synopsis "Compress Flask application responses and static files.")
+ (description
+ "Compress Flask application responses and static files with gzip, deflate and brotli without
+a server (like Nginx). Flask-Compress both adds the various headers required for a compressed response
+and compresses the response data. Internally, every time a request is made the extension will check
+if it matches one of the compressible MIME types and whether the client and the server use some common
+compression algorithm, and will automatically attach the appropriate headers.")
+ (license license:expat)))

base-commit: 2344fb10972a4cefead8e7aa3e0b807da4cf4570
prerequisite-patch-id: 7bac83669fb48a2cf3bf087016093da017ba7ec5
--
2.35.1
From 7406000b099aca3dfaa2cf152e2b4fa1581e60f6 Mon Sep 17 00:00:00 2001
From: kiasoc5 <kiasoc5@tutanota.com>
Date: Sun, 27 Mar 2022 15:27:59 -0400
Subject: [PATCH 2/2] gnu: Add python-flask-seasurf.

* gnu/packages/python-web.scm (python-flask-seasurf): New variable.
---
gnu/packages/python-web.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 38164d8243..3b70ea7843 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6411,3 +6411,30 @@ (define-public python-flask-compress
if it matches one of the compressible MIME types and whether the client and the server use some common
compression algorithm, and will automatically attach the appropriate headers.")
(license license:expat)))
+
+(define-public python-flask-seasurf
+ (package
+ (name "python-flask-seasurf")
+ (version "0.3.1")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "Flask-SeaSurf" version))
+ (sha256
+ (base32
+ "04yfwln40iji7vn517mmkflnzxy7wa11yfhs124rch4s7pqhvygz"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "python" "-m" "unittest")))))))
+ (propagated-inputs (list python-flask))
+ (home-page "https://github.com/maxcountryman/flask-seasurf")
+ (synopsis "Cross-site request forgery (CSRF) extension for Flask.")
+ (description
+ "SeaSurf is a Flask extension for preventing cross-site request forgery (CSRF).
+CSRF attacks are problematic because the mechanism they use is relatively easy to exploit. This
+extension attempts to aid you in securing your application from such attacks. This extension is
+based on the Django middleware.")
+ (license license:bsd-3)))
--
2.35.1
M
M
Maxime Devos wrote on 28 Mar 2022 14:22
(address . kiasoc5@tutanota.com)(address . 54601@debbugs.gnu.org)
9c5cf079a86c74516dccc7260f9a2c8b0bb95783.camel@telenet.be
kiasoc5@tutanota.com schreef op zo 27-03-2022 om 22:49 [+0200]:
Toggle quote (14 lines)
> +    (synopsis "Compress Flask application responses and static
> files.")
> +    (description
> +     "Compress Flask application responses and static files with
> gzip, deflate and brotli without
> +a server (like Nginx). Flask-Compress both adds the various headers
> required for a compressed response
> +and compresses the response data. Internally, every time a request
> is made the extension will check
> +if it matches one of the compressible MIME types and whether the
> client and the server use some common
> +compression algorithm, and will automatically attach the appropriate
> headers.")

The new descriptions look nice.

Greetings,
Maxime.
R
R
Ricardo Wurmus wrote on 10 Jul 2023 13:29
Add python-flask-compress and python-flask-seasurf
(address . 54601-done@debbugs.gnu.org)
87leforolt.fsf@elephly.net
I updated the patches for the latest versions, used the
pyproject-build-system, and trimmed the descriptions a bit.

Pushed to the master branch. Thank you!

--
Ricardo
Closed
?