Skip to content

Commit a45062c

Browse files
author
Release Manager
committed
gh-36666: Replace relative imports by absolute ones in `sage.{algebras,arith,categories,cpython,data_structures,misc,modular,rings,sat,symbolic}` <!-- ^^^^^ 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 #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> Final chunk of the cherry-pick from #35095 for #36228, see also #36572 (comment) This PR overlaps with #36572, #36588, #36589, but it does not touch `.all*` files (no changes there are needed for #36228), thus avoiding conflicts with #35095 (see also #36524 (comment)) <!-- 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. --> <!-- 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. - [ ] 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: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36666 Reported by: Matthias Köppe Reviewer(s): David Coudert, John H. Palmieri
2 parents 2051800 + b2222c3 commit a45062c

Some content is hidden

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

48 files changed

+170
-170
lines changed

src/sage/algebras/quatalg/quaternion_algebra_cython.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ from sage.matrix.matrix_space import MatrixSpace
3535
from sage.matrix.matrix_integer_dense cimport Matrix_integer_dense
3636
from sage.matrix.matrix_rational_dense cimport Matrix_rational_dense
3737

38-
from .quaternion_algebra_element cimport QuaternionAlgebraElement_rational_field
38+
from sage.algebras.quatalg.quaternion_algebra_element cimport QuaternionAlgebraElement_rational_field
3939

4040
from sage.libs.gmp.mpz cimport mpz_t, mpz_lcm, mpz_init, mpz_set, mpz_clear, mpz_init_set, mpz_mul, mpz_fdiv_q, mpz_cmp_si
4141

src/sage/categories/action.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ cdef class Action(Functor):
9191
:class:`Action` itself, but other classes may use it
9292
"""
9393
def __init__(self, G, S, is_left=True, op=None):
94-
from .groupoid import Groupoid
94+
from sage.categories.groupoid import Groupoid
9595
Functor.__init__(self, Groupoid(G), category(S))
9696
self.G = G
9797
self.US = ref(S)

src/sage/categories/morphism.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ cdef class CallMorphism(Morphism):
467467
cdef class IdentityMorphism(Morphism):
468468

469469
def __init__(self, parent):
470-
from .homset import Homset, Hom
470+
from sage.categories.homset import Homset, Hom
471471
if not isinstance(parent, Homset):
472472
parent = Hom(parent, parent)
473473
Morphism.__init__(self, parent)

src/sage/cpython/getattr.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Variants of getattr()
44

55
from cpython.object cimport PyObject, PyTypeObject, Py_TYPE, descrgetfunc
66

7-
from .string cimport bytes_to_str
7+
from sage.cpython.string cimport bytes_to_str
88

99
cdef extern from "Python.h":
1010
r"""

src/sage/cpython/wrapperdescr.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Pure Python classes have normal methods, not slot wrappers::
3030
# https://www.gnu.org/licenses/
3131
# ****************************************************************************
3232

33-
from .string import bytes_to_str
33+
from sage.cpython.string import bytes_to_str
3434

3535

3636
def wrapperdescr_call(slotwrapper, self, *args, **kwds):

src/sage/misc/cachefunc.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .function_mangling cimport ArgumentFixer
1+
from sage.misc.function_mangling cimport ArgumentFixer
22

33
cpdef dict_key(o) noexcept
44
cpdef cache_key(o) noexcept

src/sage/misc/lazy_import.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import os
6666
import pickle
6767
from warnings import warn
6868
import inspect
69-
from . import sageinspect
69+
from sage.misc import sageinspect
7070

7171

7272
# LazyImport.__repr__ uses try... except FeatureNotPresentError.
@@ -1137,7 +1137,7 @@ def save_cache_file():
11371137
sage: sage.misc.lazy_import.save_cache_file()
11381138
"""
11391139
from sage.misc.temporary_file import atomic_write
1140-
from .lazy_import_cache import get_cache_file
1140+
from sage.misc.lazy_import_cache import get_cache_file
11411141

11421142
global star_imports
11431143
if star_imports is None:
@@ -1180,7 +1180,7 @@ def get_star_imports(module_name):
11801180
"""
11811181
global star_imports
11821182
if star_imports is None:
1183-
from .lazy_import_cache import get_cache_file
1183+
from sage.misc.lazy_import_cache import get_cache_file
11841184
star_imports = {}
11851185
try:
11861186
with open(get_cache_file(), "rb") as cache_file:

src/sage/misc/persist.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import bz2
4242
comp = zlib
4343
comp_other = bz2
4444

45-
from .sage_unittest import TestSuite
45+
from sage.misc.sage_unittest import TestSuite
4646

4747

4848
# We define two global dictionaries `already_pickled` and
@@ -1237,7 +1237,7 @@ def db(name):
12371237
12381238
The database directory is ``$HOME/.sage/db``.
12391239
"""
1240-
from .misc import SAGE_DB
1240+
from sage.misc.misc import SAGE_DB
12411241
return load('%s/%s'%(SAGE_DB,name))
12421242
12431243
@@ -1250,5 +1250,5 @@ def db_save(x, name=None):
12501250
try:
12511251
x.db(name)
12521252
except AttributeError:
1253-
from .misc import SAGE_DB
1253+
from sage.misc.misc import SAGE_DB
12541254
save(x, '%s/%s'%(SAGE_DB,name))

src/sage/misc/sage_timeit_class.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The ``timeit`` command
66
This uses the function :func:`~sage.misc.sage_timeit.sage_timeit`.
77
"""
88

9-
from . import sage_timeit
9+
from sage.misc import sage_timeit
1010

1111

1212
class SageTimeit:

src/sage/modular/modsym/heilbronn.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ cdef extern from "<math.h>":
3434
float roundf(float x)
3535

3636
cimport sage.modular.modsym.p1list as p1list
37-
from . import p1list
37+
from sage.modular.modsym import p1list
3838
cdef p1list.export export
3939
export = p1list.export()
4040

41-
from .apply cimport Apply
41+
from sage.modular.modsym.apply cimport Apply
4242
cdef Apply PolyApply= Apply()
4343

4444
from sage.matrix.matrix_rational_dense cimport Matrix_rational_dense

0 commit comments

Comments
 (0)