On 11/08/24 06:27, Eric Altendorf wrote:
This is mentioned on another thread, but I'm raising it again here with a report from a hermetic environment.

To reproduce the failure:

mkdir beancount-install-test
cd beancount-install-test/
git clone https://github.com/beancount/beancount <https://github.com/beancount/beancount>
python -m venv beancount-venv
source beancount-venv/bin/activate
cd beancount
python -m pip install -e .
python -m pip install pytest
make test

produces a bunch of ninja temp file errors

This is because the meson-python editable wheel support re-compiles the project when it is imported. This requires all the build tools for the project to be installed in the Python environment. However, by default, pip created a throw-away environment for building the wheel where the build tools are installed. The throw-away environment is deleted as soon as the editable wheel is installed, and the build tools with it. This is the reason why the meson-python documentation on editable wheels

https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html

recommends to switch off this feature passing the --no-build-isolation command line option to pip. This requires to install the build tools required by the project, in the case of beancount this is meson-python, meson, and ninja.

I also tried:
python -m pip install ninja

but I get the same failures after that.

The failure you get after that is similar, but not the same. These failures are due to the unusual way pytest uses to import the test code.

The last pytest major release does not work with a project that has the test modules located alongside the source code but not installed in the wheel. The only solution I've found for this is to install the test modules. I'll prepare a PR to do this for beancount too.

Cheers,
Dan

--
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/46c3f40b-11ad-43b3-b83f-c89185942017%40grinta.net.

Reply via email to