Skip to content

Commit 519b62c

Browse files
author
Release Manager
committed
gh-35372: Replace more `.all` imports <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description This is a follow-up on: - #35110 As preparation for #35322, which is changing more packages to implicit namespace packages, we remove `.all` imports from these packages throughout the Sage library. This is part of: - #29705 <!-- Describe your changes here in detail. --> <!-- 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 #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] 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 - #12345: short description why this is a dependency - #34567: ... --> - Depends on #35418 - Depends on #35358 <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35372 Reported by: Matthias Köppe Reviewer(s): Gonzalo Tornaría
2 parents f091c75 + 4ac23e6 commit 519b62c

File tree

63 files changed

+99
-628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+99
-628
lines changed

src/.relint.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
- name: 'python3: Python3 incompatible code'
77
hint: |
88
# ifilter, imap, izip # __metaclass__
9-
Hint: # update raise statements # except Exception, var
10-
Hint: # six is no longer allowed
9+
# update raise statements # except Exception, var
10+
# six is no longer allowed
1111
pattern: '(import.*[, ]ifilter|import.*[, ]imap|import.*[, ]izip|^\s*raise\s*[A-Za-z]*Error\s*,|__metaclass__|except\s*[A-Za-z]\s*,|import six|from six import)'
1212
filePattern: .*[.](py|pyx|rst)
1313

@@ -20,9 +20,9 @@
2020
- name: 'blocks: wrong syntax for blocks (INPUT, OUTPUT, EXAMPLES, NOTE, etc.)'
2121
hint: |
2222
# the correct syntax is .. SEEALSO::
23-
Hint: # TESTS and EXAMPLES should be plural, NOTE singular
24-
Hint: # no :: after INPUT, OUTPUT, REFERENCE blocks
25-
Hint: # no " :" at the end of lines
23+
# TESTS and EXAMPLES should be plural, NOTE singular
24+
# no :: after INPUT, OUTPUT, REFERENCE blocks
25+
# no " :" at the end of lines
2626
pattern: '(\.\.SEE|SEE ALSO|SEEALSO:($|[^:])|^\s*TEST:|^\s*EXAMPLE:|^\s*NOTES:|^\s*[A-Z]*PUT::|^\s*REFERENCES?::$)'
2727

2828
- name: 'trac_links: bad trac link'
@@ -46,10 +46,10 @@
4646
- name: 'namespace_pkg_all_import: import from .all of a namespace package'
4747
hint: |
4848
Sage library code should not import from sage.PAC.KAGE.all when sage.PAC.KAGE is an implicit
49-
Hint: namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import,
50-
Hint: or use 'sage --fiximports' to fix automatically in the source file.
49+
namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import,
50+
or use 'sage --fiximports' to fix automatically in the source file.
5151
# Keep in sync with SAGE_ROOT/src/sage/misc/replace_dot_all.py
52-
pattern: 'from\s+sage(|[.](arith|categories|combinat|ext|graphs(|[.]decompositions)|interfaces|libs|matrix|misc|numerical(|[.]backends)|rings(|[.]finite_rings)|sets))[.]all\s+import'
52+
pattern: 'from\s+sage(|[.](arith|categories|combinat|crypto|databases|data_structures|dynamics|ext|game_theory|games|graphs|groups|interfaces|manifolds|matrix|matroids|misc|modules|monoids|numerical|probability|quadratic_forms|quivers|rings|sat|schemes|sets|stats|tensor)[a-z0-9_.]*|[.]libs)[.]all\s+import'
5353
# imports from .all are allowed in all.py; also allow in some modules that need sage.all
5454
filePattern: '(.*/|)(?!(all|benchmark|dev_tools|parsing|sage_eval))[^/.]*[.](py|pyx|pxi)$'
5555

src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AUTHOR:
1717
# https://www.gnu.org/licenses/
1818
# ****************************************************************************
1919

20-
from sage.groups.perm_gps.all import CyclicPermutationGroup
20+
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
2121
from sage.libs.singular.function import lib, singular_function
2222
from sage.misc.repr import repr_lincomb
2323
from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal

src/sage/algebras/letterplace/free_algebra_letterplace.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ cdef class FreeAlgebra_letterplace(Algebra):
684684
ngens = self.__ngens
685685
degbound = self._degbound
686686
cdef list G = [C(x._poly) for x in g]
687-
from sage.groups.perm_gps.all import CyclicPermutationGroup
687+
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
688688
CG = CyclicPermutationGroup(C.ngens())
689689
for y in G:
690690
out.extend([y] + [y * CG[ngens * (n + 1)]

src/sage/categories/finite_complex_reflection_groups.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ def noncrossing_partition_lattice(self, c=None, L=None,
854854
sage: sorted( w.reduced_word() for w in W.noncrossing_partition_lattice(W.from_reduced_word([2])) ) # optional - gap3
855855
[[], [2]]
856856
"""
857-
from sage.combinat.posets.all import Poset, LatticePoset
857+
from sage.combinat.posets.posets import Poset
858+
from sage.combinat.posets.lattices import LatticePoset
858859

859860
R = self.reflections()
860861
if L is None:

src/sage/coding/ag_code_decoders.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ AUTHORS:
6161
cimport cython
6262

6363
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
64-
from sage.rings.function_field.all import FunctionField
64+
from sage.rings.function_field.constructor import FunctionField
6565

6666
from sage.modules.free_module_element import vector
6767
from sage.matrix.constructor import matrix

src/sage/coding/linear_code.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class should inherit from this class. Also ``AbstractLinearCode`` should never
217217
from sage.combinat.subset import Subsets
218218
from sage.cpython.string import bytes_to_str
219219
from sage.features.gap import GapPackage
220-
from sage.groups.all import SymmetricGroup
220+
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
221221
from sage.groups.perm_gps.permgroup import PermutationGroup
222222
from sage.interfaces.gap import gap
223223
from sage.matrix.matrix_space import MatrixSpace

0 commit comments

Comments
 (0)