[GNC-dev] Testing python
Rob Gowin
robg at gowin.net
Fri Apr 24 01:04:29 EDT 2020
On Sun, Apr 19, 2020 at 2:19 PM Andy Goblins <andygoblins at gmx.com> wrote:
> I also tried skipping the virtual environment and just running
> "GNC_UNINSTALLED=1;GNC_BUILDDIR=<my build
> dir>;PYTHONPATH=$GNC_BUILDDIR/lib/python3.8/site-packages:$GNC_BUILDDIR
> /lib/gnucash python" just like the cmake tests use, but I get the same
> result; it's not finding the libgncmod-backend stuff in
> build/lib/gnucash.
>
You almost had it. :-) The semicolons in the above command line make it
such that, for example, "GNC_UNINSTALLED=1" is its own (no-op) command that
does not affect the python command.
Try this in your virtual environment:
(gnucash-build) robg at kubuntu01:~/gnucash-build$ GNC_UNINSTALLED=1
GNC_BUILDDIR=`pwd` python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gnucash
* 23:52:18 WARN <gnc.core-utils> no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18 WARN <gnc.core-utils> no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18 WARN <gnc.core-utils> no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18 WARN <gnc.core-utils> no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18 WARN <gnc.core-utils> no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
>>> import gnucash.gnucash_core_c
>>> print(gnucash.gnucash_core_c.CREC)
c
I don't know what the deal with the preference backend stuff is, but maybe
it won't affect your testing.
Rob
More information about the gnucash-devel
mailing list