Skip to content

Commit

Permalink
gh-36630: Allow to specify output directory for generated interpreters
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
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 -->

Add the possibility to specify the output directory where the generated
interpreters files will be created. This is preparation for the
compilation with meson.

<!-- 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. -->
<!-- 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. -->

- [ ] 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
- #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: #36630
Reported by: Tobias Diez
Reviewer(s): Matthias Köppe, Michael Orlitzky, Tobias Diez
  • Loading branch information
Release Manager committed Dec 4, 2023
2 parents 69d03d3 + a191861 commit 3a9254d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/sage_setup/autogen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from . import interpreters
from sage.env import SAGE_SRC


def autogen_all():
"""
Expand All @@ -9,6 +10,7 @@ def autogen_all():
Return a list of sub-packages that should be appended to the list
of packages built/installed by setup.py.
"""
from sage.env import SAGE_SRC
interpreters.rebuild(os.path.join(SAGE_SRC, "sage", "ext", "interpreters"))

return ['sage.ext.interpreters']
10 changes: 6 additions & 4 deletions src/sage_setup/autogen/interpreters/__main__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from __future__ import print_function, absolute_import
# Usage: python -m sage_setup.autogen.interpreters <output_dir>

import os
from sage.env import SAGE_SRC
import argparse

from . import rebuild

parser = argparse.ArgumentParser()
parser.add_argument("output_dir", help="Output directory")
args = parser.parse_args()

rebuild(os.path.join(SAGE_SRC, "sage", "ext", "interpreters"))
rebuild(args.output_dir)

0 comments on commit 3a9254d

Please sign in to comment.