You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It could well be partially linked to some of the discussion in #642 but I thought a separate issue may be worth it.
Description of the issue
The pytest assertion rewriting that shows additional debug information when an assert fails does not show up when using meson editable install. It does work fine when using normal (non-editable) meson install. Although not crucial I would argue that this can be actually quite useful in CI logs.
It could also well be a Pytest issue but I thought I had to start somewhere and chose meson-python.
More background about Pytest assertion rewriting, see Pytest doc that links to a somewhat old blog post but I am guessing is probably still relevant?
This was originally seen in scikit-learn (see scikit-learn/scikit-learn#29253 (comment) if you are really curious where it would have actually been quite useful to see intermediary values in the AssertionError in scikit-learn/scikit-learn#29253 (comment)). I put together a reproducer below with numpy hoping this makes it a bit easier to look at. I guess a smaller reproducer could be put together if deemed useful, but it would take a bit of time (I tried with https://github.com/dnicolodi/python-siphash24 and I am not able to reproduce the issue).
Get the reproducer from my numpy branch
git clone https://github.com/lesteve/numpy
cd numpy
git checkout meson-editable-pytest-assertion-rewrite
I don't think anyone active in maintaining meson-python has the time to dig into this. The pytest maintainer are much better positioned to understand where things go wrong. Once we know what the problem is, we can look into fixing it.
I'm very surprised that pytest works for simple packages but not for more complex ones. The editable package loading code does not care whether the package contains an extension module or not. Thus the issue should be reproducible with a pure Python package too.
OK thanks a lot for your insights! I'll try to come up with a simpler reproducer and open an issue in Pytest to see whether they have some intuition where the problem lies.
dnicolodi
added
the
dependency-bug
A bug experienced by users of meson-python caused by a dependency, rather than in code in this repo
label
Aug 17, 2024
It could well be partially linked to some of the discussion in #642 but I thought a separate issue may be worth it.
Description of the issue
The pytest assertion rewriting that shows additional debug information when an assert fails does not show up when using meson editable install. It does work fine when using normal (non-editable) meson install. Although not crucial I would argue that this can be actually quite useful in CI logs.
It could also well be a Pytest issue but I thought I had to start somewhere and chose meson-python.
More background about Pytest assertion rewriting, see Pytest doc that links to a somewhat old blog post but I am guessing is probably still relevant?
This was originally seen in scikit-learn (see scikit-learn/scikit-learn#29253 (comment) if you are really curious where it would have actually been quite useful to see intermediary values in the
AssertionError
in scikit-learn/scikit-learn#29253 (comment)). I put together a reproducer below with numpy hoping this makes it a bit easier to look at. I guess a smaller reproducer could be put together if deemed useful, but it would take a bit of time (I tried with https://github.com/dnicolodi/python-siphash24 and I am not able to reproduce the issue).Get the reproducer from my numpy branch
I added a simple test in
numpy/tests/test_mine.py
When running with pytest you pytest assertion rewriting shows the value or
arr.sum()
(see below).Normal (non-editable) install
Note the assertion rewriting i.e. you get the value of
arr.sum()
Partial output:
Full output
Editable install
You don't get the value of
arr.sum()
The text was updated successfully, but these errors were encountered: