Announcement: v3 and git branches

2,514 views
Skip to first unread message

Martin Blais

unread,
Jun 16, 2024, 4:22:59 PM6/16/24
to Beancount
Based on our recent discussion around Beancount branches being confusing, I did the following to branches:

- v2: remains the same (no change); but v2 is now even less subject to freeze exceptions than before, because v3 is now officially born and PyPI releases will be made for it.  The default reply to patches to v2 will be "move that to v3."

- cpp: I turned the previous master branch's state with all C++ and Bazel build into a new 'cpp' branch. 
  All work on the C++ rewrite -- if it is to continue -- will live on that branch.
  If things do move to Rust, I will probably salvage bits and pieces of that manually into a 'rust' branch.
  In particular, the schema defined in the proto files is something I'd like to carry forward (nicely
  documented and distinguishes between the pre and post interpolation data structures explicitly), 
  and perhaps the new reFlex parser will be useful at some point.

- v3: a new branch, to contain the state of the master branch MINUS the C++ bits. 
  As stated above, the C++ code remains only on branch 'cpp'.
  This is now the official release branch and PyPI releases will be made of it.

- master: this branch is now where new work on v3 might live.
  I'm not sure we really need it or what it should mean, but it should track v3 for now.

I've reviewed missing PyPI releases and made sure we have these:

The inclusion of v3 releases for PyPI and new PyPI releases for subprojects should normalize the versioning situation in Beancount. Note that packaging and following other people's conventions are not my forte (and I don't use PyPI for my own projects I just use source), if you have any suggestions or something's missing please reply to this thread.

Thanks for your patience, 

Brian Lalor

unread,
Jun 17, 2024, 6:00:23 AM6/17/24
to bean...@googlegroups.com
This is great! Thank you! Is there a summary of what’s new/different in 3.0.0 from 2.3.6? (Also I don’t see a 3.0.0 tag in GitHub; was that an oversight?)
-- 
Brian Lalor (he/him)
bla...@bravo5.org

On Jun 16, 2024, at 4:23 PM, Martin Blais <bl...@furius.ca> wrote:


--
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 beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhNfFy-Y%3DiOgnNLFf04c42b4hBiqgfcjGCx-re2H02y_ww%40mail.gmail.com.

Martin Blais

unread,
Jun 17, 2024, 7:34:10 AM6/17/24
to bean...@googlegroups.com
On Mon, Jun 17, 2024 at 6:00 AM Brian Lalor <bjl...@bravo5.org> wrote:
This is great! Thank you! Is there a summary of what’s new/different in 3.0.0 from 2.3.6? (Also I don’t see a 3.0.0 tag in GitHub; was that an oversight?)

v3 
- removes beanquery, beanprice, beanweb and more, is pretty stripped down. Use the subprojects instead.
- has a number of really minor fixes added over time but no major new features
If you were using the 'master' branch there's no change.

You should not use v2 anymore.


 

Martin Blais

unread,
Jun 17, 2024, 7:35:48 AM6/17/24
to Martin Blais, bean...@googlegroups.com
I'd forgotten the tag. There's one now.

Stefano Zacchiroli

unread,
Jun 17, 2024, 7:37:08 AM6/17/24
to bean...@googlegroups.com
On Sun, Jun 16, 2024 at 04:22:43PM -0400, Martin Blais wrote:
> Based on our recent discussion around Beancount branches being confusing, I
> did the following to branches:

Thanks Martin, this is awesome!

As a user report: I've migrated all my beancount toolchain to v3,
without any issue (aside from the Fava incompatibility, which was
already known and discussed here in the previous thread).

For those using Fava, beware that if you "pip install fava" after "pip
install beancount" (with the latest release), that will revert your
beancount back to 2.x.

Cheers
--
Stefano Zacchiroli . za...@upsilon.cc . https://upsilon.cc/zack _. ^ ._
Full professor of Computer Science o o o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o </> <\>
Co-founder & CTO Software Heritage o o o o /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro '" V "'

Martin Michlmayr

unread,
Jun 17, 2024, 7:41:41 AM6/17/24
to bean...@googlegroups.com
* Martin Blais <bl...@furius.ca> [2024-06-17 07:33]:
> v3

Are there any syntax changes in v3?

When I tried to compile a list in 2022, I came up with:

* Single-character currency names are now supported
* Currency symbols now support a leading slash (/)
* Flags: Any of the A-Z characters are now supported, but have to be preceded by a single quote: 'A
* The limitation for currency names to be 24 characters long has been dropped (I think)

Did this make into into this v3 or not (and are there any other
changes?)

--
Martin Michlmayr
https://www.cyrius.com/

Chary Chary

unread,
Jun 17, 2024, 9:05:43 AM6/17/24
to Beancount
Martin,

thank you for the clarification!

And what about the documentation? Will you create new google docs for V3?

I think so far the biggest affected part if beanquery, but I notice that also other part of the extensive documentation set is affected here and there by changes to V3

Daniele Nicolodi

unread,
Jun 17, 2024, 9:39:32 AM6/17/24
to bean...@googlegroups.com
On 17/06/24 13:41, Martin Michlmayr wrote:
> * Martin Blais <bl...@furius.ca> [2024-06-17 07:33]:
>> v3
>
> Are there any syntax changes in v3?
>
> When I tried to compile a list in 2022, I came up with:
>
> * Single-character currency names are now supported
> * Currency symbols now support a leading slash (/)
> * Flags: Any of the A-Z characters are now supported, but have to be preceded by a single quote: 'A

Prepending the single quote to flags was introduced to disambiguate
flags from single character currencies in the lexer. However, I didn't
like like it and tweaked the parser to do the disambiguation in the
grammar instead. Flag characters do not need to be prefixed with a
single quote anymore.

> * The limitation for currency names to be 24 characters long has been dropped (I think)
>
> Did this make into into this v3 or not (and are there any other
> changes?)

All that was on the master branch as of yesterday is in the 3.0.0
release. I don't remember any other changes to the syntax beside what
you mention.

Cheers,
Dan

Lover O'Bean

unread,
Jun 17, 2024, 12:13:17 PM6/17/24
to Beancount
Great news!

Stefano Zacchiroli

unread,
Jun 18, 2024, 3:27:20 AM6/18/24
to bean...@googlegroups.com
Heads up for people transitioning to v3: the bean-extract executable is
gone. I didn't realize this as first; it might be useful to others to
know this in advance.

I welcome migration tips on what's the easiest migration path (to
beangulp, I guess?)

Meanwhile I'm temporarily reverting back to v2,

Martin Michlmayr

unread,
Jun 18, 2024, 3:36:46 AM6/18/24
to bean...@googlegroups.com
* Stefano Zacchiroli <za...@upsilon.cc> [2024-06-18 09:27]:
> I welcome migration tips on what's the easiest migration path (to
> beangulp, I guess?)

Yes.

Stefano Zacchiroli

unread,
Jun 18, 2024, 3:43:22 AM6/18/24
to bean...@googlegroups.com
About this:

On Sun, Jun 16, 2024 at 04:22:43PM -0400, Martin Blais wrote:
> I've reviewed missing PyPI releases and made sure we have these:
> https://pypi.org/project/beancount2ledger/

did you mean to release the current beancount2ledger to PyPI?

Because it currently isn't released (last release on PyPI is 4-year old,
last commit in Git 2-year old) and there are a couple of useful changes
in Git: a missing dependency in requirements.txt and the configurability
of a metadata key used (ledger side) to store payees.

I'm listed as co-maintainer of beancount2ledger so I can do this too,
but wanted to check with you before proceeding to avoid an upload race.

Let me know,

Stefano Zacchiroli

unread,
Jun 18, 2024, 4:13:23 AM6/18/24
to bean...@googlegroups.com
On Tue, Jun 18, 2024 at 03:36:34PM +0800, Martin Michlmayr wrote:
> * Stefano Zacchiroli <za...@upsilon.cc> [2024-06-18 09:27]:
> > I welcome migration tips on what's the easiest migration path (to
> > beangulp, I guess?)
>
> Yes.

Thanks, although I'm still a bit confused.

This document
https://docs.google.com/document/d/1hBfsHZcoHgz5rvhCdP42g2FJ5ouycIMV4H1tfgXpwBU/
"Importing External Data in Beancount" is about v3 ("This document is
about Beancount v3, under development, and a work in progress.") and
Beangulp, but still talks about bean-extract as an executable involved
in importing transactions with v3/beangulp.

What am I missing?

Daniele Nicolodi

unread,
Jun 18, 2024, 5:57:26 AM6/18/24
to bean...@googlegroups.com
On 18/06/24 10:13, Stefano Zacchiroli wrote:
> On Tue, Jun 18, 2024 at 03:36:34PM +0800, Martin Michlmayr wrote:
>> * Stefano Zacchiroli <za...@upsilon.cc> [2024-06-18 09:27]:
>>> I welcome migration tips on what's the easiest migration path (to
>>> beangulp, I guess?)
>>
>> Yes.
>
> Thanks, although I'm still a bit confused.
>
> This document
> https://docs.google.com/document/d/1hBfsHZcoHgz5rvhCdP42g2FJ5ouycIMV4H1tfgXpwBU/
> "Importing External Data in Beancount" is about v3 ("This document is
> about Beancount v3, under development, and a work in progress.") and
> Beangulp, but still talks about bean-extract as an executable involved
> in importing transactions with v3/beangulp.
>
> What am I missing?

The "under development, and a work in progress" warning refers to the
content of the document rather than to the subject of the document :-)

The best documentation there is for beangulp is the example included in
the repository
https://github.com/beancount/beangulp/tree/master/examples and the
docstrings in the code.

In a nutshell, to upgrade from beancount.ingest to beangulp, it shoul be
sufficient to modify all Python imports from the beancount.ingest
namespace to the beangulp namespace and to turn the configuration file
that was used to be passed to bean-extract into a self-standing script
as demonstrated here
https://github.com/beancount/beangulp/blob/master/examples/import.py
Then, calling such script with a '--help' argument should be enough to
understand how to use it.

A second (optional) step would be to update the importers from the old
beangulp.ImporterProtocol interface to the new beangulp.Importer
interface, which allows to implement some new features.

Cheers,
Dan

Daniele Nicolodi

unread,
Jun 18, 2024, 6:05:19 AM6/18/24
to bean...@googlegroups.com
On 18/06/24 11:57, Daniele Nicolodi wrote:
> On 18/06/24 10:13, Stefano Zacchiroli wrote:
>> On Tue, Jun 18, 2024 at 03:36:34PM +0800, Martin Michlmayr wrote:
>>> * Stefano Zacchiroli <za...@upsilon.cc> [2024-06-18 09:27]:
>>>> I welcome migration tips on what's the easiest migration path (to
>>>> beangulp, I guess?)
>>>
>>> Yes.
>>
>> Thanks, although I'm still a bit confused.
>>
>> This document
>> https://docs.google.com/document/d/1hBfsHZcoHgz5rvhCdP42g2FJ5ouycIMV4H1tfgXpwBU/
>> "Importing External Data in Beancount" is about v3 ("This document is
>> about Beancount v3, under development, and a work in progress.") and
>> Beangulp, but still talks about bean-extract as an executable involved
>> in importing transactions with v3/beangulp.
>>
>> What am I missing?
>
> The "under development, and a work in progress" warning refers to the
> content of the document rather than to the subject of the document :-)
>
> The best documentation there is for beangulp is the example included in
> the repository
> https://github.com/beancount/beangulp/tree/master/examples and the
> docstrings in the code.

The doctests
https://github.com/beancount/beangulp/tree/master/beangulp/tests may
also be useful.

Martin Blais

unread,
Jun 18, 2024, 7:09:43 AM6/18/24
to Beancount


On Tue, Jun 18, 2024, 04:13 Stefano Zacchiroli <za...@upsilon.cc> wrote:
On Tue, Jun 18, 2024 at 03:36:34PM +0800, Martin Michlmayr wrote:
> * Stefano Zacchiroli <za...@upsilon.cc> [2024-06-18 09:27]:
> > I welcome migration tips on what's the easiest migration path (to
> > beangulp, I guess?)
>
> Yes.

Thanks, although I'm still a bit confused.

This document
https://docs.google.com/document/d/1hBfsHZcoHgz5rvhCdP42g2FJ5ouycIMV4H1tfgXpwBU/
"Importing External Data in Beancount" is about v3 ("This document is
about Beancount v3, under development, and a work in progress.") and
Beangulp, but still talks about bean-extract as an executable involved
in importing transactions with v3/beangulp.

What am I missing?

Ah yes.... I should rename all the v3 docs to sometime more generic, like roadmap to the future or something. Will do.
 Thanks for reminding me






--
Stefano Zacchiroli . za...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science              o     o   o     \/|V|\/
Télécom Paris, Polytechnic Institute of Paris     o     o o    </>   <\>
Co-founder & CTO Software Heritage            o o o     o       /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

--
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 beancount+...@googlegroups.com.

Martin Blais

unread,
Jun 18, 2024, 7:49:09 AM6/18/24
to bean...@googlegroups.com
On Tue, Jun 18, 2024 at 3:43 AM Stefano Zacchiroli <za...@upsilon.cc> wrote:
About this:

On Sun, Jun 16, 2024 at 04:22:43PM -0400, Martin Blais wrote:
> I've reviewed missing PyPI releases and made sure we have these:
> https://pypi.org/project/beancount2ledger/

did you mean to release the current beancount2ledger to PyPI?

Not really, but if it needs to we could.


Because it currently isn't released (last release on PyPI is 4-year old,
last commit in Git 2-year old) and there are a couple of useful changes
in Git: a missing dependency in requirements.txt and the configurability
of a metadata key used (ledger side) to store payees.

I'm listed as co-maintainer of beancount2ledger so I can do this too,
but wanted to check with you before proceeding to avoid an upload race.

Please do! SGTM



 

Let me know,
Cheers
--
Stefano Zacchiroli . za...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science              o     o   o     \/|V|\/
Télécom Paris, Polytechnic Institute of Paris     o     o o    </>   <\>
Co-founder & CTO Software Heritage            o o o     o       /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

--
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 beancount+...@googlegroups.com.

Martin Blais

unread,
Jun 18, 2024, 8:03:22 AM6/18/24
to Beancount
On Tue, Jun 18, 2024 at 7:09 AM Martin Blais <bl...@furius.ca> wrote:
On Tue, Jun 18, 2024, 04:13 Stefano Zacchiroli <za...@upsilon.cc> wrote:
On Tue, Jun 18, 2024 at 03:36:34PM +0800, Martin Michlmayr wrote:
> * Stefano Zacchiroli <za...@upsilon.cc> [2024-06-18 09:27]:
> > I welcome migration tips on what's the easiest migration path (to
> > beangulp, I guess?)
>
> Yes.

Thanks, although I'm still a bit confused.

This document
https://docs.google.com/document/d/1hBfsHZcoHgz5rvhCdP42g2FJ5ouycIMV4H1tfgXpwBU/
"Importing External Data in Beancount" is about v3 ("This document is
about Beancount v3, under development, and a work in progress.") and
Beangulp, but still talks about bean-extract as an executable involved
in importing transactions with v3/beangulp.

What am I missing?

Ah yes.... I should rename all the v3 docs to sometime more generic, like roadmap to the future or something. Will do.
 Thanks for reminding me

Two "v3" docs are really about a future rewrite or a desiderata. I've renamed those to "Vnext."
Those are very much still relevant for future work.

Some of the other "v3" docs were about "v3" as in "C++ rewrite," and now that that's moved to a branch, 
I just called those "C++ version". You can safely ignore these.

The content is largely unchanged. You've already read all those docs, there's nothing really new but a change in name.

I'm hoping to restart doing some needed changes incrementally to what is now called "v3" this summer.
In particular, I think making precision and tolerance explicit can be done backwards-compatibly and a lot of questions come about that.
Modernizing a bit, I've applied auto-formatting (via ruff format) over the weekend, and will be adding types as well over time.

Marcio A. Vianna F. (mvianna)

unread,
Jun 18, 2024, 10:31:14 AM6/18/24
to Beancount
Hi,

Let me avail this thread for a request: Could anyone give a recepy for computer semi-literate people of how to remain on the latest version 2 + reds importers + fava for the time being?

Shoul I "pip install beancount<3" or something? Should I pin the version?

Thanks in advance.

Marcio

francois PEGORY

unread,
Jun 20, 2024, 6:51:29 AM6/20/24
to bean...@googlegroups.com
i agree that it is a great news.
nows , fava need to be updated in orer to work beancount  3...

Le lun. 17 juin 2024 à 18:13, Lover O'Bean <lover...@gmail.com> a écrit :
Great news!

--
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 beancount+...@googlegroups.com.

Martin Blais

unread,
Jun 22, 2024, 2:49:05 PM6/22/24
to Martin Blais, bean...@googlegroups.com
I just fixed the github actions/workflows to produce and upload valid wheels.
It includes wheels from 3.8 to 3.12 for windows, macos, linux for 3.0.0.


Stefano Zacchiroli

unread,
Jul 7, 2024, 8:06:48 AM7/7/24
to bean...@googlegroups.com
On Tue, Jun 18, 2024 at 11:57:21AM +0200, Daniele Nicolodi wrote:
> The best documentation there is for beangulp is the example included in the
> repository https://github.com/beancount/beangulp/tree/master/examples and
> the docstrings in the code.
>
> In a nutshell, to upgrade from beancount.ingest to beangulp, it shoul be
> sufficient to modify all Python imports from the beancount.ingest namespace
> to the beangulp namespace and to turn the configuration file that was used
> to be passed to bean-extract into a self-standing script as demonstrated
> here https://github.com/beancount/beangulp/blob/master/examples/import.py
> Then, calling such script with a '--help' argument should be enough to
> understand how to use it.

Thanks a lot for the above indications, which got me started.

I got stuck on a type error though, which I'm mentioning here in case it
helps other migrating and/or you want to change something about it:

Traceback (most recent call last):
File "/home/zack/dati/ledger/bin/bean-extract.py", line 86, in <module>
ingest = beangulp.Ingest(importers, hooks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zack/.cache/virtualenvs/ledger3/lib/python3.11/site-packages/beangulp/__init__.py", line 258, in __init__
self.importers = [_importer(i) for i in importers]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zack/.cache/virtualenvs/ledger3/lib/python3.11/site-packages/beangulp/__init__.py", line 258, in <listcomp>
self.importers = [_importer(i) for i in importers]
^^^^^^^^^^^^
File "/home/zack/.cache/virtualenvs/ledger3/lib/python3.11/site-packages/beangulp/__init__.py", line 253, in _importer
raise TypeError(f'expected bengulp.Importer not {type(importer):}')
TypeError: expected bengulp.Importer not <class 'type'>

My v2 type hierarchy looked (for a specific importer example) like this:

AmexImporter -> CsvImporter -> importer.ImporterProtocol

Back then (v2) one should inherit from ImporterProtocol, whereas now
(v3) one should inherit from beangulp.Importer, like in the examples;
correct? But then, if I change my hierarchy to match, I get an even
nastier type error in the same place:

TypeError: expected bengulp.Importer not <class 'abc.ABCMeta'>

I'm tempted at this point to nuke everything and restart from scratch
using the new csvbase.Importer. But maybe I'm missing something about
why the trivial migration that you were suggesting isn't working in my
case.

Thanks in advance!
Cheers

Daniele Nicolodi

unread,
Jul 7, 2024, 8:21:21 AM7/7/24
to bean...@googlegroups.com
On 07/07/24 14:06, Stefano Zacchiroli wrote:
> Back then (v2) one should inherit from ImporterProtocol, whereas now
> (v3) one should inherit from beangulp.Importer, like in the examples;
> correct?

This is optional. If the machinery is passed importers that implement
ImporterProtocol it wraps them into an adapter that implements the new
interface. I cannot exclude there are bugs, though.

The traceback has a bug in the exception message, for a start.

> But then, if I change my hierarchy to match, I get an even
> nastier type error in the same place:
>
> TypeError: expected bengulp.Importer not <class 'abc.ABCMeta'>

This is a funny one, but without more details it is hard for me to
understand where this is coming from. It is a long while since I put
that code together. If you can share your importer code or (even better)
a minimal example that demonstrates the issue, I can have a closer look.

> I'm tempted at this point to nuke everything and restart from scratch
> using the new csvbase.Importer. But maybe I'm missing something about
> why the trivial migration that you were suggesting isn't working in my
> case.

It should work. I'm adding a test to check if it actually works.

Cheers,
Dan

Daniele Nicolodi

unread,
Jul 7, 2024, 8:25:08 AM7/7/24
to bean...@googlegroups.com
On 07/07/24 14:06, Stefano Zacchiroli wrote:
> On Tue, Jun 18, 2024 at 11:57:21AM +0200, Daniele Nicolodi wrote:
>> The best documentation there is for beangulp is the example included in the
>> repository https://github.com/beancount/beangulp/tree/master/examples and
>> the docstrings in the code.
>>
>> In a nutshell, to upgrade from beancount.ingest to beangulp, it shoul be
>> sufficient to modify all Python imports from the beancount.ingest namespace
>> to the beangulp namespace and to turn the configuration file that was used
>> to be passed to bean-extract into a self-standing script as demonstrated
>> here https://github.com/beancount/beangulp/blob/master/examples/import.py
>> Then, calling such script with a '--help' argument should be enough to
>> understand how to use it.
>
> Thanks a lot for the above indications, which got me started.
>
> I got stuck on a type error though, which I'm mentioning here in case it
> helps other migrating and/or you want to change something about it:

I think I know what is going wrong! You need to pass class instances,
not the class themselves to beangulp.Ingest(). This would explain the
errors you see. Maybe I should add an explicit check for this and report
a friendlier error.

Cheers,
Dan

Stefano Zacchiroli

unread,
Jul 9, 2024, 2:44:41 AM7/9/24
to bean...@googlegroups.com
On Sun, Jul 07, 2024 at 02:25:04PM +0200, Daniele Nicolodi wrote:
> I think I know what is going wrong! You need to pass class instances, not
> the class themselves to beangulp.Ingest(). This would explain the errors you
> see. Maybe I should add an explicit check for this and report a friendlier
> error.

Nice catch, that was indeed it for this specific error. Next one up
(after passing the account name as single parameter for the
constructor) is:

TypeError: Can't instantiate abstract class AmexImporter with abstract method account

It looks like the protocol is significantly different wrt the previous
version. But I'll send you my example code offlist, as you suggested in
previous email. Thanks!

Daniele Nicolodi

unread,
Jul 9, 2024, 4:00:00 AM7/9/24
to bean...@googlegroups.com
Ciao Stefano,

thank you for sharing your code with me. I had a quick look and I think
I see what is going wrong. However, the code you sent is not self
contained (it depends on code that was not included in the tarball) thus
I was not able to properly test things.

On 09/07/24 08:44, Stefano Zacchiroli wrote:
> Nice catch, that was indeed it for this specific error. Next one up
> (after passing the account name as single parameter for the
> constructor)

In the importer class definitions in the code you sent me the class
constructors do not take any parameter. I had to remove the parameters
passed to the constructor to make it work.

> is:
>
> TypeError: Can't instantiate abstract class AmexImporter with abstract method account
>
> It looks like the protocol is significantly different wrt the previous
> version. But I'll send you my example code offlist, as you suggested in
> previous email. Thanks!

Yes! The beangulp.Importer protocol is different from the old
beangulp.ImporterProtocol (otherwise there would not have been any need
to rename the interface).

The old protocol is defined here:

https://github.com/beancount/beangulp/blob/ec3752930efdfa7358890e263f1aba16151ae316/beangulp/importer.py#L167-L199

The new protocol is defined here:

https://github.com/beancount/beangulp/blob/ec3752930efdfa7358890e263f1aba16151ae316/beangulp/importer.py#L20-L164

As you can see, some methods have been renamed. The other important
change, is that beangulp.Importer is now an ABC, thus the implementation
will check that any subclass implements the expected interface when it
is instantiated.

At a quick look, it seems that you changed your importers base class
from deriving from beancount.ingest.ImporterProtocol (or similar, I
don't remember the exact import path) to beangulp.Importer but kept the
implementation unchanged. This is not expected to work.

What works is to keep the implementation unchanged and derive from
beangulp.ImporterProtocol or update the implementation to the interface
defined in beangulp.Importer and derive from this ABC.

If I change your mybeancount.private.ingest.importers.CsvImporter to
derive from beangulp.ImporterProtocol I can execute bean-extract.py.

Alternatively, mybeancount.private.ingest.importers.CsvImporter can
derive from beangulp.Importer but the file_account() method needs to be
renamed account() (which requires to rename the account class member to
something else).

I hope this helps.

Cheers,
Dan

Stefano Zacchiroli

unread,
Jul 9, 2024, 2:54:39 PM7/9/24
to bean...@googlegroups.com
On Tue, Jul 09, 2024 at 09:59:54AM +0200, Daniele Nicolodi wrote:
> As you can see, some methods have been renamed. The other important change,
> is that beangulp.Importer is now an ABC, thus the implementation will check
> that any subclass implements the expected interface when it is instantiated.
>
> At a quick look, it seems that you changed your importers base class from
> deriving from beancount.ingest.ImporterProtocol (or similar, I don't
> remember the exact import path) to beangulp.Importer but kept the
> implementation unchanged. This is not expected to work.

That was exactly my issue. I failed to isolate it as root cause as I
mixed this change with the one discussed previously in the thread.
Chaning my class inheritance back to
beancount.ingest.importer.ImporterProtocol fixed the issue. I now have a
working setup based on v3.

(But I'm going to upgrade to the new protocol anyway, as the new
warnings are conspicuous enough :-))

In case there is somewhere a migration guide from v2 ingest to v3
beangulp, this ought to be noted down for others. (I would have probably
given up myself on this without your help.)

Thanks a lot!

Ryan Peach

unread,
Aug 14, 2024, 11:51:26 PM8/14/24
to Beancount
❯ poetry add beancount fava
Using version ^3.0.0 for beancount
Using version ^1.28 for fava

Updating dependencies
Resolving dependencies... (0.1s)

Because no versions of fava match >1.28,<2.0
 and fava (1.28) depends on beancount (>=2.3.5,<3), fava (>=1.28,<2.0) requires beancount (>=2.3.5,<3).
So, because budget depends on both beancount (^3.0.0) and fava (^1.28), version solving failed.

Eric Altendorf

unread,
Aug 15, 2024, 12:24:44 AM8/15/24
to bean...@googlegroups.com
On Wed, Aug 14, 2024 at 8:51 PM Ryan Peach <rgpe...@gmail.com> wrote:
❯ poetry add beancount fava
Using version ^3.0.0 for beancount
Using version ^1.28 for fava

Updating dependencies
Resolving dependencies... (0.1s)

Because no versions of fava match >1.28,<2.0
 and fava (1.28) depends on beancount (>=2.3.5,<3), fava (>=1.28,<2.0) requires beancount (>=2.3.5,<3).
So, because budget depends on both beancount (^3.0.0) and fava (^1.28), version solving failed.

as francois implies below, i'm pretty sure fava has not been updated to work with beancount 3.0.
 

On Thursday, June 20, 2024 at 6:51:29 AM UTC-4 francois PEGORY wrote:
i agree that it is a great news.
nows , fava need to be updated in orer to work beancount  3...

Le lun. 17 juin 2024 à 18:13, Lover O'Bean <lover...@gmail.com> a écrit :
Great news!

--
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 beancount+...@googlegroups.com.

--
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 beancount+...@googlegroups.com.

K D

unread,
Aug 16, 2024, 12:07:28 AM8/16/24
to Beancount
I spent a good 20 minute tracking down dependencies trying to get the latest v3 up and running on WSL ubuntu. Then did a pip install fava and it uninstalled v3 and installed v2.6.

Chary Chary

unread,
Aug 16, 2024, 5:44:40 AM8/16/24
to Beancount
I confirm, that on Windows everything just works with the version 3.0.0.

py -3.12 -m pip install beancount

It then installs from wheel

Also installing the latest and greatest version from github works the "old school way":

cd beancount
beancount>py -3.12 setup.py build_ext -i

And then setup the PYTHONPATH 

Daniele Nicolodi

unread,
Aug 17, 2024, 11:53:24 AM8/17/24
to bean...@googlegroups.com
On 16/08/24 03:33, K D wrote:
> I spent a good 20 minute tracking down dependencies trying to get the
> latest v3 up and running on WSL ubuntu

I'm surprised that you had to do anything to install beancount
dependencies. Simply executing `pip install beancount` should install
beancount and all required dependencies. If you had to do anything more
than that, there is a bug somewhere. Can you please be more precise
about the difficulties encountered in installing beancount?

Cheers,
Dan

Reply all
Reply to author
Forward
0 new messages