Skip to content

BLD: ship tables in wheel - #17

Merged
steppi merged 1 commit into
scipy:mainfrom
lucascolley:data
Jun 13, 2026
Merged

steppi merged 1 commit into
scipy:mainfrom
lucascolley:data

Conversation

@lucascolley

Copy link
Copy Markdown
Member

@steppi I assume we will also need to update the generation scripts for the new location

@steppi

steppi commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

@steppi I assume we will also need to update the generation scripts for the new location

Thanks Lucas! The generation scripts take the paths as command line arguments so I think those should actually be fine as is. There's a function in test_tables.py for getting the tables paths that will need to change though. The tests were skipped because no tables were found to test. The tests only test for the consistency of existing tables, not which tables are there.

@lucascolley

lucascolley commented Jun 11, 2026 •

Copy link
Copy Markdown
Member Author

Thinking some more — I think we should expose a function in the xsref package which returns the tables path — WDYT? Something like:

# xsref/__init__.py
import importlib.resources

def get_tables_path():
    return importlib.resources.files('xsref').joinpath('tables')

Then

https://github.com/scipy/xsf/blob/dbe85a396d6799b65d92aa53ff6c354f8268b6b5/tests/CMakeLists.txt#L1

would be replaced by something like

execute_process(
  COMMAND ${Python3_EXECUTABLE} -c "import xsref; print(xsref.get_tables_path())"
  OUTPUT_VARIABLE PY_OUT
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(XSREF_TABLES_PATH "${PY_OUT}")

and

https://github.com/scipy/xsf/blob/dbe85a396d6799b65d92aa53ff6c354f8268b6b5/python_tests/test_cupy.py#L111-L113

would be replaced by

tables_path = xsref.get_tables_path()

@steppi

steppi commented Jun 11, 2026

Copy link
Copy Markdown
Member

Thinking some more — I think we should expose a function in the xsref package which returns the tables path — WDYT? Something like:

# xsref/__init__.py
import importlib.resources

def get_tables_path():
    return importlib.resources.files('xsref').joinpath('tables')

Then

https://github.com/scipy/xsf/blob/dbe85a396d6799b65d92aa53ff6c354f8268b6b5/tests/CMakeLists.txt#L1

would be replaced by something like

execute_process(
  COMMAND ${Python3_EXECUTABLE} -c "import xsref; print(xsref.get_tables_path())"
  OUTPUT_VARIABLE PY_OUT
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(XSREF_TABLES_PATH "${PY_OUT}")

and

https://github.com/scipy/xsf/blob/dbe85a396d6799b65d92aa53ff6c354f8268b6b5/python_tests/test_cupy.py#L111-L113

would be replaced by

tables_path = xsref.get_tables_path()

Yeah, that sounds like a good idea.

@steppi

steppi commented Jun 11, 2026

Copy link
Copy Markdown
Member

Nice, the tests ran. This looks ready to merge now

@lucascolley

Copy link
Copy Markdown
Member Author

if CI is happy on scipy/xsf#175 then I will bring this out of draft

@lucascolley
lucascolley marked this pull request as ready for review June 11, 2026 19:38

@steppi steppi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lucascolley!

@steppi
steppi merged commit 1a5bb3d into scipy:main Jun 13, 2026
1 check passed
@lucascolley
lucascolley deleted the data branch June 13, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants