Skip to content

Add support for beancount v3 - #256

Closed
LalitMaganti wants to merge 2 commits into
jbms:masterfrom
LalitMaganti:master
Closed

LalitMaganti wants to merge 2 commits into
jbms:masterfrom
LalitMaganti:master

Conversation

@LalitMaganti

Copy link
Copy Markdown

Switch to using beangulp which supports both v2 and v3.

Fixes: #253

Switch to using beangulp which supports both v2 and v3.
@Nulifier

Nulifier commented Jan 9, 2026

Copy link
Copy Markdown

This doesn't appear to work for the generic_importer_source.

I get the following error:

TypeError: expected str, bytes or os.PathLike object, not _FileMemo

This is related to the switch from _FileMemo to straight filepath strings. I managed to get past that by checking if the filepath has a name property and using that. When I got past that, I ran into the following issue:

TypeError: Importer.extract() got an unexpected keyword argument 'existing_entries' which is related to the change in call signature from the Importer.

@LalitMaganti

Copy link
Copy Markdown
Author

Thanks for letting me know. 0c37757 should fix this.

@slashformotion

Copy link
Copy Markdown

LGTM

@Zburatorul

Copy link
Copy Markdown
Collaborator

@LalitMaganti thanks for kicking this off — I built on the same beangulp
approach and opened #263 as a more complete alternative. It takes the same beangulp approach as this PR (the generic_importer_source change is equivalent), but also carries what's needed for a complete v3 install:

  • adds beangulp and beanquery to install_requires (this PR switches the
    imports but doesn't declare the new deps);
  • migrates delete_transactions/rename_account off the removed
    beancount.querybeanquery;
  • handles v3's __automatic__/__residual__ posting metadata in
    journal_editor;
  • swaps pkg_resourcesimportlib.resources, fixes mypy under v3's
    py.typed, and updates CI to Python 3.9–3.12;
  • keeps v2.3+ compatibility (beancount>=2.3.5, since beangulp/beanquery
    both support 2.3+).

CI is green across 3.9–3.12 on Linux/Windows/macOS and I validated it against a real ledger. Flagging here so we're not working the two in parallel — @jbms, happy to go with whichever you prefer.

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

Successfully merging this pull request may close these issues.

Beangulp compatible?

4 participants