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

Fix randrange deprecation warning with python-3.10 #33234

Closed
orlitzky opened this issue Jan 27, 2022 · 12 comments
Closed

Fix randrange deprecation warning with python-3.10 #33234

orlitzky opened this issue Jan 27, 2022 · 12 comments

Comments

@orlitzky
Copy link
Contributor

.../sage/rings/qqbar.py:2863: DeprecationWarning: non-integer arguments to randrange() have been deprecated since Python 3.10 and will be removed in a subsequent version
  roots = p.roots(ring, False)

Component: porting

Author: Michael Orlitzky

Branch: eabf53c

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/33234

@orlitzky orlitzky added this to the sage-9.6 milestone Jan 27, 2022
@orlitzky
Copy link
Contributor Author

Author: Michael Orlitzky

@orlitzky
Copy link
Contributor Author

New commits:

eabf53cTrac #33234: fix python-3.10 deprecation warning in polynomial roots.

@orlitzky
Copy link
Contributor Author

Commit: eabf53c

@orlitzky
Copy link
Contributor Author

Branch: u/mjo/ticket/33234

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:2

ok

@vbraun
Copy link
Member

vbraun commented Feb 28, 2022

comment:3
**********************************************************************
72
File "src/sage/schemes/cyclic_covers/charpoly_frobenius.py", line 146, in sage.schemes.cyclic_covers.charpoly_frobenius.charpoly_frobenius
73
Failed example:
74
    charpoly_frobenius(M,
75
    [31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,
76
     15, 14, 13, 12] + [11]*21, 1129, 1, 1)
77
Exception raised:
78
    Traceback (most recent call last):
79
      File "/var/home/agent-99/actions-runner/_work/sage/sage/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 694, in _run
80
        self.compile_and_execute(example, compiler, test.globs)
81
      File "/var/home/agent-99/actions-runner/_work/sage/sage/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
82
        exec(compiled, globs)
83
      File "<doctest sage.schemes.cyclic_covers.charpoly_frobenius.charpoly_frobenius[17]>", line 1, in <module>
84
        charpoly_frobenius(M,
85
      File "/var/home/agent-99/actions-runner/_work/sage/sage/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/schemes/cyclic_covers/charpoly_frobenius.py", line 208, in charpoly_frobenius
86
        assert cp[-1] == 1
87
    AssertionError
88
**********************************************************************
89
1 item had failures:
90
   1 of  22 in sage.schemes.cyclic_covers.charpoly_frobenius.charpoly_frobenius
91
    [21 tests, 1 failure, 0.26 s]
92
----------------------------------------------------------------------
93
sage -t --long --warn-long 40.9 --random-seed=123 src/sage/schemes/cyclic_covers/charpoly_frobenius.py  # 1 doctest failed
94
----------------------------------------------------------------------
95

@orlitzky
Copy link
Contributor Author

comment:4

Whatever that failure was, I don't think it was caused by this change:

$ sage -t --long --random-seed=123 src/sage/schemes/cyclic_covers/charpoly_frobenius.py
Running doctests with ID 2022-04-30-06-40-43-a8b7a991.
Git branch: u/mjo/ticket/33234
Using --optional=gentoo,pip,sage,sage_spkg
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,gfan,graphviz,imagemagick,jupymake,kenzo,latte_int,lrslib,mcqd,meataxe,nauty,palp,pandoc,pdf2svg,pdftocairo,plantri,polytopes_db,polytopes_db_4d,pynormaliz,python_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.plot,sage.rings.number_field,sage.rings.padics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,sphinx,tdlib
Doctesting 1 file.
sage -t --long --warn-long 276.9 --random-seed=123 src/sage/schemes/cyclic_covers/charpoly_frobenius.py
    [21 tests, 0.75 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.9 seconds
    cpu time: 0.8 seconds
    cumulative wall time: 0.8 seconds
Features detected for doctesting: 
pytest is not installed in the venv, skip checking tests that rely on it

@fchapoton
Copy link
Contributor

comment:5

indeed, so let's try again

@vbraun
Copy link
Member

vbraun commented May 24, 2022

Changed branch from u/mjo/ticket/33234 to eabf53c

@maxale
Copy link
Contributor

maxale commented Jul 23, 2022

comment:7

The issue with randrange deprecation seems to be more widespread - see #34202 for another instance.

@maxale
Copy link
Contributor

maxale commented Jul 23, 2022

Changed commit from eabf53c to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants