On Thursday, March 7, 2024 at 8:31:27 PM UTC+1 [email protected] wrote:


package sources and use the --import-mode=importlib option to run the 
tests. 

Cheers, 
Dan 


Dan, thank you for your help, I just could not make the pytests work no 
matter what

There are errors, that that the *_parser *module cannot be imported

But I found the following workaround, which uses pip install, rather than *py 
setup.py build_ext -i*

I will put is here, may be it will help someone

======================

setup virtual environment

In case of Windows go to the x64 Native Tools Command Prompt for VS 20XX

activate virtual environment

install beancount into virtual environment normal way pip install .  

go to   the virtual environment, locate folder  
site-packages/beancount/parser

Find the file 

_parser.XXXXXX.so - for linux

_parser.XXXXXX.pyd - for window

Copy this file to the source code /beancount/parser

Now pip uninstall beancount

Run the tests normal way: pytest beancount

========================

So, for me it works for now, (both via *py setup.py build_ext -i and as 
described above *) I can hack in the latest python code of the beancount. 
But I hope that one day somebody more clever will make the *pip install -e 
.* mode workable for pytests by either updating code or the documentation 
<https://docs.google.com/document/d/1WwZYqsp28Uuk5eFqHQ1u1zqdjghymy8S_Yo-OJENoa4>
 
or both

 

-- 
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/5da70bae-0a60-484a-8c77-a9b8615fab97n%40googlegroups.com.

Reply via email to