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

Meta-ticket: make all modules importable without sage.all #33580

Open
tobiasdiez opened this issue Mar 27, 2022 · 1 comment
Open

Meta-ticket: make all modules importable without sage.all #33580

tobiasdiez opened this issue Mar 27, 2022 · 1 comment

Comments

@tobiasdiez
Copy link
Contributor

tobiasdiez commented Mar 27, 2022

Currently many modules cannot be imported without prior loading of sage.all (or for other reasons). This is however needed for modularization and for running them with pytest.

They can be found using the following script (run via ./sage)

import importlib.util
import pathlib
for file in pathlib.Path().glob("src/sage/**/*.py"):
    try: 
        spec = importlib.util.spec_from_file_location("module.name", file)
        module = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(module)
    except:
        print(file)

Tickets:

CC: @mkoeppe @soehms

Component: refactoring

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

@tobiasdiez tobiasdiez added this to the sage-9.6 milestone Mar 27, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 11, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe modified the milestones: sage-10.0, sage-10.1 Apr 30, 2023
@mkoeppe mkoeppe removed this from the sage-10.1 milestone Aug 7, 2023
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

2 participants