all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3.
@ 2021-04-20 17:28 jgart via Guix-patches via
  2021-07-07 23:29 ` Vinicius Monego
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: jgart via Guix-patches via @ 2021-04-20 17:28 UTC (permalink / raw)
  To: 47910; +Cc: Tobias Geerinckx-Rice, ben

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

Hi Guix,

This is related to 47260.

Attached is a patch for an upgrade to python-wtforms 2.3.3.

Tests are currently disabled in the attached patch. 

I added a when form in the code for when we are ready to enable the tests.

I'm getting the following error when I try to run the tests with tox:

error: [Errno 13] Permission denied: 'WTForms-2.3.3/setup.cfg'

Should I be using make-file-writable on the above or is this a different issue?

I have not been able to successfully run all the tests without using tox manually. 

See the comment I placed in the patch with a link to the github issue that I opened upstream.

Help and/or advice with testing this is much appreciated. 

What is the consensus for using tox with guix?

I see only one other package in the guix source tree that is currently invoking tox and that package is broken: python-funcparserlib.

python-hy is also broken (it depends on python-funcparserlib and fails because of it)

I think Tobias is currently working on those.

all the best,

jgart

[-- Attachment #2: 0001-gnu-python-wtforms-Update-to-2.3.3.patch --]
[-- Type: application/octet-stream, Size: 3086 bytes --]

From 7104474743af0575e68293384612458abe866917 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Mon, 19 Apr 2021 03:09:57 -0400
Subject: [PATCH] gnu: python-wtforms: Update to 2.3.3.

    * gnu/packages/python-xyz.scm (python-wtforms): Update to 2.3.3.

    Co-authored-by: Ben Sturmfels <ben@sturm.com.au>
---
 gnu/packages/python-web.scm | 39 ++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4f34502e86..533086d8f9 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3000,7 +3000,7 @@ presume or force a developer to use a particular tool or library.")
        ("python-babel" ,python-babel)
        ("python-wtforms" ,python-wtforms)))
     (native-inputs
-     `(("python-pytest" ,python-pytest)))
+     `(("python-tox" ,python-tox)))
     (home-page "https://github.com/lepture/flask-wtf")
     (synopsis "Simple integration of Flask and WTForms")
     (description "Flask-WTF integrates Flask and WTForms, including CSRF, file
@@ -4122,29 +4122,36 @@ addon modules.")
 (define-public python-wtforms
   (package
     (name "python-wtforms")
-    (version "2.1")
+    (version "2.3.3")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "WTForms" version ".zip"))
+       (method git-fetch)
+       (uri (git-reference 
+            (url "https://github.com/wtforms/wtforms")
+            (commit version)))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "0vyl26y9cg409cfyj8rhqxazsdnd0jipgjw06civhrd53yyi1pzz"))))
+         "0aix0655k8cbylpxi6lgyakigg51iy6bhj248g7d26d0mcpwl6mi"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
+     `(#:tests? #f
+       #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'remove-django-test
-           ;; Don't fail the tests when the inputs for the optional tests cannot be found.
-           (lambda _
-             (substitute*
-               "tests/runtests.py"
-               (("'ext_django.tests', 'ext_sqlalchemy', 'ext_dateutil', 'locale_babel'") "")
-               (("sys.stderr.write(\"### Disabled test '%s', dependency not found\n\" % name)") ""))
-             #t)))))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               ;; see https://github.com/wtforms/wtforms/issues/687
+               (invoke "tox"))))))) 
     (native-inputs
-     `(("unzip" ,unzip)))
-    (home-page "http://wtforms.simplecodes.com/")
+     `(("python-tox" ,python-tox)
+       ("python-babel" ,python-babel)
+       ("python-pytest" ,python-pytest)
+       ("python-coverage" ,python-coverage)))
+    (propagated-inputs
+     `(("python-markupsafe" ,python-markupsafe)
+       ("python-email-validator" ,python-email-validator)))
+    (home-page "http://wtforms.readthedocs.io")
     (synopsis
      "Form validation and rendering library for Python web development")
     (description
-- 
2.29.3


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

* [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3.
  2021-04-20 17:28 [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 jgart via Guix-patches via
@ 2021-07-07 23:29 ` Vinicius Monego
  2021-08-25  0:57   ` Ben Sturmfels via Guix-patches via
  2021-09-11 23:37 ` [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 and adjust arguments+inputs Raghav Gururajan via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Vinicius Monego @ 2021-07-07 23:29 UTC (permalink / raw)
  To: 47910

Hi,

> I have not been able to successfully run all the tests without using
> tox manually.

[...]

> What is the consensus for using tox with guix?

Tox is an environment manager. As such, it is redundant in Guix. Tox is
not a hard requirement for tests in any project.

You can inspect the tox.ini file that is shipped in projects. This is
the tox.ini from wtforms, in the 2.3.3 tag: [1]. Note that the test
command that tox will run is:

> python setup.py compile_catalog
> coverage run tests/runtests.py --with-pep8

After running these commands in the custom check phase, I could
succesfully run the tests. I also added python-sqlalchemy and python-
dateutil to native-inputs.

Note that it requires django<1.7 which we don't have, but it's
optional. It seems that the testing command will change again in
version 3 to a standard pytest call and the legacy dependencies will be
removed [2] (also see tox.ini in the master branch).

> python-hy is also broken (it depends on python-funcparserlib and
> fails because of it)

funcparserlib is broken because version 0.3.6 is compatible with only
up to Python 3.5 (it was released in 2013). There should be a 1.0.0
release this year [3] and it doesn't seem that 0.3.6 can be fixed from
our side.

It does not depend on tox either. Once 1.0.0 is released and packaged,
tox can be removed and it should run without replacing the check phase
(it uses unittest). Tox is still there because that package is
currently stagnating.

Vinicius

[1] https://github.com/wtforms/wtforms/blob/2.3.3/tox.ini

[2] https://github.com/wtforms/wtforms/commit/c49ecfb7e76f919eafb5c6a11c3b795c4e613757

[3] https://github.com/vlasovskikh/funcparserlib/issues/65





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

* [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3.
  2021-07-07 23:29 ` Vinicius Monego
@ 2021-08-25  0:57   ` Ben Sturmfels via Guix-patches via
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Sturmfels via Guix-patches via @ 2021-08-25  0:57 UTC (permalink / raw)
  To: jgart; +Cc: Vinicius Monego, 47910

Hi Jgart,

>> I have not been able to successfully run all the tests without using
>> tox manually.
>
> [...]
>
>> What is the consensus for using tox with guix?
>
> Tox is an environment manager. As such, it is redundant in Guix. Tox is
> not a hard requirement for tests in any project.
>
> You can inspect the tox.ini file that is shipped in projects. This is
> the tox.ini from wtforms, in the 2.3.3 tag: [1]. Note that the test
> command that tox will run is:
>
>> python setup.py compile_catalog
>> coverage run tests/runtests.py --with-pep8
>
> After running these commands in the custom check phase, I could
> succesfully run the tests. I also added python-sqlalchemy and python-
> dateutil to native-inputs.
>
> Note that it requires django<1.7 which we don't have, but it's
> optional. It seems that the testing command will change again in
> version 3 to a standard pytest call and the legacy dependencies will be
> removed [2] (also see tox.ini in the master branch).

Vinicius's approach his makes sense to me - we only need to test wtforms on the version of Python in Guix, not all possible versions the library supports. Would you be able to proceed with calling the tests as Vinicius describes?

This is the last dependency we need to package MediaGoblin! Very exciting!

Regards,
Ben




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

* [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 and adjust arguments+inputs.
  2021-04-20 17:28 [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 jgart via Guix-patches via
  2021-07-07 23:29 ` Vinicius Monego
@ 2021-09-11 23:37 ` Raghav Gururajan via Guix-patches via
  2021-09-11 23:46 ` Raghav Gururajan via Guix-patches via
  2021-09-11 23:48 ` bug#47910: python-wtforms Raghav Gururajan via Guix-patches via
  3 siblings, 0 replies; 6+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-09-11 23:37 UTC (permalink / raw)
  To: 47910; +Cc: Raghav Gururajan, jgart, ben

* gnu/packages/python-web.scm (python-wtforms)[version]: Update to 2.3.3.
[phases](remove-django-test): Remove phase.
(check): Replace with custom phase.
[native-inputs]: Remove unzip. Add python-babel, python-coverage,
python-dateutil, python-pep8 and python-sqlalchemy.
[propagated-inputs]: Add python-markupsafe.

Co-authored-by: jgart <jgart@dismail.de>
---
 gnu/packages/python-web.scm | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 32b4aa4bf0..73361ad584 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -4150,28 +4150,32 @@ addon modules.")
 (define-public python-wtforms
   (package
     (name "python-wtforms")
-    (version "2.1")
+    (version "2.3.3")
     (source
      (origin
        (method url-fetch)
-       (uri (pypi-uri "WTForms" version ".zip"))
+       (uri (pypi-uri "WTForms" version ".tar.gz"))
        (sha256
         (base32
-         "0vyl26y9cg409cfyj8rhqxazsdnd0jipgjw06civhrd53yyi1pzz"))))
+         "17427m7p9nn9byzva697dkykykwcp2br3bxvi8vciywlmkh5s6c1"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'remove-django-test
-           ;; Don't fail the tests when the inputs for the optional tests cannot be found.
-           (lambda _
-             (substitute*
-               "tests/runtests.py"
-               (("'ext_django.tests', 'ext_sqlalchemy', 'ext_dateutil', 'locale_babel'") "")
-               (("sys.stderr.write(\"### Disabled test '%s', dependency not found\n\" % name)") ""))
-             #t)))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "setup.py" "compile_catalog")
+               (invoke "coverage" "run" "tests/runtests.py" "--with-pep8")))))))
     (native-inputs
-     `(("unzip" ,unzip)))
+     `(("python-babel" ,python-babel)
+       ("python-coverage" ,python-coverage)
+       ("python-dateutil" ,python-dateutil)
+       ("python-pep8" ,python-pep8)
+       ("python-sqlalchemy" ,python-sqlalchemy)))
+    (propagated-inputs
+     `(("python-markupsafe" ,python-markupsafe)))
     (home-page "http://wtforms.simplecodes.com/")
     (synopsis
      "Form validation and rendering library for Python web development")
-- 
2.33.0





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

* [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 and adjust arguments+inputs.
  2021-04-20 17:28 [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 jgart via Guix-patches via
  2021-07-07 23:29 ` Vinicius Monego
  2021-09-11 23:37 ` [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 and adjust arguments+inputs Raghav Gururajan via Guix-patches via
@ 2021-09-11 23:46 ` Raghav Gururajan via Guix-patches via
  2021-09-11 23:48 ` bug#47910: python-wtforms Raghav Gururajan via Guix-patches via
  3 siblings, 0 replies; 6+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-09-11 23:46 UTC (permalink / raw)
  To: 47910; +Cc: Raghav Gururajan, jgart, ben

* gnu/packages/python-web.scm (python-wtforms)[version]: Update to 2.3.3.
[phases](remove-django-test): Remove phase.
(check): Replace with custom phase.
[native-inputs]: Remove unzip. Add python-coverage, python-dateutil,
python-pep8 and python-sqlalchemy.
[propagated-inputs]: Add python-babel, python-email-validaor and
python-markupsafe.

Co-authored-by: jgart <jgart@dismail.de>
---
 gnu/packages/python-web.scm | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 32b4aa4bf0..bd390d371d 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -4150,28 +4150,33 @@ addon modules.")
 (define-public python-wtforms
   (package
     (name "python-wtforms")
-    (version "2.1")
+    (version "2.3.3")
     (source
      (origin
        (method url-fetch)
-       (uri (pypi-uri "WTForms" version ".zip"))
+       (uri (pypi-uri "WTForms" version ".tar.gz"))
        (sha256
         (base32
-         "0vyl26y9cg409cfyj8rhqxazsdnd0jipgjw06civhrd53yyi1pzz"))))
+         "17427m7p9nn9byzva697dkykykwcp2br3bxvi8vciywlmkh5s6c1"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'remove-django-test
-           ;; Don't fail the tests when the inputs for the optional tests cannot be found.
-           (lambda _
-             (substitute*
-               "tests/runtests.py"
-               (("'ext_django.tests', 'ext_sqlalchemy', 'ext_dateutil', 'locale_babel'") "")
-               (("sys.stderr.write(\"### Disabled test '%s', dependency not found\n\" % name)") ""))
-             #t)))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "setup.py" "compile_catalog")
+               (invoke "coverage" "run" "tests/runtests.py" "--with-pep8")))))))
     (native-inputs
-     `(("unzip" ,unzip)))
+     `(("python-coverage" ,python-coverage)
+       ("python-dateutil" ,python-dateutil)
+       ("python-pep8" ,python-pep8)
+       ("python-sqlalchemy" ,python-sqlalchemy)))
+    (propagated-inputs
+     `(("python-babel" ,python-babel)
+       ("python-email-validator" ,python-email-validator)
+       ("python-markupsafe" ,python-markupsafe)))
     (home-page "http://wtforms.simplecodes.com/")
     (synopsis
      "Form validation and rendering library for Python web development")
-- 
2.33.0





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

* bug#47910: python-wtforms
  2021-04-20 17:28 [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 jgart via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-09-11 23:46 ` Raghav Gururajan via Guix-patches via
@ 2021-09-11 23:48 ` Raghav Gururajan via Guix-patches via
  3 siblings, 0 replies; 6+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-09-11 23:48 UTC (permalink / raw)
  To: 47910-done; +Cc: jgart, ben


[-- Attachment #1.1.1: Type: text/plain, Size: 45 bytes --]

Pushed to master as 87ec1ae95c..73f68c1a45.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

end of thread, other threads:[~2021-09-11 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 17:28 [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 jgart via Guix-patches via
2021-07-07 23:29 ` Vinicius Monego
2021-08-25  0:57   ` Ben Sturmfels via Guix-patches via
2021-09-11 23:37 ` [bug#47910] [PATCH] gnu: python-wtforms: Update to 2.3.3 and adjust arguments+inputs Raghav Gururajan via Guix-patches via
2021-09-11 23:46 ` Raghav Gururajan via Guix-patches via
2021-09-11 23:48 ` bug#47910: python-wtforms Raghav Gururajan via Guix-patches via

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.