Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test in GH action "build", on file sage_setup/clean.py #37216

Closed
2 tasks done
drago-96 opened this issue Feb 1, 2024 · 0 comments · Fixed by #37185
Closed
2 tasks done

Failing test in GH action "build", on file sage_setup/clean.py #37216

drago-96 opened this issue Feb 1, 2024 · 0 comments · Fixed by #37185
Labels

Comments

@drago-96
Copy link
Contributor

drago-96 commented Feb 1, 2024

Steps To Reproduce

Open the "build" action on almost any recent PR (for example, this one) and notice that the test on the file sage_setup/clean.py fails because it finds stale files in some __pycache__ directories (in particular, the one related to books "Computational Mathematics with Sagemath" and Judson's "Abstract Algebra").

Expected Behavior

No test failures

Actual Behavior

Testing fails with the following ouput (consistent between different PRs)

File "sage_setup/clean.py", line 104, in sage_setup.clean._find_stale_files
Failed example:
    for f in stale_iter:
        if f.endswith(skip_extensions): continue
        if '/ext_data/' in f: continue
        print('Found stale file: ' + f)
Expected nothing
Got:
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/float_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/integration_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/combinat_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/programmation_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/mpoly_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/calculus_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/polynomes_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/premierspas_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/domaines_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/lp_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/recequadiff_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/nonlinear_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/numbertheory_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/graphtheory_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/linsolve_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/__init__.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/linalg_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/__pycache__/graphique_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/float_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/integration_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/combinat_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/mpoly_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/calculus_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/polynomes_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/domaines_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/lp_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/recequadiff_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/nonlinear_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/numbertheory_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/graphtheory_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/linsolve_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/__init__.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/linalg_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/computational-mathematics-with-sagemath/sol/__pycache__/graphique_doctest.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/isomorph-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/actions-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/finite-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/boolean-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/struct-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/fields-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/vect-sage-exercises.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/cosets-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/permute-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/algcodes-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/crypt-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/galois-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/integers-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/homomorph-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/rings-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/homomorph-sage-exercises.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/sets-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/vect-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/sylow-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/groups-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/actions-sage-exercises.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/normal-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/cyclic-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/__init__.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/cosets-sage-exercises.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/poly-sage.cpython-311.pyc
    Found stale file: sage/tests/books/judson-abstract-algebra/__pycache__/domains-sage.cpython-311.pyc

Additional Information

If on my local installation I run ./sage -t src/sage/tests/books/computational-mathematics-with-sagemath no __pycache__ folder is created. I do not know what is responsible for this.

Environment

- GitHub Actions runner

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@drago-96 drago-96 added the t: bug label Feb 1, 2024
vbraun pushed a commit to vbraun/sage that referenced this issue Feb 11, 2024
sagemathgh-37185: Fix `sage_setup.clean` doctest
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
As reported in https://groups.google.com/g/sage-
devel/c/mLtXcaypU3Q/m/jHoVjQ9oAAAJ @kwankyu

This failure was introduced as a side effect of sagemath#36591: The pytest
discovery of modules disagrees with `sage_setup`'s notion of package
directories vs. data directories. We repair it by making
`sage.tests.books` an ordinary package directory (correct because the
whole thing is shipped by **sagemath-repl**).

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
Fixes sagemath#37216
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#37185
Reported by: Matthias Köppe
Reviewer(s): Gonzalo Tornaría
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant