[PATCH] gnu: python-wtforms: Update to 2.3.3.

  • Done
  • quality assurance status badge
Details
4 participants
  • Ben Sturmfels
  • jgart
  • Vinicius Monego
  • Raghav Gururajan
Owner
unassigned
Submitted by
jgart
Severity
normal
J
(address . guix-patches@gnu.org)
432e457285cdabe78e9db89f760a387c@dismail.de
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
V
V
Vinicius Monego wrote on 8 Jul 2021 01:29
(address . 47910@debbugs.gnu.org)
ca4ae1c43a11cd58da51929042d2697f0ff4c64f.camel@posteo.net
Hi,

Toggle quote (3 lines)
> I have not been able to successfully run all the tests without using
> tox manually.

[...]

Toggle quote (2 lines)
> 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:

Toggle quote (3 lines)
> 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).

Toggle quote (3 lines)
> 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



B
B
Ben Sturmfels wrote on 25 Aug 2021 02:57
(name . jgart)(address . jgart@dismail.de)
875yvunxxe.fsf_-_@sturm.com.au
Hi Jgart,

Toggle quote (26 lines)
>> 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
R
R
Raghav Gururajan wrote on 12 Sep 2021 01:37
[PATCH] gnu: python-wtforms: Update to 2.3.3 and adjust arguments+inputs.
(address . 47910@debbugs.gnu.org)
20210911233731.2325-1-rg@raghavgururajan.name
* 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(-)

Toggle diff (52 lines)
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
R
R
Raghav Gururajan wrote on 12 Sep 2021 01:46
(address . 47910@debbugs.gnu.org)
20210911234620.3037-1-rg@raghavgururajan.name
* 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(-)

Toggle diff (53 lines)
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
R
Closed
?