Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beancount v3 compatiblity #1860

Open
2 tasks done
yagebu opened this issue Sep 15, 2024 · 9 comments
Open
2 tasks done

Beancount v3 compatiblity #1860

yagebu opened this issue Sep 15, 2024 · 9 comments

Comments

@yagebu
Copy link
Member

yagebu commented Sep 15, 2024

Tracking issue. See #1859 for ongoing work.

A version of Fava that supports both v2 and v3 seems feasible. This would use the beanquery package on both version, introducing some changes to which queries work.

See also:

@jack9603301
Copy link

I look forward to the day when fava and beancount fully support v3. When it enters a stable state, I will immediately migrate from v2 to v3.

Does anyone know the time node?

@yagebu
Copy link
Member Author

yagebu commented Nov 9, 2024

Merged #1859 just now so Beancount v3 support is now on the main branch :)

I think we're good on the beanquery-front, importing still probably needs more work (no support yet for new-style beangulp importers)

@yagebu
Copy link
Member Author

yagebu commented Dec 15, 2024

With #1917 we now also have support for importers inheriting from beangulp.Importer, so I'd consider this mostly complete. Testing and feedback welcome, will probably create a release in one or two weeks.

@yagebu
Copy link
Member Author

yagebu commented Dec 29, 2024

I just released 1.30 (very happy about the fitting version number) with these changes :)

I'll leave this issue open for a bit for feedback on this topic.

@tarioch
Copy link
Contributor

tarioch commented Dec 30, 2024

Is there a difference how the hooks are called in fava vs plain beangulp? When I call the import script directly, my hooks are receiving 4 values (filename, entries, account and importer), if I use the same script through fava, I only get 2 (filename and entries).

@abourget
Copy link

I'm using the latest Docker image, and it says:

Welcome to the help pages for Fava! You are running Beancount version 2.3.6 and Fava 1.30 (changelog). There are help pages for the following topics:

Shouldn't it read Beancount v3 or something? :)

@yagebu
Copy link
Member Author

yagebu commented Jan 3, 2025

Is there a difference how the hooks are called in fava vs plain beangulp?

It seems there is - I didn't change anything compared to v2, so they're still called the "old" way. A PR to fix that would be welcome (I guess we should inspect the hook signature to be compatible with both) - edit: nevermind, AFAICT Fava and beangulp both call hooks with just two arguments, the imported and the existing entries.

I'm using the latest Docker image

We don't provide a Docker image so you'll need to raise this with whomever you got this from.

@marvhen
Copy link

marvhen commented Jan 3, 2025

I'm getting this when I try to run the fava I just installed, with beancount v3 installed from source.

PS C:\Users\marvhen> fava .\tst.bean
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\marvhen\scoop\apps\python\current\Scripts\fava.exe\__main__.py", line 4, in <module>
    from fava.cli import main
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\fava\cli.py", line 16, in <module>
    from fava.application import create_app
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\fava\application.py", line 49, in <module>
    from fava._ctx_globals_class import Context
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\fava\_ctx_globals_class.py", line 10, in <module>
    from fava.core.conversion import conversion_from_str
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\fava\core\__init__.py", line 41, in <module>
    from fava.core.ingest import IngestModule
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\fava\core\ingest.py", line 16, in <module>
    from beangulp import Importer
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\beangulp\__init__.py", line 21, in <module>
    from beangulp import cache  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\marvhen\scoop\apps\python\current\Lib\site-packages\beangulp\cache.py", line 158, in <module>
    _CACHE = defdict.DefaultDictWithKey(_FileMemo)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'beancount.utils.defdict' has no attribute 'DefaultDictWithKey'

Here are the versions of what I have:

PS C:\Users\marvhen> pip list
Package            Version     Editable project location
------------------ ----------- ---------------------------------
anyio              4.7.0
babel              2.16.0
beancount          3.1.0.dev0  C:\Users\marvhen\source\beancount
beangulp           0.1.1
beanquery          0.1.0
beautifulsoup4     4.12.3
blinker            1.9.0
chardet            5.2.0
cheroot            10.0.1
click              8.1.8
colorama           0.4.6
fava               1.30
Flask              3.1.0
flask-babel        4.0.0
idna               3.10
itsdangerous       2.2.0
jaraco.functools   4.1.0
Jinja2             3.1.5
lxml               5.3.0
markdown2          2.5.2
MarkupSafe         3.0.2
meson              1.6.1
meson-python       0.17.1
more-itertools     10.5.0
ninja              1.11.1.3
packaging          24.2
pip                24.3.1
ply                3.11
pyproject-metadata 0.9.0
python-dateutil    2.9.0.post0
pytz               2024.2
regex              2024.11.6
simplejson         3.19.3
six                1.17.0
sniffio            1.3.1
soupsieve          2.6
TatSu              5.7.4
watchfiles         1.0.3
Werkzeug           3.1.3

@yagebu
Copy link
Member Author

yagebu commented Jan 3, 2025

The latest development version of Beancount is currently not compatible with the latest released version of beangulp. You'll need to either install both from source or both from released versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants