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: Remove use of SAGE_LIB and SAGE_EXTCODE variables #33037

Open
mkoeppe opened this issue Dec 17, 2021 · 11 comments
Open

Meta-ticket: Remove use of SAGE_LIB and SAGE_EXTCODE variables #33037

mkoeppe opened this issue Dec 17, 2021 · 11 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 17, 2021

Portions of namespace packages can be installed in separate locations.

Hence, the variable sage.env.SAGE_LIB is no longer meaningful.

Instead, we should make use of the __path__ attribute of packages, https://python.readthedocs.io/en/stable/reference/import.html#module-path, which in the case of namespace packages is an iterable.

SAGE_EXTCODE should be replaced by using importlib.resources (more precisely, the backport package importlib-resources). Version 5.9.0 can do as_file with directories (https://importlib-resources.readthedocs.io/en/latest/history.html#v5-9-0)

Depends on #31306

CC: @tornaria

Component: refactoring

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

@mkoeppe mkoeppe added this to the sage-9.6 milestone Dec 17, 2021
@mkoeppe

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Dec 17, 2021

comment:2

This could have some interesting consequences. At the moment SAGE_SRC default to SAGE_LIB if SAGE_ROOT is undefined. The most interesting thing about this behavior is that you can run the test suite on an installed version of sage without having the source. There may be other interesting things about using cython from inside sage witht the sage install rather than the source.

So those things may have to be thought about while removing that variable.

@kiwifb
Copy link
Member

kiwifb commented Dec 17, 2021

comment:3

It should also depend on the work on extcode, from env.py

SAGE_EXTCODE = var("SAGE_EXTCODE", join(SAGE_LIB, "sage", "ext_data"))

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 17, 2021

Dependencies: #31306

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 17, 2021

comment:6

Replying to @kiwifb:

It should also depend on the work on extcode, from env.py

SAGE_EXTCODE = var("SAGE_EXTCODE", join(SAGE_LIB, "sage", "ext_data"))

Yes, I've added #31306 as a dependency.

@mkoeppe mkoeppe changed the title Remove use of SAGE_LIB variable Meta-ticket: Remove use of SAGE_LIB and SAGE_EXTCODE variables Feb 7, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 7, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@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 removed this from the sage-10.0 milestone Apr 30, 2023
mkoeppe added a commit to mkoeppe/sage that referenced this issue Feb 26, 2024
mkoeppe added a commit to mkoeppe/sage that referenced this issue Mar 5, 2024
mkoeppe added a commit to mkoeppe/sage that referenced this issue Mar 16, 2024
mkoeppe added a commit to mkoeppe/sage that referenced this issue Mar 22, 2024
mkoeppe added a commit to mkoeppe/sage that referenced this issue Mar 26, 2024
vbraun pushed a commit to vbraun/sage that referenced this issue Mar 30, 2024
    
Topics here:
- ext_data is legacy location only, see sagemath#33037
- separate repos for large data files
- importlib_resources

Follow-ups:
- use of Features

<!-- ^^^^^
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 sagemath#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? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#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.
- [ ] 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
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#37399
Reported by: Matthias Köppe
Reviewer(s): gmou3, Gonzalo Tornaría, Matthias Köppe, Sebastian Oehms
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