Skip to content

Conversation

@stefanv
Copy link
Member

@stefanv stefanv commented Jun 21, 2024

Work to address #209, #203, #204, #208

@stefanv stefanv added the type: Bug fix Something isn't working label Jun 21, 2024
@stefanv stefanv force-pushed the fix-testing branch 2 times, most recently from f656a73 to 9f01bb4 Compare June 21, 2024 19:10
@stefanv stefanv marked this pull request as ready for review June 21, 2024 19:30
@stefanv
Copy link
Member Author

stefanv commented Jun 21, 2024

@ngoldbaum This should fix the problems with NumPy, hopefully. There's still one problem due to the way NumPy overrides this command, such that spin test numpy.linalg does not work (vs spin test -t numpy.linalg, which does). It'd be an easy fix on the NumPy side, though.

@stefanv
Copy link
Member Author

stefanv commented Jun 21, 2024

@jarrodmillman Given that the current test command is broken, I recommend we do this as a point release, but we could also just do a 0.11.

@ngoldbaum
Copy link
Contributor

It'd be an easy fix on the NumPy side, though.

Sounds reasonable. Care to elaborate a little bit?

@stefanv
Copy link
Member Author

stefanv commented Jun 21, 2024

Sure! The user is supposed to supply tests as spin test -t test.name, but as a convenience we also allow spin test.name. To detect this case, we check for a single argument (maybe there's a better way, but that's what happens right now), and NumPy modifies the arguments of spin test foo.bar to look something like -m 'not slow' foo.bar. The simplest fix is to take a single argument test specification and pass it as the tests argument, instead of as part of pytest_args, which then only contains -m 'not slow'.

@ngoldbaum
Copy link
Contributor

I tried testing this after implementing the suggested change to numpy's spin configuration, but I'm still getting an error trying to do spin build on this branch of spin:

± spin test numpy.linalg
Invoking `build` prior to running tests:
Error: 'NoneType' object has no attribute 'dir_info'; aborting.

This is coming from here:

dist.origin.dir_info, "editable", False

I don't know enough about how importlib_metadata works to know why Distribution.from_name('numpy').origin is None on my system and python install:

In [1]: import importlib_metadata

In [2]: print(importlib_metadata.Distribution.from_name('numpy').origin)
None

@stefanv
Copy link
Member Author

stefanv commented Jun 28, 2024

OK, I thought we patched that; let me check why that error is still present for you.

@stefanv
Copy link
Member Author

stefanv commented Jun 28, 2024

#212

@ngoldbaum
Copy link
Contributor

See numpy/numpy#26813

@stefanv
Copy link
Member Author

stefanv commented Jun 28, 2024

That wasn't supposed to close. Reopened as #213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Bug fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants