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

Replace more .all imports #35372

Merged
merged 8 commits into from
Apr 6, 2023
16 changes: 8 additions & 8 deletions src/.relint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
- name: 'python3: Python3 incompatible code'
hint: |
# ifilter, imap, izip # __metaclass__
Hint: # update raise statements # except Exception, var
Hint: # six is no longer allowed
# update raise statements # except Exception, var
# six is no longer allowed
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)'
filePattern: .*[.](py|pyx|rst)

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

- name: 'trac_links: bad trac link'
Expand All @@ -46,10 +46,10 @@
- name: 'namespace_pkg_all_import: import from .all of a namespace package'
hint: |
Sage library code should not import from sage.PAC.KAGE.all when sage.PAC.KAGE is an implicit
Hint: namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import,
Hint: or use 'sage --fiximports' to fix automatically in the source file.
namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import,
or use 'sage --fiximports' to fix automatically in the source file.
# Keep in sync with SAGE_ROOT/src/sage/misc/replace_dot_all.py
pattern: 'from\s+sage(|[.](arith|categories|combinat|ext|graphs(|[.]decompositions)|interfaces|libs|matrix|misc|numerical(|[.]backends)|rings(|[.]finite_rings)|sets))[.]all\s+import'
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'
# imports from .all are allowed in all.py; also allow in some modules that need sage.all
filePattern: '(.*/|)(?!(all|benchmark|dev_tools|parsing|sage_eval))[^/.]*[.](py|pyx|pxi)$'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AUTHOR:
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.groups.perm_gps.all import CyclicPermutationGroup
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
from sage.libs.singular.function import lib, singular_function
from sage.misc.repr import repr_lincomb
from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/letterplace/free_algebra_letterplace.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ cdef class FreeAlgebra_letterplace(Algebra):
ngens = self.__ngens
degbound = self._degbound
cdef list G = [C(x._poly) for x in g]
from sage.groups.perm_gps.all import CyclicPermutationGroup
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
CG = CyclicPermutationGroup(C.ngens())
for y in G:
out.extend([y] + [y * CG[ngens * (n + 1)]
Expand Down
3 changes: 2 additions & 1 deletion src/sage/categories/finite_complex_reflection_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ def noncrossing_partition_lattice(self, c=None, L=None,
sage: sorted( w.reduced_word() for w in W.noncrossing_partition_lattice(W.from_reduced_word([2])) ) # optional - gap3
[[], [2]]
"""
from sage.combinat.posets.all import Poset, LatticePoset
from sage.combinat.posets.posets import Poset
from sage.combinat.posets.lattices import LatticePoset

R = self.reflections()
if L is None:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/ag_code_decoders.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ AUTHORS:
cimport cython

from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.function_field.all import FunctionField
from sage.rings.function_field.constructor import FunctionField

from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/linear_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class should inherit from this class. Also ``AbstractLinearCode`` should never
from sage.combinat.subset import Subsets
from sage.cpython.string import bytes_to_str
from sage.features.gap import GapPackage
from sage.groups.all import SymmetricGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.groups.perm_gps.permgroup import PermutationGroup
from sage.interfaces.gap import gap
from sage.matrix.matrix_space import MatrixSpace
Expand Down
Loading