diff mbox series

[bug#57092,v3,2/2] gnu: python-tox: Add native-inputs and enable tests.

Message ID 20220820223353.9094-2-ngraves@ngraves.fr
State Accepted
Headers show
Series [bug#57092,v3,1/2] gnu: python-tox: Move from python-xyz.scm to python-check.scm. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Nicolas Graves Aug. 20, 2022, 10:33 p.m. UTC
* gnu/packages/python-check.scm (python-tox): Add native-inputs and enable
tests.
---
 gnu/packages/python-check.scm | 45 ++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 6 deletions(-)

Comments

Nicolas Graves Aug. 20, 2022, 10:45 p.m. UTC | #1
Hi!

A quick note on this patch: you were right, tests were not managed
through setup.py.

Using pytest, I've found quite some failing tests. I haven't tried to
fix them (don't have time for this right now), but they are listed
here. That may seem a lot, but failing tests are a minority (~12%) of
all tests, and most of them are failing with similar error messages.
Ludovic Courtès Aug. 31, 2022, 9:27 p.m. UTC | #2
Hi,

Mathieu & Liliana: should these patches be applied?

Thanks in advance,
Ludo’.

Nicolas Graves <ngraves@ngraves.fr> skribis:

> Hi!
>
> A quick note on this patch: you were right, tests were not managed
> through setup.py.
>
> Using pytest, I've found quite some failing tests. I haven't tried to
> fix them (don't have time for this right now), but they are listed
> here. That may seem a lot, but failing tests are a minority (~12%) of
> all tests, and most of them are failing with similar error messages.
Liliana Marie Prikler Sept. 1, 2022, 6:08 a.m. UTC | #3
Am Mittwoch, dem 31.08.2022 um 23:27 +0200 schrieb Ludovic Courtès:
> Hi,
> 
> Mathieu & Liliana: should these patches be applied?
The ChangeLog of the first patch needs to be rewritten to:

* gnu/packages/python-xyz.scm (python-tox): Move from here...
* gnu/packages/python-check.scm (python-tox): ... to here.

Other than that, if python-tox builds after applying the second patch,
I'd say it's good to go.

Cheers
Ludovic Courtès Sept. 1, 2022, 8:54 a.m. UTC | #4
Hi,

Liliana Marie Prikler <liliana.prikler@gmail.com> skribis:

> The ChangeLog of the first patch needs to be rewritten to:
>
> * gnu/packages/python-xyz.scm (python-tox): Move from here...
> * gnu/packages/python-check.scm (python-tox): ... to here.
>
> Other than that, if python-tox builds after applying the second patch,
> I'd say it's good to go.

OK.  Could you apply it and adjust the commit log accordingly then?

I think we shouldn’t block contributions for small commit log edits.

Thanks,
Ludo’.
Liliana Marie Prikler Sept. 1, 2022, 11:51 a.m. UTC | #5
Am Donnerstag, dem 01.09.2022 um 10:54 +0200 schrieb Ludovic Courtès:
> OK.  Could you apply it and adjust the commit log accordingly then?
> 
> I think we shouldn’t block contributions for small commit log edits.
My intention was to have someone else push it, as I'm currently doing a
pretty large c-u build, but I managed to build python-tox in parallel
without issue.

Besides the ChangeLog, I also converted tox' arguments to G-
Expressions, used when rather than if, and simplified the test filter.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 5d6cf49c50..a5eb06f249 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2438,9 +2438,40 @@  (define-public python-tox
          "0nk0nyzhzamcrvn0qqzzy54isxxqwdi28swml7a2ym78c3f9sqpb"))))
     (build-system python-build-system)
     (arguments
-     ;; FIXME: Tests require pytest-timeout, which itself requires
-     ;; pytest>=2.8.0 for installation.
-     '(#:tests? #f))
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+                 (invoke
+                  "pytest" "-vv"
+                  "-k"
+                  (string-append
+                   "not test_invocation_error "
+                   "and not test_create_KeyboadInterrupt "
+                   "and not test_exit_code "
+                   "and not test_tox_get_python_executable "
+                   "and not test_find_alias_on_path "
+                   "and not test_get_executable "
+                   "and not test_get_executable_no_exist "
+                   "and not test_get_sitepackagesdir_error "
+                   "and not test_spinner_stdout_not_unicode "
+                   "and not test_provision_non_canonical_dep "
+                   "and not test_package_setuptools "
+                   "and not test_package_poetry "
+                   "and not test_parallel_interrupt "
+                   "and not test_provision_missing "
+                   "and not test_provision_from_pyvenv "
+                   "and not test_provision_interrupt_child "
+                   "and not test_create "
+                   "and not test_run_custom_install_command "
+                   "and not test_toxuone_env "
+                   "and not test_different_config_cwd "
+                   "and not test_test_usedevelop "
+                   "and not test_build_backend_without_submodule "
+                   "and not test_parallel "
+                   "and not test_parallel_live "
+                   "and not test_tox_env_var_flags_inserted_isolated "))))))))
     (propagated-inputs
      (list python-filelock
            python-packaging
@@ -2450,9 +2481,11 @@  (define-public python-tox
            python-toml
            python-virtualenv))
     (native-inputs
-     (list ; FIXME: Missing: ("python-pytest-timeout" ,python-pytest-timeout)
-      python-pytest ; >= 2.3.5
-      python-setuptools-scm))
+     (list python-flaky
+           python-pathlib2
+           python-pytest-timeout
+           python-pytest
+           python-setuptools-scm))
     (home-page "https://tox.readthedocs.io")
     (synopsis "Virtualenv-based automation of test activities")
     (description "Tox is a generic virtualenv management and test command line